diff options
author | _manuel_ <manue.l@live.com.ar> | 2010-10-21 23:24:12 -0300 |
---|---|---|
committer | _manuel_ <manue.l@live.com.ar> | 2010-10-21 23:24:12 -0300 |
commit | 4ab3b63646004bf6386c0a0c6bb7a956b6f94ef3 (patch) | |
tree | 3932124701348c36b22b6605bdb5ada1da21a5e6 | |
parent | a1319a20200d44a6893287e7a0b4bf05b0f9a0ef (diff) |
Core/Scripts: Applied some Coding Standards.
--HG--
branch : trunk
3 files changed, 73 insertions, 64 deletions
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index e77c31ecaf8..3621ad1567b 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -63,59 +63,60 @@ class boss_archaedas : public CreatureScript struct boss_archaedasAI : public ScriptedAI { - boss_archaedasAI(Creature *c) : ScriptedAI(c) + boss_archaedasAI(Creature* pCreature) : ScriptedAI(pCreature) { pInstance = me->GetInstanceScript(); } uint32 uiTremorTimer; int32 iAwakenTimer; - uint32 WallMinionTimer; + uint32 uiWallMinionTimer; bool bWakingUp; - bool guardiansAwake; - bool vaultWalkersAwake; + bool bGuardiansAwake; + bool bVaultWalkersAwake; InstanceScript* pInstance; void Reset() { uiTremorTimer = 60000; iAwakenTimer = 0; - WallMinionTimer = 10000; + uiWallMinionTimer = 10000; bWakingUp = false; - guardiansAwake = false; - vaultWalkersAwake = false; + bGuardiansAwake = false; + bVaultWalkersAwake = false; if (pInstance) - pInstance->SetData (NULL, 5); // respawn any dead minions + pInstance->SetData(NULL, 5); // respawn any dead minions me->setFaction(35); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); } - void ActivateMinion (uint64 guid, bool flag) + void ActivateMinion(uint64 uiGuid, bool bFlag) { - Unit *minion = Unit::GetUnit(*me, guid); + Unit* pMinion = Unit::GetUnit(*me, uiGuid); - if (minion && minion->isAlive()) + if (pMinion && pMinion->isAlive()) { - DoCast (minion, SPELL_AWAKEN_VAULT_WALKER, flag); - minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN,true); + DoCast(pMinion, SPELL_AWAKEN_VAULT_WALKER, bFlag); + pMinion->CastSpell(pMinion, SPELL_ARCHAEDAS_AWAKEN,true); } } void EnterCombat(Unit * /*who*/) { - me->setFaction (14); - me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + me->setFaction(14); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); } - void SpellHit (Unit* /*caster*/, const SpellEntry *spell) + void SpellHit(Unit* /*caster*/, const SpellEntry *spell) { // Being woken up from the altar, start the awaken sequence - if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) { + if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) + { me->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); DoPlaySoundToSet(me,SOUND_AGGRO); iAwakenTimer = 4000; @@ -129,15 +130,17 @@ class boss_archaedas : public CreatureScript DoPlaySoundToSet(me, SOUND_KILL); } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!pInstance) return; // we're still doing awaken animation - if (bWakingUp && iAwakenTimer >= 0) { - iAwakenTimer -= diff; + if (bWakingUp && iAwakenTimer >= 0) + { + iAwakenTimer -= uiDiff; return; // dont do anything until we are done - } else if (bWakingUp && iAwakenTimer <= 0) { + } else if (bWakingUp && iAwakenTimer <= 0) + { bWakingUp = false; AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); return; // dont want to continue until we finish the AttackStart method @@ -148,14 +151,16 @@ class boss_archaedas : public CreatureScript return; // wake a wall minion - if (WallMinionTimer <= diff) { + if (uiWallMinionTimer <= uiDiff) + { pInstance->SetData (DATA_MINIONS, IN_PROGRESS); - WallMinionTimer = 10000; - } else WallMinionTimer -= diff; + uiWallMinionTimer = 10000; + } else uiWallMinionTimer -= uiDiff; //If we are <66 summon the guardians - if (!guardiansAwake && !HealthAbovePct(66)) { + if (!bGuardiansAwake && !HealthAbovePct(66)) + { ActivateMinion(pInstance->GetData64(5),true); // EarthenGuardian1 ActivateMinion(pInstance->GetData64(6),true); // EarthenGuardian2 ActivateMinion(pInstance->GetData64(7),true); // EarthenGuardian3 @@ -164,33 +169,35 @@ class boss_archaedas : public CreatureScript ActivateMinion(pInstance->GetData64(10),false); // EarthenGuardian6 me->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL); DoPlaySoundToSet(me, SOUND_SUMMON); - guardiansAwake = true; + bGuardiansAwake = true; } //If we are <33 summon the vault walkers - if (!vaultWalkersAwake && !HealthAbovePct(33)) { + if (!bVaultWalkersAwake && !HealthAbovePct(33)) + { ActivateMinion(pInstance->GetData64(1),true); // VaultWalker1 ActivateMinion(pInstance->GetData64(2),true); // VaultWalker2 ActivateMinion(pInstance->GetData64(3),true); // VaultWalker3 ActivateMinion(pInstance->GetData64(4),false); // VaultWalker4 me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL); DoPlaySoundToSet(me, SOUND_SUMMON2); - vaultWalkersAwake = true; + bVaultWalkersAwake = true; } - if (uiTremorTimer <= diff) + if (uiTremorTimer <= uiDiff) { //Cast DoCast(me->getVictim(), SPELL_GROUND_TREMOR); //45 seconds until we should cast this agian uiTremorTimer = 45000; - } else uiTremorTimer -= diff; + } else uiTremorTimer -= uiDiff; DoMeleeAttackIfReady(); } - void JustDied (Unit * /*pKiller*/) { + void JustDied (Unit * /*pKiller*/) + { if (pInstance) { pInstance->SetData(DATA_ANCIENT_DOOR, DONE); // open the vault door @@ -262,7 +269,8 @@ class mob_archaedas_minions : public CreatureScript void SpellHit (Unit* /*caster*/, const SpellEntry *spell) { // time to wake up, start animation - if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)){ + if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) + { iAwakenTimer = 5000; bWakingUp = true; } @@ -274,13 +282,15 @@ class mob_archaedas_minions : public CreatureScript ScriptedAI::MoveInLineOfSight(who); } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { // we're still in the awaken animation - if (bWakingUp && iAwakenTimer >= 0) { - iAwakenTimer -= diff; + if (bWakingUp && iAwakenTimer >= 0) + { + iAwakenTimer -= uiDiff; return; // dont do anything until we are done - } else if (bWakingUp && iAwakenTimer <= 0) { + } else if (bWakingUp && iAwakenTimer <= 0) + { bWakingUp = false; bAmIAwake = true; // AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); // whoWokeArchaedasGUID @@ -321,9 +331,9 @@ class mob_stonekeepers : public CreatureScript struct mob_stonekeepersAI : public ScriptedAI { - mob_stonekeepersAI(Creature *c) : ScriptedAI(c) + mob_stonekeepersAI(Creature* pCreature) : ScriptedAI(pCreature) { - pInstance = (me->GetInstanceScript()); + pInstance = me->GetInstanceScript(); } InstanceScript* pInstance; @@ -338,9 +348,9 @@ class mob_stonekeepers : public CreatureScript void EnterCombat(Unit * /*who*/) { - me->setFaction (14); - me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + me->setFaction(14); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); } void UpdateAI(const uint32 /*diff*/) diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp index 161d043d35a..9f3e7d4990e 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp @@ -42,7 +42,7 @@ class boss_ironaya : public CreatureScript struct boss_ironayaAI : public ScriptedAI { - boss_ironayaAI(Creature *c) : ScriptedAI(c) {} + boss_ironayaAI(Creature* pCreature) : ScriptedAI(pCreature) {} uint32 uiArcingTimer; bool bHasCastedWstomp; @@ -60,7 +60,7 @@ class boss_ironaya : public CreatureScript DoScriptText(SAY_AGGRO, me); } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { //Return since we have no target if (!UpdateVictim()) @@ -72,24 +72,24 @@ class boss_ironaya : public CreatureScript DoCast(me->getVictim(), SPELL_KNOCKAWAY, true); // current aggro target is knocked away pick new target - Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - if (!Target || Target == me->getVictim()) - Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + if (!pTarget || pTarget == me->getVictim()) + pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - if (Target) - me->TauntApply(Target); + if (pTarget) + me->TauntApply(pTarget); //Shouldn't cast this agian bHasCastedKnockaway = true; } //uiArcingTimer - if (uiArcingTimer <= diff) + if (uiArcingTimer <= uiDiff) { DoCast(me, SPELL_ARCINGSMASH); uiArcingTimer = 13000; - } else uiArcingTimer -= diff; + } else uiArcingTimer -= uiDiff; if (!bHasCastedWstomp && HealthBelowPct(25)) { diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp index ec4355e7140..aa9f4568ffd 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp @@ -53,7 +53,7 @@ class mob_jadespine_basilisk : public CreatureScript struct mob_jadespine_basiliskAI : public ScriptedAI { - mob_jadespine_basiliskAI(Creature *c) : ScriptedAI(c) {} + mob_jadespine_basiliskAI(Creature* pCreature) : ScriptedAI(pCreature) {} uint32 uiCslumberTimer; @@ -66,14 +66,14 @@ class mob_jadespine_basilisk : public CreatureScript { } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { //Return since we have no target if (!UpdateVictim()) return; //uiCslumberTimer - if (uiCslumberTimer <= diff) + if (uiCslumberTimer <= uiDiff) { //Cast DoCastVictim(SPELL_CRYSTALLINE_SLUMBER, true); @@ -81,15 +81,15 @@ class mob_jadespine_basilisk : public CreatureScript //Stop attacking target thast asleep and pick new target uiCslumberTimer = 28000; - Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - if (!Target || Target == me->getVictim()) - Target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!pTarget || pTarget == me->getVictim()) + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (Target) - me->TauntApply(Target); + if (pTarget) + me->TauntApply(pTarget); - } else uiCslumberTimer -= diff; + } else uiCslumberTimer -= uiDiff; DoMeleeAttackIfReady(); } @@ -112,11 +112,10 @@ class go_keystone_chamber : public GameObjectScript public: go_keystone_chamber() : GameObjectScript("go_keystone_chamber") { } - bool OnGossipHello(Player *pPlayer, GameObject * pGo) + bool OnGossipHello(Player* /*pPlayer*/, GameObject* pGo) { if (InstanceScript* pInstance = pGo->GetInstanceScript()) - if (pInstance) - pInstance->SetData(DATA_IRONAYA_SEAL, IN_PROGRESS); //door animation and save state. + pInstance->SetData(DATA_IRONAYA_SEAL, IN_PROGRESS); //door animation and save state. return false; } @@ -139,7 +138,7 @@ class AreaTrigger_at_map_chamber : public AreaTriggerScript bool OnTrigger(Player* pPlayer, AreaTriggerEntry const* /*trigger*/) { - if (pPlayer && ((Player*)pPlayer)->GetQuestStatus(QUEST_HIDDEN_CHAMBER) == QUEST_STATUS_INCOMPLETE) + if (pPlayer->GetQuestStatus(QUEST_HIDDEN_CHAMBER) == QUEST_STATUS_INCOMPLETE) pPlayer->AreaExploredOrEventHappens(QUEST_HIDDEN_CHAMBER); return true; |