REPO: Code-style change
* Fixed pUnit-unit
This commit is contained in:
@@ -193,11 +193,11 @@ public:
|
||||
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
|
||||
for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
|
||||
{
|
||||
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (pUnit && pUnit->isAlive())
|
||||
Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (unit && unit->isAlive())
|
||||
{
|
||||
float threat = me->getThreatManager().getThreat(pUnit);
|
||||
SummonedUnit->AddThreat(pUnit, threat);
|
||||
float threat = me->getThreatManager().getThreat(unit);
|
||||
SummonedUnit->AddThreat(unit, threat);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -211,9 +211,9 @@ public:
|
||||
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
{
|
||||
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
|
||||
pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true);
|
||||
Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
unit->CastSpell(unit, SPELL_TELEPORT_CENTER, true);
|
||||
}
|
||||
DoCast(me, SPELL_TELEPORT_CENTER, true);
|
||||
}
|
||||
@@ -223,10 +223,10 @@ public:
|
||||
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
{
|
||||
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
|
||||
Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
// Knockback into the air
|
||||
pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID());
|
||||
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,17 +235,17 @@ public:
|
||||
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
{
|
||||
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
|
||||
Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
{
|
||||
// Also needs an exception in spell system.
|
||||
pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID());
|
||||
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID());
|
||||
// Use packet hack
|
||||
WorldPacket data(12);
|
||||
data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
|
||||
data.append(pUnit->GetPackGUID());
|
||||
data.append(unit->GetPackGUID());
|
||||
data << uint32(0);
|
||||
pUnit->SendMessageToSet(&data, true);
|
||||
unit->SendMessageToSet(&data, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,17 +255,17 @@ public:
|
||||
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
{
|
||||
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
|
||||
Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
{
|
||||
pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
|
||||
pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
|
||||
unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
|
||||
unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
|
||||
|
||||
WorldPacket data(12);
|
||||
data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
|
||||
data.append(pUnit->GetPackGUID());
|
||||
data.append(unit->GetPackGUID());
|
||||
data << uint32(0);
|
||||
pUnit->SendMessageToSet(&data, true);
|
||||
unit->SendMessageToSet(&data, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,12 +527,12 @@ public:
|
||||
{
|
||||
DoCast(me, SPELL_VANISH);
|
||||
|
||||
Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
DoResetThreat();
|
||||
|
||||
if (pUnit)
|
||||
me->AddThreat(pUnit, 1000.0f);
|
||||
if (unit)
|
||||
me->AddThreat(unit, 1000.0f);
|
||||
|
||||
InVanish = true;
|
||||
Vanish_Timer = 30000;
|
||||
@@ -644,24 +644,24 @@ public:
|
||||
|
||||
if (Seed_of_Corruption_Timer <= diff)
|
||||
{
|
||||
if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_SEED_OF_CORRUPTION);
|
||||
if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(unit, SPELL_SEED_OF_CORRUPTION);
|
||||
|
||||
Seed_of_Corruption_Timer = 10000;
|
||||
} else Seed_of_Corruption_Timer -= diff;
|
||||
|
||||
if (Curse_of_Agony_Timer <= diff)
|
||||
{
|
||||
if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_CURSE_OF_AGONY);
|
||||
if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(unit, SPELL_CURSE_OF_AGONY);
|
||||
|
||||
Curse_of_Agony_Timer = 13000;
|
||||
} else Curse_of_Agony_Timer -= diff;
|
||||
|
||||
if (Fear_Timer <= diff)
|
||||
{
|
||||
if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_FEAR);
|
||||
if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(unit, SPELL_FEAR);
|
||||
|
||||
Fear_Timer = 10000;
|
||||
} else Fear_Timer -= diff;
|
||||
@@ -806,8 +806,8 @@ public:
|
||||
|
||||
if (Blizzard_Timer <= diff)
|
||||
{
|
||||
if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_BLIZZARD);
|
||||
if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(unit, SPELL_BLIZZARD);
|
||||
|
||||
Blizzard_Timer = 8000;
|
||||
} else Blizzard_Timer -= diff;
|
||||
@@ -937,8 +937,8 @@ public:
|
||||
//if nobody is in melee range than try to use Intercept
|
||||
if (!InMeleeRange)
|
||||
{
|
||||
if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_INTERCEPT_STUN);
|
||||
if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(unit, SPELL_INTERCEPT_STUN);
|
||||
}
|
||||
|
||||
Intercept_Stun_Timer = 10000;
|
||||
@@ -1168,8 +1168,8 @@ public:
|
||||
|
||||
if (Purge_Timer <= diff)
|
||||
{
|
||||
if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_PURGE);
|
||||
if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(unit, SPELL_PURGE);
|
||||
|
||||
Purge_Timer = 15000;
|
||||
} else Purge_Timer -= diff;
|
||||
|
||||
@@ -103,15 +103,15 @@ public:
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
{
|
||||
//Unit* pUnit = Unit::GetUnit(*me, FelCrystals[i]);
|
||||
Unit* pUnit = Unit::GetUnit(*me, *itr);
|
||||
if (pUnit)
|
||||
//Unit* unit = Unit::GetUnit(*me, FelCrystals[i]);
|
||||
Unit* unit = Unit::GetUnit(*me, *itr);
|
||||
if (unit)
|
||||
{
|
||||
if (!pUnit->isAlive())
|
||||
CAST_CRE(pUnit)->Respawn(); // Let the core handle setting death state, etc.
|
||||
if (!unit->isAlive())
|
||||
CAST_CRE(unit)->Respawn(); // Let the core handle setting death state, etc.
|
||||
|
||||
// Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
|
||||
pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
unit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user