Merge branch '4.3.4_phases' of https://github.com/TrinityCore/TrinityCore into 4.3.4

This commit is contained in:
Kinzcool
2014-06-18 23:25:57 -04:00
63 changed files with 623 additions and 1039 deletions

View File

@@ -1045,7 +1045,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
delete targets;
break;
}
case SMART_ACTION_SET_INGAME_PHASE_MASK:
case SMART_ACTION_SET_INGAME_PHASE_ID:
{
ObjectList* targets = GetTargets(e, unit);
@@ -1053,12 +1053,23 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
if (IsUnit(*itr))
(*itr)->ToUnit()->SetPhaseMask(e.action.ingamePhaseMask.mask, true);
else if (IsGameObject(*itr))
(*itr)->ToGameObject()->SetPhaseMask(e.action.ingamePhaseMask.mask, true);
}
(*itr)->SetInPhase(e.action.ingamePhaseId.id, true, e.action.ingamePhaseId.apply == 1);
delete targets;
break;
}
case SMART_ACTION_SET_INGAME_PHASE_GROUP:
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
break;
std::set<uint32> const& phases = GetPhasesForGroup(e.action.ingamePhaseGroup.groupId);
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
for (auto phase : phases)
(*itr)->SetInPhase(phase, true, e.action.ingamePhaseGroup.apply == 1);
delete targets;
break;