*code cleanup

*totally destroyed m_creature, use "me" for future coding

--HG--
branch : trunk
This commit is contained in:
Rat
2010-04-14 23:07:41 +02:00
parent cc262e1cde
commit 6bcb297de4
403 changed files with 9851 additions and 9852 deletions
+36 -36
View File
@@ -61,9 +61,9 @@ struct npc_prospector_anvilwardAI : public npc_escortAI
switch (i)
{
case 0: DoScriptText(SAY_ANVIL1, m_creature, pPlayer); break;
case 5: DoScriptText(SAY_ANVIL2, m_creature, pPlayer); break;
case 6: m_creature->setFaction(24); break;
case 0: DoScriptText(SAY_ANVIL1, me, pPlayer); break;
case 5: DoScriptText(SAY_ANVIL2, me, pPlayer); break;
case 6: me->setFaction(24); break;
}
}
@@ -191,15 +191,15 @@ struct npc_secondTrialAI : public ScriptedAI
questPhase = 0;
summonerGuid = 0;
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL);
m_creature->setFaction(FACTION_FRIENDLY);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL);
me->setFaction(FACTION_FRIENDLY);
spellFlashLight = false;
spellJustice = false;
spellJudLight = false;
spellCommand = false;
switch(m_creature->GetEntry())
switch(me->GetEntry())
{
case CHAMPION_BLOODWRATH:
spellFlashLight = true;
@@ -231,13 +231,13 @@ struct npc_secondTrialAI : public ScriptedAI
if (questPhase == 1)
if (timer <= diff)
{
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
m_creature->setFaction(FACTION_HOSTILE);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
me->setFaction(FACTION_HOSTILE);
questPhase = 0;
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
m_creature->AddThreat(pTarget, 5000000.0f);
me->AddThreat(pTarget, 5000000.0f);
AttackStart(pTarget);
}
}
@@ -249,10 +249,10 @@ struct npc_secondTrialAI : public ScriptedAI
// healer
if (spellFlashLight)
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 70)
if (me->GetHealth()*100 / me->GetMaxHealth() < 70)
if (timerFlashLight <= diff)
{
DoCast(m_creature, SPELL_FLASH_OF_LIGHT);
DoCast(me, SPELL_FLASH_OF_LIGHT);
timerFlashLight = TIMER_FLASH_OF_LIGHT + rand()%TIMER_FLASH_OF_LIGHT;
}
else
@@ -261,7 +261,7 @@ struct npc_secondTrialAI : public ScriptedAI
if (spellJustice)
if (timerJustice <= diff)
{
DoCast(m_creature, SPELL_SEAL_OF_JUSTICE);
DoCast(me, SPELL_SEAL_OF_JUSTICE);
timerJustice = TIMER_SEAL_OF_JUSTICE + rand()%TIMER_SEAL_OF_JUSTICE;
}
else
@@ -270,7 +270,7 @@ struct npc_secondTrialAI : public ScriptedAI
if (spellJudLight)
if (timerJudLight <= diff)
{
DoCast(m_creature, SPELL_JUDGEMENT_OF_LIGHT);
DoCast(me, SPELL_JUDGEMENT_OF_LIGHT);
timerJudLight = TIMER_JUDGEMENT_OF_LIGHT + rand()%TIMER_JUDGEMENT_OF_LIGHT;
}
else
@@ -279,7 +279,7 @@ struct npc_secondTrialAI : public ScriptedAI
if (spellCommand)
if (timerCommand <= diff)
{
DoCast(m_creature, TIMER_SEAL_OF_COMMAND);
DoCast(me, TIMER_SEAL_OF_COMMAND);
timerCommand = TIMER_SEAL_OF_COMMAND + rand()%TIMER_SEAL_OF_COMMAND;
}
else
@@ -333,23 +333,23 @@ struct master_kelerun_bloodmournAI : public ScriptedAI
{
if (timer <= diff)
{
if (Creature* paladinSpawn = Unit::GetCreature((*m_creature), paladinGuid[paladinPhase]))
if (Creature* paladinSpawn = Unit::GetCreature((*me), paladinGuid[paladinPhase]))
{
CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(m_creature->GetGUID());
CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(me->GetGUID());
switch(paladinPhase)
{
case 0:
DoScriptText(TEXT_SECOND_TRIAL_1,m_creature);
DoScriptText(TEXT_SECOND_TRIAL_1,me);
break;
case 1:
DoScriptText(TEXT_SECOND_TRIAL_2,m_creature);
DoScriptText(TEXT_SECOND_TRIAL_2,me);
break;
case 2:
DoScriptText(TEXT_SECOND_TRIAL_3,m_creature);
DoScriptText(TEXT_SECOND_TRIAL_3,me);
break;
case 3:
DoScriptText(TEXT_SECOND_TRIAL_4,m_creature);
DoScriptText(TEXT_SECOND_TRIAL_4,me);
break;
}
}
@@ -431,11 +431,11 @@ void npc_secondTrialAI::JustDied(Unit* Killer)
{
if (Killer->GetTypeId() == TYPEID_PLAYER)
{
if (Creature *pSummoner = Unit::GetCreature((*m_creature), summonerGuid))
if (Creature *pSummoner = Unit::GetCreature((*me), summonerGuid))
CAST_AI(master_kelerun_bloodmournAI, pSummoner->AI())->SecondTrialKill();
// last kill quest complete for group
if (m_creature->GetEntry() == CHAMPION_SUNSTRIKER)
if (me->GetEntry() == CHAMPION_SUNSTRIKER)
{
if (Group *pGroup = CAST_PLR(Killer)->GetGroup())
{
@@ -444,7 +444,7 @@ void npc_secondTrialAI::JustDied(Unit* Killer)
Player *pGroupGuy = itr->getSource();
// for any leave or dead (with not released body) group member at appropriate distance
if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(m_creature) && !pGroupGuy->GetCorpse() && pGroupGuy->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE)
if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(me) && !pGroupGuy->GetCorpse() && pGroupGuy->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE)
pGroupGuy->CompleteQuest(QUEST_SECOND_TRIAL);
}
}
@@ -500,7 +500,7 @@ bool GOHello_go_second_trial(Player* pPlayer, GameObject* pGO)
struct npc_apprentice_mirvedaAI : public ScriptedAI
{
npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(m_creature) {}
npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(me) {}
uint32 KillCount;
uint64 PlayerGUID;
@@ -519,7 +519,7 @@ struct npc_apprentice_mirvedaAI : public ScriptedAI
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
Summons.Summon(summoned);
}
@@ -544,9 +544,9 @@ struct npc_apprentice_mirvedaAI : public ScriptedAI
if (Summon)
{
m_creature->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
me->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
Summon = false;
}
}
@@ -613,7 +613,7 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit* who)
{
if (!Progress && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
if (!Progress && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f))
{
if (CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE)
{
@@ -627,7 +627,7 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
void JustDied(Unit* killer)
@@ -641,14 +641,14 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
{
if (EndTimer < diff && Progress)
{
DoScriptText(EMOTE, m_creature);
DoScriptText(EMOTE, me);
Completed = true;
if (PlayerGUID)
if (Player* pPlayer = Unit::GetPlayer(PlayerGUID))
CAST_PLR(pPlayer)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES);
m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->RemoveCorpse();
me->DealDamage(me,me->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->RemoveCorpse();
} else EndTimer -= diff;
if (WaveTimer < diff && !Completed && Progress)
@@ -656,9 +656,9 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
uint32 ran1 = rand()%8;
uint32 ran2 = rand()%8;
uint32 ran3 = rand()%8;
m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
WaveTimer = 30000;
} else WaveTimer -= diff;
}