Core/Unit: Renamed addUnitState/hasUnitState/clearUnitState to AddUnitState/HasUnitState/ClearUnitState

Core/Vehicles: Allow the vehicle to always damage the passenger (removed unneded dbc hacks from scripts)

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-17 13:43:24 +01:00
parent ee3fd3ebeb
commit 82f45966fc
99 changed files with 353 additions and 361 deletions
@@ -82,7 +82,7 @@ public:
summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false);
summoned->setFaction(me->getFaction());
summoned->SetLevel(me->getLevel());
summoned->addUnitState(UNIT_STAT_ROOT);
summoned->AddUnitState(UNIT_STAT_ROOT);
if (Unit *pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID))
summoned->AI()->AttackStart(pFocusedTarget);
@@ -337,7 +337,7 @@ class boss_vazruden_the_herald : public CreatureScript
VazrudenGUID = 0;
}
summoned = false;
me->clearUnitState(UNIT_STAT_ROOT);
me->ClearUnitState(UNIT_STAT_ROOT);
me->SetVisible(true);
}
}
@@ -352,7 +352,7 @@ class boss_vazruden_the_herald : public CreatureScript
NazanGUID = Nazan->GetGUID();
summoned = true;
me->SetVisible(false);
me->addUnitState(UNIT_STAT_ROOT);
me->AddUnitState(UNIT_STAT_ROOT);
}
}
@@ -267,7 +267,7 @@ class boss_magtheridon : public CreatureScript
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->addUnitState(UNIT_STAT_STUNNED);
me->AddUnitState(UNIT_STAT_STUNNED);
DoCast(me, SPELL_SHADOW_CAGE_C, true);
}
@@ -348,7 +348,7 @@ class boss_magtheridon : public CreatureScript
void AttackStart(Unit *who)
{
if (!me->hasUnitState(UNIT_STAT_STUNNED))
if (!me->HasUnitState(UNIT_STAT_STUNNED))
ScriptedAI::AttackStart(who);
}
@@ -402,7 +402,7 @@ class boss_magtheridon : public CreatureScript
if (BlastNova_Timer <= diff)
{
// to avoid earthquake interruption
if (!me->hasUnitState(UNIT_STAT_STUNNED))
if (!me->HasUnitState(UNIT_STAT_STUNNED))
{
DoScriptText(EMOTE_BLASTNOVA, me);
DoCast(me, SPELL_BLASTNOVA);
@@ -445,7 +445,7 @@ class boss_magtheridon : public CreatureScript
if (!Phase3 && HealthBelowPct(30)
&& !me->IsNonMeleeSpellCasted(false) // blast nova
&& !me->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
&& !me->HasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
{
Phase3 = true;
DoScriptText(SAY_CHAMBER_DESTROY, me);
@@ -224,7 +224,7 @@ class instance_magtheridons_lair : public InstanceMapScript
Creature* Magtheridon = instance->GetCreature(MagtheridonGUID);
if (Magtheridon && Magtheridon->isAlive())
{
Magtheridon->clearUnitState(UNIT_STAT_STUNNED);
Magtheridon->ClearUnitState(UNIT_STAT_STUNNED);
Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999));
}
CageTimer = 0;
@@ -398,7 +398,7 @@ class boss_kaelthas : public CreatureScript
void MoveInLineOfSight(Unit *who)
{
if (!me->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() &&
if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() &&
me->IsHostileTo(who) && who->isInAccessiblePlaceFor(me))
{
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+1 -1
View File
@@ -798,7 +798,7 @@ public:
Materialize = true;
}
if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->hasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
DoCast(me, SPELL_PHASE_SLIP);
if (!UpdateVictim())
@@ -1258,7 +1258,7 @@ public:
AggroTargetGUID = 0;
Timers = false;
me->addUnitState(UNIT_STAT_ROOT);
me->AddUnitState(UNIT_STAT_ROOT);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
}
@@ -1302,7 +1302,7 @@ public:
if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID)))
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->clearUnitState(UNIT_STAT_ROOT);
me->ClearUnitState(UNIT_STAT_ROOT);
float x, y, z;
AggroTarget->GetPosition(x,y,z);