mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[9795] Implement CONDITION_INSTANCE_SCRIPT (mapid, some_id)
True if mapid fit to called instance map id and instance script confirm success for some_id case. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
929798e635
commit
3032e80bb6
8 changed files with 41 additions and 8 deletions
|
|
@ -45,6 +45,7 @@
|
|||
#include "WaypointManager.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Mail.h"
|
||||
#include "InstanceData.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
|
|
@ -7417,6 +7418,15 @@ bool PlayerCondition::Meets(Player const * player) const
|
|||
}
|
||||
return false;
|
||||
}
|
||||
case CONDITION_INSTANCE_SCRIPT:
|
||||
{
|
||||
// have meaning only for specific map instance script so ignore other maps
|
||||
if (player->GetMapId() != value1)
|
||||
return false;
|
||||
if (InstanceData* data = player->GetInstanceData())
|
||||
return data->CheckConditionCriteriaMeet(player, value1, value2);
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -7630,6 +7640,17 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
|
|||
|
||||
break;
|
||||
}
|
||||
case CONDITION_INSTANCE_SCRIPT:
|
||||
{
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(value1);
|
||||
if (!mapEntry || !mapEntry->IsDungeon())
|
||||
{
|
||||
sLog.outErrorDb("Instance script condition has not existed map id %u as first arg, skipped", value1);
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case CONDITION_NONE:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue