diff options
| author | Shocker <shocker@freakz.ro> | 2012-03-28 18:00:42 -0700 |
|---|---|---|
| committer | Shocker <shocker@freakz.ro> | 2012-03-28 18:00:42 -0700 |
| commit | a08cb234c022a6f05cdcc4d4233bea3ee6a63842 (patch) | |
| tree | 08d0cc81eef8af70abb838afefb5e3904cf0adb5 /src/server/scripts/EasternKingdoms | |
| parent | 72d3e856dedaffcddffa6cd36cf56ec5a5809d58 (diff) | |
| parent | 1544b208da2c2c8522e711db38a598f08105fe51 (diff) | |
Merge pull request #5918 from GyxTom/master
Core/Misc: Various cleanups
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
12 files changed, 107 insertions, 84 deletions
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 4e04284354e..9d863544c24 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -203,16 +203,16 @@ public: pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); float angle = me->GetAngle(pAttumen); float distance = me->GetDistance2d(pAttumen); - float newX = me->GetPositionX() + cos(angle)*(distance/2) ; - float newY = me->GetPositionY() + sin(angle)*(distance/2) ; + float newX = me->GetPositionX() + cos(angle)*(distance/2); + float newY = me->GetPositionY() + sin(angle)*(distance/2); float newZ = 50; //me->Relocate(newX, newY, newZ, angle); //me->SendMonsterMove(newX, newY, newZ, 0, true, 1000); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(0, newX, newY, newZ); distance += 10; - newX = me->GetPositionX() + cos(angle)*(distance/2) ; - newY = me->GetPositionY() + sin(angle)*(distance/2) ; + newX = me->GetPositionX() + cos(angle)*(distance/2); + newY = me->GetPositionY() + sin(angle)*(distance/2); pAttumen->GetMotionMaster()->Clear(); pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ); //pAttumen->Relocate(newX, newY, newZ, -angle); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 447703aa5a7..65fb6759722 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -201,7 +201,7 @@ public: void DeSpawnAdds() { - for (uint8 i = 0; i < 4 ; ++i) + for (uint8 i = 0; i < 4; ++i) { Creature* Temp = NULL; if (AddGUID[i]) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index bd5cec9e3cb..bf208baf873 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -277,9 +277,7 @@ public: void JustSummoned(Creature* summoned) { if (Player* player = GetPlayerForEscort()) - { summoned->AI()->AttackStart(player); - } if (summoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) m_uiValrothGUID = summoned->GetGUID(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 8918bca637e..6f71b100bb7 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1011,8 +1011,7 @@ public: if (fLichPositionX && fLichPositionY) { - Unit* temp; - temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index fa0627df5f3..269c6fa0923 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -301,7 +301,7 @@ class boss_hexlord_malacrass : public CreatureScript me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_YELL_DEATH); - for (uint8 i = 0; i < 4 ; ++i) + for (uint8 i = 0; i < 4; ++i) { Unit* Temp = Unit::GetUnit((*me), AddGUID[i]); if (Temp && Temp->isAlive()) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index f9fdd3a9587..06448032dff 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -198,7 +198,7 @@ class boss_venoxis : public CreatureScript case EVENT_HOLY_NOVA: _inMeleeRange = 0; - for (uint8 i = 0; i < 10 ; ++i) + for (uint8 i = 0; i < 10; ++i) { if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, i)) // check if target is within melee-distance diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index 6e8a354ef58..b53770badab 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -99,8 +99,7 @@ class npc_professor_phizzlethorpe : public CreatureScript case 20: Talk(EMOTE_PROGRESS_8); Talk(SAY_PROGRESS_9, player->GetGUID()); - if (player) - CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); break; } } diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 841e577e333..8859dff1c77 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -139,52 +139,61 @@ public: switch (i) { - case 0: - { - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) - Cage->SetGoState(GO_STATE_ACTIVE); - DoScriptText(SAY_START, me, player); - break; - } - case 5: - DoScriptText(SAY_PROGRESS1, me, player); - case 11: - DoScriptText(SAY_PROGRESS2, me, player); - me->SetOrientation(4.762841f); - break; - case 18: - { - DoScriptText(SAY_PROGRESS3, me, player); - Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); - Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Summ1 && Summ2) - { - Summ1->Attack(me, true); - Summ2->Attack(player, true); - } - me->AI()->AttackStart(Summ1); - break; - } - case 19: me->SetWalk(false); - break; - case 25: me->SetWalk(true); - break; - case 30: - if (player && player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); - break; - case 32: - me->SetOrientation(2.978281f); - DoScriptText(SAY_END1, me, player); - break; - case 33: - me->SetOrientation(5.858011f); - DoScriptText(SAY_END2, me, player); - Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); - if (CaptainHelios) - DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); - break; + case 0: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) + Cage->SetGoState(GO_STATE_ACTIVE); + DoScriptText(SAY_START, me, player); + break; + + case 5: + DoScriptText(SAY_PROGRESS1, me, player); + break; + + case 11: + DoScriptText(SAY_PROGRESS2, me, player); + me->SetOrientation(4.762841f); + break; + + case 18: + { + DoScriptText(SAY_PROGRESS3, me, player); + Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); + Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); + if (Summ1 && Summ2) + { + Summ1->Attack(me, true); + Summ2->Attack(player, true); + } + me->AI()->AttackStart(Summ1); + } + break; + + case 19: + me->SetWalk(false); + break; + + case 25: + me->SetWalk(true); + break; + + case 30: + if (player->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); + break; + + case 32: + me->SetOrientation(2.978281f); + DoScriptText(SAY_END1, me, player); + break; + + case 33: + me->SetOrientation(5.858011f); + DoScriptText(SAY_END2, me, player); + Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); + if (CaptainHelios) + DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); + break; } } diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index 08abdc26725..f217cb2a0dd 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -314,7 +314,7 @@ public: { m_uiPostEventTimer = 3000; - if (Unit* player = GetPlayerForEscort()) + if (Player* player = GetPlayerForEscort()) { switch (m_uiPostEventCount) { diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index ad76f29a634..88df13ffc26 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -75,25 +75,44 @@ public: switch (i) { - case 1: DoScriptText(SAY_START, me, player);break; - case 13: - DoScriptText(SAY_LAST, me, player); - player->GroupEventHappens(QUEST_ESCORTING, me); break; - case 14: DoScriptText(SAY_THANKS, me, player); break; - case 15: { - Unit* Rane = me->FindNearestCreature(NPC_RANE, 20); - if (Rane) + case 1: + DoScriptText(SAY_START, me, player); + break; + + case 13: + DoScriptText(SAY_LAST, me, player); + player->GroupEventHappens(QUEST_ESCORTING, me); + break; + + case 14: + DoScriptText(SAY_THANKS, me, player); + break; + + case 15: + if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20)) DoScriptText(SAY_RANE, Rane); - break;} - case 16: DoScriptText(SAY_ANSWER, me); break; - case 17: DoScriptText(SAY_MOVE_QUINN, me); break; - case 24: DoScriptText(SAY_GREETINGS, me); break; - case 25: { - Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20); - if (Quinn) + break; + + case 16: + DoScriptText(SAY_ANSWER, me); + break; + + case 17: + DoScriptText(SAY_MOVE_QUINN, me); + break; + + case 24: + DoScriptText(SAY_GREETINGS, me); + break; + + case 25: + if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20)) DoScriptText(SAY_QUINN, Quinn); - break;} - case 26: DoScriptText(SAY_ON_BYE, me, NULL); break; + break; + + case 26: + DoScriptText(SAY_ON_BYE, me, NULL); + break; } } diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index f36f5b5950e..94b5b070992 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -85,6 +85,7 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); @@ -95,7 +96,8 @@ public: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); player->SEND_GOSSIP_MENU(3985, creature->GetGUID()); - }else + } + else player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; @@ -378,8 +380,7 @@ public: void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_TOMB_LIGHTBRINGER); } diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index 2285d3877e4..c8d2afc3375 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -243,13 +243,11 @@ public: break; case 44: DoScriptText(SAY_END, me, player); - { - if (player) - player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); - } + player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); break; } } + void EnterCombat(Unit* who) { DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2), me, who); |
