aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms/ScarletEnclave
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2013-03-21 13:07:10 +0100
committerSpp <spp@jorge.gr>2013-03-21 13:07:10 +0100
commit355029fb4f30a3d535a7c360b896b728eee330b6 (patch)
tree31f653f8ea96aaa2f0152d439bdd7a481c203f87 /src/server/scripts/EasternKingdoms/ScarletEnclave
parentd0910974336115be1dd06577c63fe3703e8170d2 (diff)
Core/Scripts: Removed CAST_PLR define
Diffstat (limited to 'src/server/scripts/EasternKingdoms/ScarletEnclave')
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp28
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp3
2 files changed, 17 insertions, 14 deletions
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;