diff options
author | Spp <spp@jorge.gr> | 2013-03-21 13:07:10 +0100 |
---|---|---|
committer | Spp <spp@jorge.gr> | 2013-03-21 13:07:10 +0100 |
commit | 355029fb4f30a3d535a7c360b896b728eee330b6 (patch) | |
tree | 31f653f8ea96aaa2f0152d439bdd7a481c203f87 | |
parent | d0910974336115be1dd06577c63fe3703e8170d2 (diff) |
Core/Scripts: Removed CAST_PLR define
26 files changed, 304 insertions, 291 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 5e612b0cbda..71b6461e94d 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -24,7 +24,6 @@ #include "CreatureAIImpl.h" #include "InstanceScript.h" -#define CAST_PLR(a) (dynamic_cast<Player*>(a)) #define CAST_CRE(a) (dynamic_cast<Creature*>(a)) #define CAST_AI(a, b) (dynamic_cast<a*>(b)) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 0cbeec50f98..d0c0ded2267 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -981,9 +981,9 @@ public: if (HasEscortState(STATE_ESCORT_ESCORTING)) return; - if (who->GetTypeId() == TYPEID_PLAYER) + if (Player* player = who->ToPlayer()) { - if (CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE) { float Radius = 10.0f; if (me->IsWithinDistInMap(who, Radius)) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index d3cb21c75f0..abaf900508c 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -651,19 +651,22 @@ public: { if (Unit* charmer = who->GetCharmer()) { - if (charmer->GetTypeId() == TYPEID_PLAYER) + if (Player* player = charmer->ToPlayer()) { // for quest Into the Realm of Shadows(12687) - if (me->GetEntry() == 28788 && CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) + if (me->GetEntry() == 28788 && player->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) { - CAST_PLR(charmer)->GroupEventHappens(12687, me); + player->GroupEventHappens(12687, me); charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE); - CAST_CRE(who)->DespawnOrUnsummon(); - //CAST_CRE(who)->Respawn(true); + if (Creature* creature = who->ToCreature()) + { + creature->DespawnOrUnsummon(); + //creature->Respawn(true); + } } - if (CAST_PLR(charmer)->HasAura(SPELL_REALM_OF_SHADOWS)) - charmer->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS); + if (player->HasAura(SPELL_REALM_OF_SHADOWS)) + player->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS); } } } @@ -753,17 +756,18 @@ public: { if (Unit* owner = who->GetOwner()) { - if (owner->GetTypeId() == TYPEID_PLAYER) + if (Player* player = owner->ToPlayer()) { - if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) - CAST_CRE(who)->CastSpell(owner, 52517, true); + Creature* creature = who->ToCreature(); + if (player->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) + creature->CastSpell(owner, 52517, true); /// @todo Creatures must not be removed, but, must instead // stand next to Gothik and be commanded into the pit // and dig into the ground. - CAST_CRE(who)->DespawnOrUnsummon(); + creature->DespawnOrUnsummon(); - if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) + if (player->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) owner->RemoveAllMinionsByEntry(NPC_GHOSTS); } } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp index 16e6554d1f4..326c02630ac 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp @@ -76,8 +76,7 @@ public: Player* player = NULL; if (me->isSummon()) if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - if (summoner->GetTypeId() == TYPEID_PLAYER) - player = CAST_PLR(summoner); + player = summoner->ToPlayer(); if (!player) phase = 3; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 7208bbbee03..f12a9c33ea9 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -151,14 +151,15 @@ public: void SpellHit(Unit* caster, const SpellInfo* spell) { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - if (!Tagged && spell->Id == SPELL_EGAN_BLASTER && CAST_PLR(caster)->GetQuestStatus(QUEST_RESTLESS_SOUL) == QUEST_STATUS_INCOMPLETE) - { - Tagged = true; - Tagger = caster->GetGUID(); - } - } + if (Tagged || spell->Id != SPELL_EGAN_BLASTER) + return; + + Player* player = caster->ToPlayer(); + if (!player || player->GetQuestStatus(QUEST_RESTLESS_SOUL) != QUEST_STATUS_INCOMPLETE) + return; + + Tagged = true; + Tagger = caster->GetGUID(); } void JustSummoned(Creature* summoned) @@ -180,10 +181,13 @@ public: { if (Unit* temp = Unit::GetUnit(*me, Tagger)) { - CAST_PLR(temp)->KilledMonsterCredit(ENTRY_RESTLESS, me->GetGUID()); + if (Player* player = temp->ToPlayer()) + player->KilledMonsterCredit(ENTRY_RESTLESS, me->GetGUID()); me->Kill(me); } - } else Die_Timer -= diff; + } + else + Die_Timer -= diff; } } }; diff --git a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp index b6899c534e4..6bc316d1437 100644 --- a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp @@ -141,7 +141,8 @@ public: if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me)) { DoCast(who, 16472); - CAST_PLR(who)->AreaExploredOrEventHappens(4866); + if (Player* player = who->ToPlayer()) + player->AreaExploredOrEventHappens(4866); } } diff --git a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp index ce62de8b368..c148d485e1a 100644 --- a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp @@ -243,11 +243,11 @@ public: summonerGuid = summonerguid; } - void KilledUnit(Unit* Killed) + void KilledUnit(Unit* unit) { - if (Killed->GetTypeId() == TYPEID_PLAYER) - if (CAST_PLR(Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) - CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL); + if (Player* player = unit->ToPlayer()) + if (player->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) + player->FailQuest(QUEST_SECOND_TRIAL); } void JustDied(Unit* killer); @@ -577,7 +577,7 @@ public: { if (!Progress && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f)) { - if (CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE) + if (who->ToPlayer()->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE) { PlayerGUID = who->GetGUID(); WaveTimer = 1000; @@ -596,7 +596,7 @@ public: { if (PlayerGUID && !Completed) if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->FailQuest(QUEST_POWERING_OUR_DEFENSES); + player->FailQuest(QUEST_POWERING_OUR_DEFENSES); } void UpdateAI(uint32 diff) @@ -607,7 +607,7 @@ public: Completed = true; if (PlayerGUID) if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES); + player->CompleteQuest(QUEST_POWERING_OUR_DEFENSES); me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); me->RemoveCorpse(); diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp index 9e00ceb2aa5..858aa287c61 100644 --- a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp @@ -175,8 +175,7 @@ public: me->SetWalk(true); break; case 30: - if (player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); + player->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); break; case 32: me->SetOrientation(2.978281f); diff --git a/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp index fd36a02b8a5..0e7472fc63b 100644 --- a/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp @@ -88,19 +88,22 @@ public: } } - void SpellHit(Unit* Hitter, const SpellInfo* Spellkind) + void SpellHit(Unit* caster, const SpellInfo* Spellkind) { - if ((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit && - (Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD))) - { - CAST_PLR(Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); - DoCast(me, SPELL_REVIVE_SELF); - me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); - //me->RemoveAllAuras(); - Talk(SAY_HEAL); - spellHit = true; - } + if (Spellkind->Id != SPELL_SHIMMERING_VESSEL || spellHit) + return; + + Player* player = caster->ToPlayer(); + if (!player || !player->IsActiveQuest(QUEST_REDEEMING_THE_DEAD)) + return; + + player->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); + DoCast(me, SPELL_REVIVE_SELF); + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + //me->RemoveAllAuras(); + Talk(SAY_HEAL); + spellHit = true; } }; }; diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp index b9c9c8ff15b..d8a2d765983 100644 --- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp @@ -139,8 +139,8 @@ public: //Take 0 damage uiDamage = 0; - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_BEAT); + if (Player* player = pDoneBy->ToPlayer()) + player->AreaExploredOrEventHappens(QUEST_BEAT); EnterEvadeMode(); } } diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp index c11e850cbc8..66fb4819175 100644 --- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp @@ -64,10 +64,12 @@ public: void SpellHit(Unit* caster, const SpellInfo* spell) { - if (caster->GetTypeId() == TYPEID_PLAYER) + if (bReset || spell->Id != 3607) + return; + + if (Player* player = caster->ToPlayer()) { - //Yenniku's Release - if (!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607) + if (player->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE) //Yenniku's Release { me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); me->CombatStop(); //stop combat @@ -78,7 +80,6 @@ public: Reset_Timer = 60000; } } - return; } void EnterCombat(Unit* /*who*/) {} @@ -94,14 +95,14 @@ public: me->setFaction(28); //troll, bloodscalp return; } - else Reset_Timer -= diff; + + Reset_Timer -= diff; if (me->isInCombat() && me->getVictim()) { - if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) + if (Player* player = me->getVictim()->ToPlayer()) { - Unit* victim = me->getVictim(); - if (CAST_PLR(victim)->GetTeam() == HORDE) + if (player->GetTeam() == HORDE) { me->CombatStop(); me->DeleteThreatList(); diff --git a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp index 1831d9f7ff1..0692330b87a 100644 --- a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp @@ -190,46 +190,47 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who || who->GetTypeId() != TYPEID_PLAYER) + if (!who) + return; + + Player* player = who->ToPlayer(); + if (!player) return; - if (who->GetTypeId() == TYPEID_PLAYER) + switch (me->GetAreaId()) { - switch (me->GetAreaId()) - { - case 199: //felstone - if (CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE) - { - me->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - case 200: //dalson - if (CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE) - { - me->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - case 201: //gahrron - if (CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE) - { - me->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - case 202: //writhing - if (CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE) - { - me->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - } + case 199: //felstone + if (player->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || + player->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE) + { + me->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 200: //dalson + if (player->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || + player->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE) + { + me->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 201: //gahrron + if (player->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || + player->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE) + { + me->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 202: //writhing + if (player->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || + player->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE) + { + me->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; } } }; @@ -267,7 +268,8 @@ public: return; if (me->FindNearestGameObject(GO_BEACON_TORCH, 10.0f)) - CAST_PLR(who)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); + if (Player* player = who->ToPlayer()) + player->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); } }; }; diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp index c8a1fc2b2b4..ea7b995e8cf 100644 --- a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp @@ -116,8 +116,7 @@ public: { if (Player* player = GetPlayerForEscort()) { - if (player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, me); + player->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, me); uiDamage = 0; diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index 7cb78718e2a..55e81f1408f 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -119,8 +119,7 @@ public: case 45: Talk(SAY_WIN, player->GetGUID()); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - if (player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me); + player->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me); break; case 46: Talk(SAY_END, player->GetGUID()); @@ -143,7 +142,7 @@ public: void JustDied(Unit* /*killer*/) { if (Player* player = GetPlayerForEscort()) - CAST_PLR(player)->FailQuest(QUEST_WILLIX_THE_IMPORTER); + player->FailQuest(QUEST_WILLIX_THE_IMPORTER); } }; diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index 40af9e522ea..66834a68253 100644 --- a/src/server/scripts/Kalimdor/zone_azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -66,15 +66,26 @@ public: void EnterCombat(Unit* /*who*/) { } - void SpellHit(Unit* Hitter, const SpellInfo* Spellkind) + void SpellHit(Unit* unit, const SpellInfo* spell) { - if (!spellhit && - Hitter->GetTypeId() == TYPEID_PLAYER && - CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && - (Spellkind->Id == 118 || Spellkind->Id == 12824 || Spellkind->Id == 12825 || Spellkind->Id == 12826)) + if (spellhit) + return; + + switch (spell->Id) { - spellhit=true; - DoCast(me, 29124); //become a sheep + case 118: + case 12824: + case 12825: + case 12826: + if (Player* player = unit->ToPlayer()) + if (player->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE) + { + spellhit = true; + DoCast(me, 29124); + } + break; + default: + break; } } @@ -429,7 +440,9 @@ public: if (!who || PlayerGUID) return; - if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) + Player* player = who->ToPlayer(); + + if (player && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) { PlayerGUID = who->GetGUID(); Talk(SAY_RIZZLE_START); diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp index 7bb59e9828b..801ffbc038e 100644 --- a/src/server/scripts/Kalimdor/zone_durotar.cpp +++ b/src/server/scripts/Kalimdor/zone_durotar.cpp @@ -73,10 +73,13 @@ public: void SpellHit(Unit* caster, const SpellInfo* spell) { - if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER - && CAST_PLR(caster)->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE) + if (spell->Id != SPELL_AWAKEN_PEON) + return; + + Player* player = caster->ToPlayer(); + if (player && player->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE) { - caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); + player->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); Talk(SAY_SPELL_HIT, caster->GetGUID()); me->RemoveAllAuras(); if (GameObject* Lumberpile = me->FindNearestGameObject(GO_LUMBERPILE, 20)) diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 9d257790ab8..a0e57a1092f 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -87,15 +87,17 @@ public: void SendItem(Unit* receiver) { - if (CAST_PLR(receiver)->HasItemCount(11169, 1, false) && - CAST_PLR(receiver)->HasItemCount(11172, 11, false) && - CAST_PLR(receiver)->HasItemCount(11173, 1, false) && - !CAST_PLR(receiver)->HasItemCount(11522, 1, true)) + Player* player = receiver->ToPlayer(); + + if (player && player->HasItemCount(11169, 1, false) && + player->HasItemCount(11172, 11, false) && + player->HasItemCount(11173, 1, false) && + !player->HasItemCount(11522, 1, true)) { ItemPosCountVec dest; - uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, NULL); + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, NULL); if (msg == EQUIP_ERR_OK) - CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true); + player->StoreNewItem(dest, 11522, 1, true); } } @@ -254,9 +256,9 @@ public: if (HasEscortState(STATE_ESCORT_ESCORTING)) return; - if (who->GetTypeId() == TYPEID_PLAYER) + if (Player* player = who->ToPlayer()) { - if (who->HasAura(34877) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE) + if (who->HasAura(34877) && player->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE) { float Radius = 10.0f; if (me->IsWithinDistInMap(who, Radius)) diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index ff52af97c11..4ab64846f1c 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -385,14 +385,16 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who || (!who->isAlive())) + if (!who || !who->isAlive() || EventInProgress) return; - if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) - { - PlayerGUID = who->GetGUID(); - EventInProgress = true; - } + if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f)) + if (Player* player = who->ToPlayer()) + if (player->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) + { + PlayerGUID = who->GetGUID(); + EventInProgress = true; + } } void KilledUnit(Unit* /*victim*/) { } diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index fef900e1dfd..46ac11e8357 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -79,11 +79,11 @@ public: void SpellHit(Unit* caster, const SpellInfo* spell) { - if (phase) + if (phase || spell->Id != SPELL_SET_CART) return; - if (spell->Id == SPELL_SET_CART && caster->GetTypeId() == TYPEID_PLAYER - && CAST_PLR(caster)->GetQuestStatus(11897) == QUEST_STATUS_INCOMPLETE) + Player* player = caster->ToPlayer(); + if (player && player->GetQuestStatus(11897) == QUEST_STATUS_INCOMPLETE) { phase = 1; casterGuid = caster->GetGUID(); @@ -419,7 +419,7 @@ public: me->SetReactState(REACT_PASSIVE); - switch (CAST_PLR(me->GetOwner())->GetTeamId()) + switch (me->GetOwner()->ToPlayer()->GetTeamId()) { case TEAM_ALLIANCE: me->setFaction(FACTION_ESCORT_A_NEUTRAL_ACTIVE); @@ -475,23 +475,18 @@ public: { ScriptedAI::MoveInLineOfSight(who); - if (who->GetTypeId() != TYPEID_UNIT) + if (who->GetEntry() != NPC_JENNY || !who->HasAura(SPELL_CRATES_CARRIED)) + return; + + Unit* owner = who->GetOwner(); + if (!owner || !me->IsWithinDistInMap(who, 10.0f)) return; - if (who->GetEntry() == NPC_JENNY && me->IsWithinDistInMap(who, 10.0f)) + if (Player* player = owner->ToPlayer()) { - if (Unit* owner = who->GetOwner()) - { - if (owner->GetTypeId() == TYPEID_PLAYER) - { - if (who->HasAura(SPELL_CRATES_CARRIED)) - { - owner->CastSpell(owner, SPELL_GIVE_JENNY_CREDIT, true); // Maybe is not working. - CAST_PLR(owner)->CompleteQuest(QUEST_LOADER_UP); - CAST_CRE(who)->DisappearAndDie(); - } - } - } + owner->CastSpell(owner, SPELL_GIVE_JENNY_CREDIT, true); // Maybe is not working. + player->CompleteQuest(QUEST_LOADER_UP); + who->ToCreature()->DisappearAndDie(); } } }; @@ -569,8 +564,8 @@ public: if (TempSummon* summon = me->ToTempSummon()) if (summon->isSummon()) if (Unit* temp = summon->GetSummoner()) - if (temp->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(temp)->KilledMonsterCredit(me->GetEntry(), 0); + if (Player* player = temp->ToPlayer()) + player->KilledMonsterCredit(me->GetEntry(), 0); if (GameObject* go_caribou = me->GetMap()->GetGameObject(go_caribouGUID)) go_caribou->SetGoState(GO_STATE_READY); diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 5eb9ffcabc8..1681ecfb00e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -349,10 +349,10 @@ public: { /*float x, y, z; ghost->GetPosition(x, y, z); - Creature* control = me->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); - if (control) + if (Creature* control = me->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000)) { - CAST_PLR(ghost)->Possess(control); + if (Player* player = ghost->ToPlayer()) + player->Possess(control); ghost->DealDamage(ghost, ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); }*/ diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index fd193aa4835..148bfeaeefe 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -339,17 +339,15 @@ public: if (!who) return; - if (who->GetTypeId() == TYPEID_PLAYER) + Player* player = who->ToPlayer(); + if (player && player->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE) { - if (CAST_PLR(who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE) + uint32 creditMarkerId = me->GetEntry(); + if (creditMarkerId >= 18840 && creditMarkerId <= 18843) { - uint32 creditMarkerId = me->GetEntry(); - if ((creditMarkerId >= 18840) && (creditMarkerId <= 18843)) - { - // 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding - if (!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId)) - CAST_PLR(who)->KilledMonsterCredit(creditMarkerId, me->GetGUID()); - } + // 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding + if (!player->GetReqKillOrCastCurrentCount(10085, creditMarkerId)) + player->KilledMonsterCredit(creditMarkerId, me->GetGUID()); } } } diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 779ab3261ed..c0adddd51fc 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -118,36 +118,33 @@ public: if (someplayer) { - Unit* p = Unit::GetUnit(*me, someplayer); - if (p && p->GetTypeId() == TYPEID_PLAYER) + if (Player* player = ObjectAccessor::GetPlayer(*me, someplayer)) { switch (me->GetEntry()) { case ENTRY_BNAAR_C_CONSOLE: - CAST_PLR(p)->FailQuest(10299); - CAST_PLR(p)->FailQuest(10329); + player->FailQuest(10299); + player->FailQuest(10329); break; case ENTRY_CORUU_C_CONSOLE: - CAST_PLR(p)->FailQuest(10321); - CAST_PLR(p)->FailQuest(10330); + player->FailQuest(10321); + player->FailQuest(10330); break; case ENTRY_DURO_C_CONSOLE: - CAST_PLR(p)->FailQuest(10322); - CAST_PLR(p)->FailQuest(10338); + player->FailQuest(10322); + player->FailQuest(10338); break; case ENTRY_ARA_C_CONSOLE: - CAST_PLR(p)->FailQuest(10323); - CAST_PLR(p)->FailQuest(10365); + player->FailQuest(10323); + player->FailQuest(10365); break; } } } if (goConsole) - { if (GameObject* go = GameObject::GetGameObject(*me, goConsole)) go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); - } } void DoWaveSpawnForCreature(Creature* creature) @@ -275,27 +272,30 @@ public: Talk(EMOTE_COMPLETE); if (someplayer) { - Unit* u = Unit::GetUnit(*me, someplayer); - if (u && u->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(u)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); + if (Player* player = ObjectAccessor::GetPlayer(*me, someplayer)) + player->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); DoCast(me, SPELL_DISABLE_VISUAL); } + if (goConsole) - { if (GameObject* go = GameObject::GetGameObject(*me, goConsole)) go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); - } + ++Phase; break; } - } else Event_Timer -= diff; + } + else + Event_Timer -= diff; if (Wave) { if (Wave_Timer <= diff) { DoWaveSpawnForCreature(me); - } else Wave_Timer -= diff; + } + else + Wave_Timer -= diff; } } }; diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index b8f96e373f3..644fd71e7a2 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -1377,20 +1377,19 @@ public: { case TYPEID_UNIT: if (Unit* owner = killer->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); + if (Player* player = owner->ToPlayer()) + player->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); break; case TYPEID_PLAYER: - CAST_PLR(killer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); + if (Player* player = killer->ToPlayer()) + player->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); break; default: break; } if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID))) - { LordIllidan->AI()->EnterEvadeMode(); - } } }; }; @@ -1865,10 +1864,9 @@ public: Summoned->setFaction(ENRAGED_SOUL_FRIENDLY); Summoned->GetMotionMaster()->MovePoint(0, totemOspirits->GetPositionX(), totemOspirits->GetPositionY(), Summoned->GetPositionZ()); - Unit* Owner = totemOspirits->GetOwner(); - if (Owner && Owner->GetTypeId() == TYPEID_PLAYER) - // DoCast(Owner, credit); -- not working! - CAST_PLR(Owner)->KilledMonsterCredit(credit, 0); + if (Unit* owner = totemOspirits->GetOwner()) + if (Player* player = owner->ToPlayer()) + player->KilledMonsterCredit(credit, 0); DoCast(totemOspirits, SPELL_SOUL_CAPTURED); } } diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index 14553be0ef4..bb9f0d80d12 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -167,10 +167,9 @@ public: void DamageTaken(Unit* done_by, uint32 &damage) { - if (done_by->GetTypeId() == TYPEID_PLAYER) - if (me->HealthBelowPctDamaged(20, damage)) + if (done_by->GetTypeId() == TYPEID_PLAYER && me->HealthBelowPctDamaged(20, damage)) { - CAST_PLR(done_by)->GroupEventHappens(QUEST_10004, me); + done_by->ToPlayer()->GroupEventHappens(QUEST_10004, me); damage = 0; EnterEvadeMode(); } @@ -410,20 +409,18 @@ public: if (HasEscortState(STATE_ESCORT_ESCORTING)) return; - if (who->GetTypeId() == TYPEID_PLAYER) + Player* player = who->ToPlayer(); + if (player && player->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) { - if (CAST_PLR(who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) + float Radius = 10.0f; + if (me->IsWithinDistInMap(who, Radius)) { - float Radius = 10.0f; - if (me->IsWithinDistInMap(who, Radius)) - { - Start(false, false, who->GetGUID()); - } + Start(false, false, who->GetGUID()); } } } - void Reset() {} + void Reset() { } }; }; @@ -583,9 +580,8 @@ public: me->DeleteThreatList(); me->CombatStop(); me->GetMotionMaster()->MoveTargetedHome(); - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player) - CAST_PLR(player)->GroupEventHappens(QUEST_WBI, me); + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) + player->GroupEventHappens(QUEST_WBI, me); } DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index caa31ed472c..85a45193931 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -98,10 +98,11 @@ public: void DamageTaken(Unit* done_by, uint32 &damage) { - if (done_by->GetTypeId() == TYPEID_PLAYER) - if (me->HealthBelowPctDamaged(30, damage)) + Player* player = done_by->ToPlayer(); + + if (player && me->HealthBelowPctDamaged(30, damage)) { - if (Group* group = CAST_PLR(done_by)->GetGroup()) + if (Group* group = player->GetGroup()) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -115,11 +116,11 @@ public: CanDoQuest = true; } } - } else - if (CAST_PLR(done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && - CAST_PLR(done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) + } + else if (player->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && + player->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) { - CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); + player->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); CanDoQuest = true; } } @@ -229,20 +230,13 @@ public: if (HasEscortState(STATE_ESCORT_ESCORTING)) return; - if (who->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(who)->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE) - { - float Radius = 10.0f; - if (me->IsWithinDistInMap(who, Radius)) - { - Start(false, false, who->GetGUID()); - } - } - } + Player* player = who->ToPlayer(); + if (player && player->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE) + if (me->IsWithinDistInMap(who, 10.0f)) + Start(false, false, who->GetGUID()); } - void Reset() {} + void Reset() { } void UpdateAI(uint32 diff) { diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 12796d5f88e..0ac766c37f9 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -761,40 +761,41 @@ public: void SpellHit(Unit* caster, SpellInfo const* spell) { - if (caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && spell->Id == 20804) - { - if ((CAST_PLR(caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (CAST_PLR(caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)) - if (DoctorGUID) - if (Creature* doctor = Unit::GetCreature(*me, DoctorGUID)) - CAST_AI(npc_doctor::npc_doctorAI, doctor->AI())->PatientSaved(me, CAST_PLR(caster), Coord); + Player* player = caster->ToPlayer(); + if (!player || !me->isAlive() || spell->Id != 20804) + return; - //make not selectable - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + if (player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE) + if (DoctorGUID) + if (Creature* doctor = Unit::GetCreature(*me, DoctorGUID)) + CAST_AI(npc_doctor::npc_doctorAI, doctor->AI())->PatientSaved(me, player, Coord); - //regen health - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + //make not selectable + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //stand up - me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); + //regen health + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - Talk(SAY_DOC); + //stand up + me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); - uint32 mobId = me->GetEntry(); - me->SetWalk(false); + Talk(SAY_DOC); - switch (mobId) - { - case 12923: - case 12924: - case 12925: - me->GetMotionMaster()->MovePoint(0, H_RUNTOX, H_RUNTOY, H_RUNTOZ); - break; - case 12936: - case 12937: - case 12938: - me->GetMotionMaster()->MovePoint(0, A_RUNTOX, A_RUNTOY, A_RUNTOZ); - break; - } + uint32 mobId = me->GetEntry(); + me->SetWalk(false); + + switch (mobId) + { + case 12923: + case 12924: + case 12925: + me->GetMotionMaster()->MovePoint(0, H_RUNTOX, H_RUNTOY, H_RUNTOZ); + break; + case 12936: + case 12937: + case 12938: + me->GetMotionMaster()->MovePoint(0, A_RUNTOX, A_RUNTOY, A_RUNTOZ); + break; } } @@ -1749,52 +1750,53 @@ public: void ReceiveEmote(Player* player, uint32 emote) { me->HandleEmoteCommand(emote); - Unit* own = me->GetOwner(); - if (!own || own->GetTypeId() != TYPEID_PLAYER || CAST_PLR(own)->GetTeam() != player->GetTeam()) - return; - if (emote == TEXT_EMOTE_KISS) + Unit* owner = me->GetOwner(); + if (emote != TEXT_EMOTE_KISS || owner || owner->GetTypeId() != TYPEID_PLAYER || + owner->ToPlayer()->GetTeam() != player->GetTeam()) { - std::string whisp = ""; - switch (rand() % 8) - { - case 0: - whisp.append(SAY_RANDOM_MOJO0); - break; - case 1: - whisp.append(SAY_RANDOM_MOJO1); - break; - case 2: - whisp.append(SAY_RANDOM_MOJO2); - break; - case 3: - whisp.append(SAY_RANDOM_MOJO3); - break; - case 4: - whisp.append(SAY_RANDOM_MOJO4); - break; - case 5: - whisp.append(SAY_RANDOM_MOJO5); - break; - case 6: - whisp.append(SAY_RANDOM_MOJO6a); - whisp.append(player->GetName()); - whisp.append(SAY_RANDOM_MOJO6b); - break; - case 7: - whisp.append(SAY_RANDOM_MOJO7); - break; - } + return; + } - me->MonsterWhisper(whisp.c_str(), player->GetGUID()); - if (victimGUID) - if (Player* victim = Unit::GetPlayer(*me, victimGUID)) - victim->RemoveAura(43906);//remove polymorph frog thing - me->AddAura(43906, player);//add polymorph frog thing - victimGUID = player->GetGUID(); - DoCast(me, 20372, true);//tag.hearts - me->GetMotionMaster()->MoveFollow(player, 0, 0); - hearts = 15000; + std::string whisp = ""; + switch (rand() % 8) + { + case 0: + whisp.append(SAY_RANDOM_MOJO0); + break; + case 1: + whisp.append(SAY_RANDOM_MOJO1); + break; + case 2: + whisp.append(SAY_RANDOM_MOJO2); + break; + case 3: + whisp.append(SAY_RANDOM_MOJO3); + break; + case 4: + whisp.append(SAY_RANDOM_MOJO4); + break; + case 5: + whisp.append(SAY_RANDOM_MOJO5); + break; + case 6: + whisp.append(SAY_RANDOM_MOJO6a); + whisp.append(player->GetName()); + whisp.append(SAY_RANDOM_MOJO6b); + break; + case 7: + whisp.append(SAY_RANDOM_MOJO7); + break; } + + me->MonsterWhisper(whisp.c_str(), player->GetGUID()); + if (victimGUID) + if (Player* victim = Unit::GetPlayer(*me, victimGUID)) + victim->RemoveAura(43906); // remove polymorph frog thing + me->AddAura(43906, player); // add polymorph frog thing + victimGUID = player->GetGUID(); + DoCast(me, 20372, true); // tag.hearts + me->GetMotionMaster()->MoveFollow(player, 0, 0); + hearts = 15000; } }; |