Core/Spells: Set UNIT_FIELD_TARGET to current spell cast target for proper facing the target

This commit is contained in:
Shauren
2011-07-15 12:33:03 +02:00
parent 944fb4c1b7
commit 1e3c23a4e8
27 changed files with 125 additions and 96 deletions
@@ -1489,7 +1489,7 @@ void Creature::setDeathState(DeathState s)
if (sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss()) if (sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
SaveRespawnTime(); SaveRespawnTime();
SetUInt64Value(UNIT_FIELD_TARGET, 0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState) SetTarget(0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
setActive(false); setActive(false);
+12 -9
View File
@@ -235,6 +235,9 @@ m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this)
m_duringRemoveFromWorld = false; m_duringRemoveFromWorld = false;
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE); m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
_focusSpell = NULL;
_targetLocked = false;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -9579,7 +9582,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
m_attacking->_addAttacker(this); m_attacking->_addAttacker(this);
// Set our target // Set our target
SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID()); SetTarget(victim->GetGUID());
if (meleeAttack) if (meleeAttack)
AddUnitState(UNIT_STAT_MELEE_ATTACKING); AddUnitState(UNIT_STAT_MELEE_ATTACKING);
@@ -9621,7 +9624,7 @@ bool Unit::AttackStop()
m_attacking = NULL; m_attacking = NULL;
// Clear our target // Clear our target
SetUInt64Value(UNIT_FIELD_TARGET, 0); SetTarget(0);
ClearUnitState(UNIT_STAT_MELEE_ATTACKING); ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
@@ -14334,7 +14337,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
// no more charges to use, prevent proc // no more charges to use, prevent proc
if (useCharges && !i->aura->GetCharges()) if (useCharges && !i->aura->GetCharges())
continue; continue;
bool takeCharges = false; bool takeCharges = false;
SpellEntry const* spellInfo = i->aura->GetSpellProto(); SpellEntry const* spellInfo = i->aura->GetSpellProto();
uint32 Id = i->aura->GetId(); uint32 Id = i->aura->GetId();
@@ -15729,7 +15732,7 @@ void Unit::SetStunned(bool apply)
{ {
if (apply) if (apply)
{ {
SetUInt64Value(UNIT_FIELD_TARGET, 0); SetTarget(0);
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
// MOVEMENTFLAG_ROOT cannot be used in conjunction with // MOVEMENTFLAG_ROOT cannot be used in conjunction with
@@ -15755,7 +15758,7 @@ void Unit::SetStunned(bool apply)
else else
{ {
if (isAlive() && getVictim()) if (isAlive() && getVictim())
SetUInt64Value(UNIT_FIELD_TARGET, getVictim()->GetGUID()); SetTarget(getVictim()->GetGUID());
// don't remove UNIT_FLAG_STUNNED for pet when owner is mounted (disabled pet's interface) // don't remove UNIT_FLAG_STUNNED for pet when owner is mounted (disabled pet's interface)
Unit* pOwner = GetOwner(); Unit* pOwner = GetOwner();
@@ -15830,7 +15833,7 @@ void Unit::SetFeared(bool apply)
{ {
if (apply) if (apply)
{ {
SetUInt64Value(UNIT_FIELD_TARGET, 0); SetTarget(0);
Unit* caster = NULL; Unit* caster = NULL;
Unit::AuraEffectList const& fearAuras = GetAuraEffectsByType(SPELL_AURA_MOD_FEAR); Unit::AuraEffectList const& fearAuras = GetAuraEffectsByType(SPELL_AURA_MOD_FEAR);
@@ -15847,7 +15850,7 @@ void Unit::SetFeared(bool apply)
if (GetMotionMaster()->GetCurrentMovementGeneratorType() == FLEEING_MOTION_TYPE) if (GetMotionMaster()->GetCurrentMovementGeneratorType() == FLEEING_MOTION_TYPE)
GetMotionMaster()->MovementExpired(); GetMotionMaster()->MovementExpired();
if (getVictim()) if (getVictim())
SetUInt64Value(UNIT_FIELD_TARGET, getVictim()->GetGUID()); SetTarget(getVictim()->GetGUID());
} }
} }
@@ -15859,7 +15862,7 @@ void Unit::SetConfused(bool apply)
{ {
if (apply) if (apply)
{ {
SetUInt64Value(UNIT_FIELD_TARGET, 0); SetTarget(0);
GetMotionMaster()->MoveConfused(); GetMotionMaster()->MoveConfused();
} }
else else
@@ -15869,7 +15872,7 @@ void Unit::SetConfused(bool apply)
if (GetMotionMaster()->GetCurrentMovementGeneratorType() == CONFUSED_MOTION_TYPE) if (GetMotionMaster()->GetCurrentMovementGeneratorType() == CONFUSED_MOTION_TYPE)
GetMotionMaster()->MovementExpired(); GetMotionMaster()->MovementExpired();
if (getVictim()) if (getVictim())
SetUInt64Value(UNIT_FIELD_TARGET, getVictim()->GetGUID()); SetTarget(getVictim()->GetGUID());
} }
} }
+34
View File
@@ -2128,6 +2128,37 @@ class Unit : public WorldObject
TempSummon* ToTempSummon() { if (isSummon()) return reinterpret_cast<TempSummon*>(this); else return NULL; } TempSummon* ToTempSummon() { if (isSummon()) return reinterpret_cast<TempSummon*>(this); else return NULL; }
const TempSummon* ToTempSummon() const { if (isSummon()) return reinterpret_cast<const TempSummon*>(this); else return NULL; } const TempSummon* ToTempSummon() const { if (isSummon()) return reinterpret_cast<const TempSummon*>(this); else return NULL; }
void SetTarget(uint64 guid)
{
if (!_targetLocked)
SetUInt64Value(UNIT_FIELD_TARGET, guid);
}
void FocusTarget(Spell const* focusSpell, uint64 target)
{
// already focused
if (_focusSpell)
return;
_focusSpell = focusSpell;
_targetLocked = true;
SetUInt64Value(UNIT_FIELD_TARGET, target);
}
void ReleaseFocus(Spell const* focusSpell)
{
// focused to something else
if (focusSpell != _focusSpell)
return;
_focusSpell = NULL;
_targetLocked = false;
if (Unit* victim = getVictim())
SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
else
SetUInt64Value(UNIT_FIELD_TARGET, 0);
}
protected: protected:
explicit Unit (); explicit Unit ();
@@ -2244,6 +2275,9 @@ class Unit : public WorldObject
bool m_cleanupDone; // lock made to not add stuff after cleanup before delete bool m_cleanupDone; // lock made to not add stuff after cleanup before delete
bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world
Spell const* _focusSpell;
bool _targetLocked; // locks the target during spell cast for proper facing
}; };
namespace Trinity namespace Trinity
@@ -85,7 +85,7 @@ ConfusedMovementGenerator<T>::Initialize(T &unit)
} }
} }
unit.SetUInt64Value(UNIT_FIELD_TARGET, 0); unit.SetTarget(0);
unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
unit.CastStop(); unit.CastStop();
unit.StopMoving(); unit.StopMoving();
@@ -170,7 +170,7 @@ ConfusedMovementGenerator<T>::Finalize(T &unit)
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
unit.ClearUnitState(UNIT_STAT_CONFUSED); unit.ClearUnitState(UNIT_STAT_CONFUSED);
if (unit.GetTypeId() == TYPEID_UNIT && unit.getVictim()) if (unit.GetTypeId() == TYPEID_UNIT && unit.getVictim())
unit.SetUInt64Value(UNIT_FIELD_TARGET, unit.getVictim()->GetGUID()); unit.SetTarget(unit.getVictim()->GetGUID());
} }
template void ConfusedMovementGenerator<Player>::Initialize(Player &player); template void ConfusedMovementGenerator<Player>::Initialize(Player &player);
@@ -304,7 +304,7 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
owner.CastStop(); owner.CastStop();
owner.AddUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); owner.AddUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.SetUInt64Value(UNIT_FIELD_TARGET, 0); owner.SetTarget(0);
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
if (Unit* fright = ObjectAccessor::GetUnit(owner, i_frightGUID)) if (Unit* fright = ObjectAccessor::GetUnit(owner, i_frightGUID))
@@ -353,7 +353,7 @@ FleeingMovementGenerator<T>::Finalize(T &owner)
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
if (owner.GetTypeId() == TYPEID_UNIT && owner.getVictim()) if (owner.GetTypeId() == TYPEID_UNIT && owner.getVictim())
owner.SetUInt64Value(UNIT_FIELD_TARGET, owner.getVictim()->GetGUID()); owner.SetTarget(owner.getVictim()->GetGUID());
} }
template<class T> template<class T>
@@ -489,22 +489,6 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recv_data)
//GetPlayer()->SendInitWorldStates(true, newZone); //GetPlayer()->SendInitWorldStates(true, newZone);
} }
void WorldSession::HandleSetTargetOpcode(WorldPacket & recv_data)
{
uint64 guid;
recv_data >> guid;
_player->SetUInt32Value(UNIT_FIELD_TARGET, uint32(guid));
// update reputation list if need
Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
if (!unit)
return;
if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->getFaction()))
_player->GetReputationMgr().SetVisible(factionTemplateEntry);
}
void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data) void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data)
{ {
uint64 guid; uint64 guid;
@@ -326,7 +326,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data)
sLog->outDetail("WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); sLog->outDetail("WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID);
recv_data >> guid; recv_data >> guid;
GetPlayer()->SetUInt64Value(UNIT_FIELD_TARGET, guid); GetPlayer()->SetSelection(guid);
GossipText const* pGossip = sObjectMgr->GetGossipText(textID); GossipText const* pGossip = sObjectMgr->GetGossipText(textID);
-1
View File
@@ -467,7 +467,6 @@ class WorldSession
void HandleTogglePvP(WorldPacket& recvPacket); void HandleTogglePvP(WorldPacket& recvPacket);
void HandleZoneUpdateOpcode(WorldPacket& recvPacket); void HandleZoneUpdateOpcode(WorldPacket& recvPacket);
void HandleSetTargetOpcode(WorldPacket& recvPacket);
void HandleSetSelectionOpcode(WorldPacket& recvPacket); void HandleSetSelectionOpcode(WorldPacket& recvPacket);
void HandleStandStateChangeOpcode(WorldPacket& recvPacket); void HandleStandStateChangeOpcode(WorldPacket& recvPacket);
void HandleEmoteOpcode(WorldPacket& recvPacket); void HandleEmoteOpcode(WorldPacket& recvPacket);
+10 -1
View File
@@ -528,7 +528,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
// Determine if spell can be reflected back to the caster // Determine if spell can be reflected back to the caster
// Patch 1.2 notes: Spell Reflection no longer reflects abilities // Patch 1.2 notes: Spell Reflection no longer reflects abilities
m_canReflect = m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !(m_spellInfo->Attributes & SPELL_ATTR0_ABILITY) m_canReflect = m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !(m_spellInfo->Attributes & SPELL_ATTR0_ABILITY)
&& !(m_spellInfo->AttributesEx & SPELL_ATTR1_CANT_BE_REFLECTED) && !(m_spellInfo->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) && !(m_spellInfo->AttributesEx & SPELL_ATTR1_CANT_BE_REFLECTED) && !(m_spellInfo->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)
&& !IsPassiveSpell(m_spellInfo) && !IsPositiveSpell(m_spellInfo->Id); && !IsPassiveSpell(m_spellInfo) && !IsPositiveSpell(m_spellInfo->Id);
@@ -2944,6 +2944,12 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
m_caster->SetCurrentCastedSpell(this); m_caster->SetCurrentCastedSpell(this);
SendSpellStart(); SendSpellStart();
// set target for proper facing
if (m_casttime && !m_IsTriggeredSpell)
if (uint64 target = m_targets.GetUnitTargetGUID())
if (m_caster->GetGUID() != target && m_caster->GetTypeId() == TYPEID_UNIT)
m_caster->FocusTarget(this, target);
TriggerGlobalCooldown(); TriggerGlobalCooldown();
//item: first cast may destroy item and second cast causes crash //item: first cast may destroy item and second cast causes crash
@@ -3578,6 +3584,9 @@ void Spell::finish(bool ok)
((Puppet*)charm)->UnSummon(); ((Puppet*)charm)->UnSummon();
} }
if (m_caster->GetTypeId() == TYPEID_UNIT)
m_caster->ReleaseFocus(this);
if (!ok) if (!ok)
return; return;
@@ -183,7 +183,7 @@ public:
if (pAttumen->getVictim()) if (pAttumen->getVictim())
{ {
pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim()); pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim());
pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID()); pAttumen->SetTarget(pAttumen->getVictim()->GetGUID());
} }
pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X, 1); pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X, 1);
} }
@@ -397,7 +397,7 @@ public:
return; return;
if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID()) if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID())
me->SetUInt64Value(UNIT_FIELD_TARGET, me->getVictim()->GetGUID()); me->SetTarget(me->getVictim()->GetGUID());
if (phase == 1) if (phase == 1)
{ {
@@ -535,7 +535,7 @@ public:
me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->ClearAllReactives(); me->ClearAllReactives();
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->SetStandState(UNIT_STAND_STATE_DEAD); me->SetStandState(UNIT_STAND_STATE_DEAD);
@@ -590,7 +590,7 @@ public:
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
me->SetSpeed(MOVE_RUN, 0.4f); me->SetSpeed(MOVE_RUN, 0.4f);
me->GetMotionMaster()->MoveChase(who); me->GetMotionMaster()->MoveChase(who);
me->SetUInt64Value(UNIT_FIELD_TARGET, TargetGUID); me->SetTarget(TargetGUID);
Intro = true; Intro = true;
} }
@@ -80,7 +80,7 @@ public:
player->GetClosePoint(x, y, z, me->GetObjectSize()); player->GetClosePoint(x, y, z, me->GetObjectSize());
z += 2.5; x -= 2; y -= 1.5; z += 2.5; x -= 2; y -= 1.5;
me->GetMotionMaster()->MovePoint(0, x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z);
me->SetUInt64Value(UNIT_FIELD_TARGET, player->GetGUID()); me->SetTarget(player->GetGUID());
me->SetVisible(true); me->SetVisible(true);
FlyBackTimer = 4500; FlyBackTimer = 4500;
break; break;
@@ -571,7 +571,7 @@ public:
{ {
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_TRAIL_TRIGGER, true); DoCast(me, SPELL_TRAIL_TRIGGER, true);
me->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); me->SetTarget(me->GetGUID());
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01f); // core bug me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01f); // core bug
} }
void Reset() {} void Reset() {}
@@ -204,7 +204,7 @@ public:
uiOutroTimer = 8000; uiOutroTimer = 8000;
break; break;
case 2: case 2:
me->SetUInt64Value(UNIT_FIELD_TARGET, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0); me->SetTarget(pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0);
me->HandleEmoteCommand(29); me->HandleEmoteCommand(29);
DoScriptText(SAY_ESCAPE_SPEECH_2, me); DoScriptText(SAY_ESCAPE_SPEECH_2, me);
++uiOutroStep; ++uiOutroStep;
@@ -488,9 +488,9 @@ public:
if (Unit* pDisguised2 = me->SummonCreature(NPC_CITY_MAN, 2400.82f, 1201.69f, 134.01f, 1.534082f, TEMPSUMMON_DEAD_DESPAWN, 180000)) if (Unit* pDisguised2 = me->SummonCreature(NPC_CITY_MAN, 2400.82f, 1201.69f, 134.01f, 1.534082f, TEMPSUMMON_DEAD_DESPAWN, 180000))
{ {
uiInfiniteDraconianGUID[2] = pDisguised2->GetGUID(); uiInfiniteDraconianGUID[2] = pDisguised2->GetGUID();
pDisguised0->SetUInt64Value(UNIT_FIELD_TARGET, uiInfiniteDraconianGUID[1]); pDisguised0->SetTarget(uiInfiniteDraconianGUID[1]);
pDisguised1->SetUInt64Value(UNIT_FIELD_TARGET, uiInfiniteDraconianGUID[0]); pDisguised1->SetTarget(uiInfiniteDraconianGUID[0]);
pDisguised2->SetUInt64Value(UNIT_FIELD_TARGET, uiInfiniteDraconianGUID[1]); pDisguised2->SetTarget(uiInfiniteDraconianGUID[1]);
} }
} }
} }
@@ -594,8 +594,8 @@ public:
uiUtherGUID = pUther->GetGUID(); uiUtherGUID = pUther->GetGUID();
pUther->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); pUther->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
pUther->GetMotionMaster()->MovePoint(0, 1897.018f, 1287.487f, 143.481f); pUther->GetMotionMaster()->MovePoint(0, 1897.018f, 1287.487f, 143.481f);
pUther->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); pUther->SetTarget(me->GetGUID());
me->SetUInt64Value(UNIT_FIELD_TARGET, uiUtherGUID); me->SetTarget(uiUtherGUID);
} }
JumpToNextStep(17000); JumpToNextStep(17000);
break; break;
@@ -620,7 +620,7 @@ public:
//After waypoint 1 //After waypoint 1
case 5: case 5:
if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID)) if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID))
pJaina->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); pJaina->SetTarget(me->GetGUID());
DoScriptText(SAY_PHASE104, me); DoScriptText(SAY_PHASE104, me);
JumpToNextStep(10000); JumpToNextStep(10000);
break; break;
@@ -685,7 +685,7 @@ public:
case 18: case 18:
if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID)) if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID))
{ {
me->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID); me->SetTarget(uiJainaGUID);
pJaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pJaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
pJaina->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f); pJaina->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f);
} }
@@ -703,13 +703,13 @@ public:
case 21: case 21:
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
JumpToNextStep(0); JumpToNextStep(0);
break; break;
//After waypoint 3 //After waypoint 3
case 22: case 22:
DoScriptText(SAY_PHASE118, me); DoScriptText(SAY_PHASE118, me);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID); me->SetTarget(uiJainaGUID);
JumpToNextStep(10000); JumpToNextStep(10000);
break; break;
case 23: case 23:
@@ -723,7 +723,7 @@ public:
if (Creature* pUther = Unit::GetCreature(*me, uiUtherGUID)) if (Creature* pUther = Unit::GetCreature(*me, uiUtherGUID))
pUther->DisappearAndDie(); pUther->DisappearAndDie();
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
JumpToNextStep(0); JumpToNextStep(0);
break; break;
//After Gossip 1 (waypoint 8) //After Gossip 1 (waypoint 8)
@@ -731,7 +731,7 @@ public:
if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET, 2026.469f, 1287.088f, 143.596f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 14000)) if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET, 2026.469f, 1287.088f, 143.596f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 14000))
{ {
uiStalkerGUID = pStalker->GetGUID(); uiStalkerGUID = pStalker->GetGUID();
me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID); me->SetTarget(uiStalkerGUID);
} }
JumpToNextStep(1000); JumpToNextStep(1000);
break; break;
@@ -743,15 +743,15 @@ public:
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
SetRun(false); SetRun(false);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
JumpToNextStep(0); JumpToNextStep(0);
break; break;
//After waypoint 9 //After waypoint 9
case 27: case 27:
me->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[0]); me->SetTarget(uiCitymenGUID[0]);
if (Creature* pCityman = Unit::GetCreature(*me, uiCitymenGUID[0])) if (Creature* pCityman = Unit::GetCreature(*me, uiCitymenGUID[0]))
{ {
pCityman->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); pCityman->SetTarget(me->GetGUID());
pCityman->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); pCityman->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
pCityman->GetMotionMaster()->MovePoint(0, 2088.625f, 1279.191f, 140.743f); pCityman->GetMotionMaster()->MovePoint(0, 2088.625f, 1279.191f, 140.743f);
} }
@@ -779,10 +779,10 @@ public:
if (Creature* pCityman1 = Unit::GetCreature(*me, uiCitymenGUID[1])) if (Creature* pCityman1 = Unit::GetCreature(*me, uiCitymenGUID[1]))
{ {
DoScriptText(SAY_PHASE204, pCityman1); DoScriptText(SAY_PHASE204, pCityman1);
pCityman1->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); pCityman1->SetTarget(me->GetGUID());
if (Creature* pCityman0 = Unit::GetCreature(*me, uiCitymenGUID[0])) if (Creature* pCityman0 = Unit::GetCreature(*me, uiCitymenGUID[0]))
pCityman0->Kill(pCityman0); pCityman0->Kill(pCityman0);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[1]); me->SetTarget(uiCitymenGUID[1]);
} }
JumpToNextStep(0); JumpToNextStep(0);
break; break;
@@ -800,7 +800,7 @@ public:
if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET, 2081.447f, 1287.770f, 141.3241f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 10000)) if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET, 2081.447f, 1287.770f, 141.3241f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 10000))
{ {
uiStalkerGUID = pStalker->GetGUID(); uiStalkerGUID = pStalker->GetGUID();
me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID); me->SetTarget(uiStalkerGUID);
} }
DoScriptText(SAY_PHASE205, me); DoScriptText(SAY_PHASE205, me);
JumpToNextStep(3000); JumpToNextStep(3000);
@@ -809,7 +809,7 @@ public:
if (Unit* pStalkerM = me->SummonCreature(NPC_INVIS_TARGET, 2117.349f, 1288.624f, 136.271f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 60000)) if (Unit* pStalkerM = me->SummonCreature(NPC_INVIS_TARGET, 2117.349f, 1288.624f, 136.271f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 60000))
{ {
uiStalkerGUID = pStalkerM->GetGUID(); uiStalkerGUID = pStalkerM->GetGUID();
me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID); me->SetTarget(uiStalkerGUID);
} }
JumpToNextStep(1000); JumpToNextStep(1000);
break; break;
@@ -821,7 +821,7 @@ public:
uiMalganisGUID = pMalganis->GetGUID(); uiMalganisGUID = pMalganis->GetGUID();
DoScriptText(SAY_PHASE206, pMalganis); DoScriptText(SAY_PHASE206, pMalganis);
pMalganis->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); pMalganis->SetTarget(me->GetGUID());
pMalganis->SetReactState(REACT_PASSIVE); pMalganis->SetReactState(REACT_PASSIVE);
} }
JumpToNextStep(11000); JumpToNextStep(11000);
@@ -855,7 +855,7 @@ public:
if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET, 2081.447f, 1287.770f, 141.3241f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 10000)) if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET, 2081.447f, 1287.770f, 141.3241f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 10000))
{ {
uiStalkerGUID = pStalker->GetGUID(); uiStalkerGUID = pStalker->GetGUID();
me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID); me->SetTarget(uiStalkerGUID);
} }
DoScriptText(SAY_PHASE209, me); DoScriptText(SAY_PHASE209, me);
@@ -957,11 +957,11 @@ public:
case 61: case 61:
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
if (Creature* pDisguised0 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[0])) if (Creature* pDisguised0 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[0]))
pDisguised0->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); pDisguised0->SetTarget(me->GetGUID());
if (Creature* pDisguised1 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[1])) if (Creature* pDisguised1 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[1]))
pDisguised1->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); pDisguised1->SetTarget(me->GetGUID());
if (Creature* pDisguised2 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[2])) if (Creature* pDisguised2 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[2]))
pDisguised2->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); pDisguised2->SetTarget(me->GetGUID());
JumpToNextStep(1000); JumpToNextStep(1000);
break; break;
case 62: case 62:
@@ -1074,7 +1074,7 @@ public:
SpawnTimeRift(17, &uiEpochGUID); SpawnTimeRift(17, &uiEpochGUID);
if (Creature* pEpoch = Unit::GetCreature(*me, uiEpochGUID)) if (Creature* pEpoch = Unit::GetCreature(*me, uiEpochGUID))
DoScriptText(SAY_PHASE314, pEpoch); DoScriptText(SAY_PHASE314, pEpoch);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiEpochGUID); me->SetTarget(uiEpochGUID);
} }
JumpToNextStep(18000); JumpToNextStep(18000);
break; break;
@@ -1141,7 +1141,7 @@ public:
case 86: case 86:
DoScriptText(SAY_PHASE502, me); DoScriptText(SAY_PHASE502, me);
JumpToNextStep(6000); JumpToNextStep(6000);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID); me->SetTarget(uiMalganisGUID);
break; break;
case 87: case 87:
if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID)) if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID))
@@ -1168,7 +1168,7 @@ public:
//After waypoint 56 //After waypoint 56
case 89: case 89:
SetRun(true); SetRun(true);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID); me->SetTarget(uiMalganisGUID);
DoScriptText(SAY_PHASE503, me); DoScriptText(SAY_PHASE503, me);
JumpToNextStep(7000); JumpToNextStep(7000);
break; break;
@@ -1176,7 +1176,7 @@ public:
if (pInstance) if (pInstance)
{ {
pInstance->SetData(DATA_ARTHAS_EVENT, DONE); //Rewards: Achiev & Chest ;D pInstance->SetData(DATA_ARTHAS_EVENT, DONE); //Rewards: Achiev & Chest ;D
me->SetUInt64Value(UNIT_FIELD_TARGET, pInstance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind me->SetTarget(pInstance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind
} }
DoScriptText(SAY_PHASE504, me); DoScriptText(SAY_PHASE504, me);
bStepping = false; bStepping = false;
@@ -290,7 +290,7 @@ public:
DoCast(target, SPELL_GREEN_BEAM); DoCast(target, SPELL_GREEN_BEAM);
//Correctly update our target //Correctly update our target
me->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); me->SetTarget(target->GetGUID());
} }
//Beam every 3 seconds //Beam every 3 seconds
@@ -325,7 +325,7 @@ public:
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
//Remove any target //Remove any target
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
//Select random target for dark beam to start on //Select random target for dark beam to start on
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
@@ -402,7 +402,7 @@ public:
//Transition phase //Transition phase
case PHASE_CTHUN_TRANSITION: case PHASE_CTHUN_TRANSITION:
//Remove any target //Remove any target
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
me->SetHealth(0); me->SetHealth(0);
me->SetVisible(false); me->SetVisible(false);
break; break;
@@ -442,7 +442,7 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
//Remove Target field //Remove Target field
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
//Death animation/respawning; //Death animation/respawning;
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_TRANSITION); pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_TRANSITION);
@@ -628,7 +628,7 @@ public:
return; return;
} }
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
//No instance //No instance
if (!pInst) if (!pInst)
@@ -706,7 +706,7 @@ public:
//Body Phase //Body Phase
case PHASE_CTHUN_STOMACH: case PHASE_CTHUN_STOMACH:
//Remove Target field //Remove Target field
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
//Weaken //Weaken
if (FleshTentaclesKilled > 1) if (FleshTentaclesKilled > 1)
+4 -4
View File
@@ -544,11 +544,11 @@ public:
DoScriptText(ANACHRONOS_SAY_1, me , Fandral); DoScriptText(ANACHRONOS_SAY_1, me , Fandral);
break; break;
case 1: case 1:
Fandral->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); Fandral->SetTarget(me->GetGUID());
DoScriptText(FANDRAL_SAY_1, Fandral, me); DoScriptText(FANDRAL_SAY_1, Fandral, me);
break; break;
case 2: case 2:
Fandral->SetUInt64Value(UNIT_FIELD_TARGET, 0); Fandral->SetTarget(0);
DoScriptText(MERITHRA_EMOTE_1, Merithra); DoScriptText(MERITHRA_EMOTE_1, Merithra);
break; break;
case 3: case 3:
@@ -558,14 +558,14 @@ public:
DoScriptText(ARYGOS_EMOTE_1, Arygos); DoScriptText(ARYGOS_EMOTE_1, Arygos);
break; break;
case 5: case 5:
Caelestrasz->SetUInt64Value(UNIT_FIELD_TARGET, Fandral->GetGUID()); Caelestrasz->SetTarget(Fandral->GetGUID());
DoScriptText(CAELESTRASZ_SAY_1, Caelestrasz); DoScriptText(CAELESTRASZ_SAY_1, Caelestrasz);
break; break;
case 6: case 6:
DoScriptText(MERITHRA_SAY_2, Merithra); DoScriptText(MERITHRA_SAY_2, Merithra);
break; break;
case 7: case 7:
Caelestrasz->SetUInt64Value(UNIT_FIELD_TARGET, 0); Caelestrasz->SetTarget(0);
Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10);
break; break;
case 8: case 8:
@@ -828,7 +828,7 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
{ {
m_uiTrampleTargetGUID = target->GetGUID(); m_uiTrampleTargetGUID = target->GetGUID();
me->SetUInt64Value(UNIT_FIELD_TARGET, m_uiTrampleTargetGUID); me->SetTarget(m_uiTrampleTargetGUID);
DoScriptText(SAY_TRAMPLE_STARE, me, target); DoScriptText(SAY_TRAMPLE_STARE, me, target);
m_bTrampleCasted = false; m_bTrampleCasted = false;
SetCombatMovement(false); SetCombatMovement(false);
@@ -859,7 +859,7 @@ public:
case 4: case 4:
DoScriptText(SAY_TRAMPLE_START, me); DoScriptText(SAY_TRAMPLE_START, me);
me->GetMotionMaster()->MoveCharge(m_fTrampleTargetX, m_fTrampleTargetY, m_fTrampleTargetZ+2, 42, 1); me->GetMotionMaster()->MoveCharge(m_fTrampleTargetX, m_fTrampleTargetY, m_fTrampleTargetZ+2, 42, 1);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
m_uiStage = 5; m_uiStage = 5;
break; break;
case 5: case 5:
@@ -474,7 +474,7 @@ class npc_fizzlebang_toc : public CreatureScript
break; break;
case 1142: case 1142:
if (Creature* pTemp = Unit::GetCreature(*me, m_pInstance->GetData64(NPC_JARAXXUS))) if (Creature* pTemp = Unit::GetCreature(*me, m_pInstance->GetData64(NPC_JARAXXUS)))
pTemp->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); pTemp->SetTarget(me->GetGUID());
if (Creature* pTrigger = Unit::GetCreature(*me, m_uiTriggerGUID)) if (Creature* pTrigger = Unit::GetCreature(*me, m_uiTriggerGUID))
pTrigger->DespawnOrUnsummon(); pTrigger->DespawnOrUnsummon();
if (Creature* pPortal = Unit::GetCreature(*me, m_uiPortalGUID)) if (Creature* pPortal = Unit::GetCreature(*me, m_uiPortalGUID))
@@ -315,7 +315,7 @@ class boss_devourer_of_souls : public CreatureScript
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
//Remove any target //Remove any target
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
@@ -754,7 +754,7 @@ public:
Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
//Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID()); me->SetTarget(Trigger->GetGUID());
DoCast(Trigger, SPELL_EYE_BLAST); DoCast(Trigger, SPELL_EYE_BLAST);
} }
void SummonFlamesOfAzzinoth() void SummonFlamesOfAzzinoth()
@@ -1235,7 +1235,7 @@ public:
me->InterruptNonMeleeSpells(false); me->InterruptNonMeleeSpells(false);
me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->Clear(false);
me->AttackStop(); me->AttackStop();
me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); me->SetTarget(IllidanGUID);
MaxTimer = 0; MaxTimer = 0;
break; break;
case PHASE_TRANSFORM_SEQUENCE: case PHASE_TRANSFORM_SEQUENCE:
@@ -356,7 +356,7 @@ public:
CAST_AI(mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID(); CAST_AI(mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID();
Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); Sorcerer->SetTarget(me->GetGUID());
Sorcerers.push_back(Sorcerer->GetGUID()); Sorcerers.push_back(Sorcerer->GetGUID());
--DeathCount; --DeathCount;
++SorcererCount; ++SorcererCount;
@@ -661,7 +661,7 @@ public:
Shade->AddThreat(me, 1000000.0f); Shade->AddThreat(me, 1000000.0f);
me->CombatStart(Shade); me->CombatStart(Shade);
Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
Shade->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); Shade->SetTarget(me->GetGUID());
if (pl) Shade->AddThreat(pl, 1.0f); if (pl) Shade->AddThreat(pl, 1.0f);
DoZoneInCombat(Shade); DoZoneInCombat(Shade);
EventBegun = true; EventBegun = true;
@@ -680,7 +680,7 @@ public:
case 1: case 1:
if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID)) if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID))
{ {
me->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID); me->SetTarget(ShadeGUID);
DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE);
EndingTalkCount = 0; EndingTalkCount = 0;
SoulRetrieveTimer = 16000; SoulRetrieveTimer = 16000;
@@ -182,7 +182,7 @@ class boss_alar : public CreatureScript
me->RemoveAllAuras(); me->RemoveAllAuras();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->AttackStop(); me->AttackStop();
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
me->SetSpeed(MOVE_RUN, 5.0f); me->SetSpeed(MOVE_RUN, 5.0f);
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]); me->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]);
@@ -236,7 +236,7 @@ struct advisorbase_ai : public ScriptedAI
me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->ClearAllReactives(); me->ClearAllReactives();
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->SetStandState(UNIT_STAND_STATE_DEAD); me->SetStandState(UNIT_STAND_STATE_DEAD);
@@ -782,8 +782,8 @@ public:
Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break; Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break;
case 6: case 6:
Illi->CastSpell(Illi, SPELL_ONE, true); Illi->CastSpell(Illi, SPELL_ONE, true);
Illi->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); Illi->SetTarget(me->GetGUID());
me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); me->SetTarget(IllidanGUID);
return 2000; break; return 2000; break;
case 7: DoScriptText(OVERLORD_YELL_2, me); return 4500; break; case 7: DoScriptText(OVERLORD_YELL_2, me); return 4500; break;
case 8: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break; case 8: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break;
@@ -792,7 +792,7 @@ public:
case 11: DoScriptText(OVERLORD_SAY_4, me, player); return 6000; break; case 11: DoScriptText(OVERLORD_SAY_4, me, player); return 6000; break;
case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break; case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break;
case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break; case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break;
case 14: Illi->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 1500; break; case 14: Illi->SetTarget(PlayerGUID); return 1500; break;
case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break; case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break;
case 16: case 16:
if (player) if (player)
@@ -818,7 +818,7 @@ public:
Illi->setDeathState(JUST_DIED); Illi->setDeathState(JUST_DIED);
return 1000; break; return 1000; break;
case 23: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); return 2000; break; case 23: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); return 2000; break;
case 24: me->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 5000; break; case 24: me->SetTarget(PlayerGUID); return 5000; break;
case 25: DoScriptText(OVERLORD_SAY_6, me); return 2000; break; case 25: DoScriptText(OVERLORD_SAY_6, me); return 2000; break;
case 26: case 26:
if (player) if (player)
@@ -828,7 +828,7 @@ public:
{ {
Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
if (Yarzill) if (Yarzill)
Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); Yarzill->SetTarget(PlayerGUID);
return 500; } return 500; }
break; break;
case 28: case 28:
@@ -848,7 +848,7 @@ public:
{ {
Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
if (Yarzill) if (Yarzill)
Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); Yarzill->SetTarget(0);
return 5000; } return 5000; }
break; break;
case 31: case 31:
@@ -1193,7 +1193,7 @@ public:
me->AddUnitState(UNIT_STAT_ROOT); me->AddUnitState(UNIT_STAT_ROOT);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0); me->SetTarget(0);
} }
void EnterCombat(Unit* /*who*/){} void EnterCombat(Unit* /*who*/){}
@@ -1226,7 +1226,7 @@ public:
case 5: case 5:
if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID))) if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID)))
{ {
me->SetUInt64Value(UNIT_FIELD_TARGET, AggroTarget->GetGUID()); me->SetTarget(AggroTarget->GetGUID());
me->AddThreat(AggroTarget, 1); me->AddThreat(AggroTarget, 1);
me->HandleEmoteCommand(EMOTE_ONESHOT_POINT); me->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
} }