Core: Some function renaming.
This commit is contained in:
1 parent
46374bf533
commit
66978cfc3b
449 files changed
+2412
-2412
No files matched your search
@@ -1042,7 +1042,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
break;
|
||||
|
||||
// The AI is only updated if the creature is alive
|
||||
if (me->isAlive())
|
||||
if (me->IsAlive())
|
||||
{
|
||||
CAST_AI(SmartAI, me->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1); // Next tick
|
||||
CAST_AI(SmartAI, me->AI())->StartDespawn();
|
||||
@@ -1602,9 +1602,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (Creature* target = (*itr)->ToCreature())
|
||||
if (IsSmart(target) && target->getVictim())
|
||||
if (IsSmart(target) && target->GetVictim())
|
||||
if (CAST_AI(SmartAI, target->AI())->CanCombatMove())
|
||||
target->GetMotionMaster()->MoveChase(target->getVictim(), attackDistance, attackAngle);
|
||||
target->GetMotionMaster()->MoveChase(target->GetVictim(), attackDistance, attackAngle);
|
||||
|
||||
delete targets;
|
||||
}
|
||||
@@ -2257,8 +2257,8 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
l->push_back(baseObject);
|
||||
break;
|
||||
case SMART_TARGET_VICTIM:
|
||||
if (me && me->getVictim())
|
||||
l->push_back(me->getVictim());
|
||||
if (me && me->GetVictim())
|
||||
l->push_back(me->GetVictim());
|
||||
break;
|
||||
case SMART_TARGET_HOSTILE_SECOND_AGGRO:
|
||||
if (me)
|
||||
@@ -2532,18 +2532,18 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax);
|
||||
break;
|
||||
case SMART_EVENT_UPDATE_OOC:
|
||||
if (me && me->isInCombat())
|
||||
if (me && me->IsInCombat())
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax);
|
||||
break;
|
||||
case SMART_EVENT_UPDATE_IC:
|
||||
if (!me || !me->isInCombat())
|
||||
if (!me || !me->IsInCombat())
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax);
|
||||
break;
|
||||
case SMART_EVENT_HEALT_PCT:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->GetMaxHealth())
|
||||
if (!me || !me->IsInCombat() || !me->GetMaxHealth())
|
||||
return;
|
||||
uint32 perc = (uint32)me->GetHealthPct();
|
||||
if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min)
|
||||
@@ -2553,17 +2553,17 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_TARGET_HEALTH_PCT:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxHealth())
|
||||
if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxHealth())
|
||||
return;
|
||||
uint32 perc = (uint32)me->getVictim()->GetHealthPct();
|
||||
uint32 perc = (uint32)me->GetVictim()->GetHealthPct();
|
||||
if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min)
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->getVictim());
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim());
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_MANA_PCT:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->GetMaxPower(POWER_MANA))
|
||||
if (!me || !me->IsInCombat() || !me->GetMaxPower(POWER_MANA))
|
||||
return;
|
||||
uint32 perc = uint32(100.0f * me->GetPower(POWER_MANA) / me->GetMaxPower(POWER_MANA));
|
||||
if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min)
|
||||
@@ -2573,34 +2573,34 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_TARGET_MANA_PCT:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxPower(POWER_MANA))
|
||||
if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxPower(POWER_MANA))
|
||||
return;
|
||||
uint32 perc = uint32(100.0f * me->getVictim()->GetPower(POWER_MANA) / me->getVictim()->GetMaxPower(POWER_MANA));
|
||||
uint32 perc = uint32(100.0f * me->GetVictim()->GetPower(POWER_MANA) / me->GetVictim()->GetMaxPower(POWER_MANA));
|
||||
if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min)
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->getVictim());
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim());
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_RANGE:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->getVictim())
|
||||
if (!me || !me->IsInCombat() || !me->GetVictim())
|
||||
return;
|
||||
|
||||
if (me->IsInRange(me->getVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max))
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->getVictim());
|
||||
if (me->IsInRange(me->GetVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max))
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim());
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_TARGET_CASTING:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->IsNonMeleeSpellCasted(false, false, true))
|
||||
if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->IsNonMeleeSpellCasted(false, false, true))
|
||||
return;
|
||||
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->getVictim());
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim());
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_FRIENDLY_HEALTH:
|
||||
{
|
||||
if (!me || !me->isInCombat())
|
||||
if (!me || !me->IsInCombat())
|
||||
return;
|
||||
|
||||
Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealt.radius, e.event.friendlyHealt.hpDeficit);
|
||||
@@ -2611,7 +2611,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_FRIENDLY_IS_CC:
|
||||
{
|
||||
if (!me || !me->isInCombat())
|
||||
if (!me || !me->IsInCombat())
|
||||
return;
|
||||
|
||||
std::list<Creature*> pList;
|
||||
@@ -2643,9 +2643,9 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_TARGET_BUFFED:
|
||||
{
|
||||
if (!me || !me->getVictim())
|
||||
if (!me || !me->GetVictim())
|
||||
return;
|
||||
uint32 count = me->getVictim()->GetAuraCount(e.event.aura.spell);
|
||||
uint32 count = me->GetVictim()->GetAuraCount(e.event.aura.spell);
|
||||
if (count < e.event.aura.count)
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.aura.repeatMin, e.event.aura.repeatMax);
|
||||
@@ -2680,7 +2680,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
if (!me)
|
||||
return;
|
||||
|
||||
if (Unit* victim = me->getVictim())
|
||||
if (Unit* victim = me->GetVictim())
|
||||
{
|
||||
if (!victim->HasInArc(static_cast<float>(M_PI), me))
|
||||
ProcessTimedAction(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax, victim);
|
||||
@@ -2721,7 +2721,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_OOC_LOS:
|
||||
{
|
||||
if (!me || me->isInCombat())
|
||||
if (!me || me->IsInCombat())
|
||||
return;
|
||||
//can trigger if closer than fMaxAllowedRange
|
||||
float range = (float)e.event.los.maxDist;
|
||||
@@ -2741,7 +2741,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_IC_LOS:
|
||||
{
|
||||
if (!me || !me->isInCombat())
|
||||
if (!me || !me->IsInCombat())
|
||||
return;
|
||||
//can trigger if closer than fMaxAllowedRange
|
||||
float range = (float)e.event.los.maxDist;
|
||||
@@ -2961,10 +2961,10 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
|
||||
if (e.event.event_phase_mask && !IsInPhase(e.event.event_phase_mask))
|
||||
return;
|
||||
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->isInCombat()))
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->IsInCombat()))
|
||||
return;
|
||||
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->isInCombat()))//can be used with me=NULL (go script)
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat()))//can be used with me=NULL (go script)
|
||||
return;
|
||||
|
||||
if (e.timer < diff)
|
||||
@@ -3199,7 +3199,7 @@ void SmartScript::OnMoveInLineOfSight(Unit* who)
|
||||
if (!me)
|
||||
return;
|
||||
|
||||
if (me->getVictim())
|
||||
if (me->GetVictim())
|
||||
return;
|
||||
|
||||
ProcessEventsFor(SMART_EVENT_IC_LOS, who);
|
||||
|
||||
Reference in new issue
Block a user