diff options
Diffstat (limited to 'src/server/scripts')
-rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_honor.cpp | 5 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 12 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp | 11 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_icecrown.cpp | 13 |
5 files changed, 23 insertions, 20 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index fc7f1fac352..f6ee0faaa31 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -258,7 +258,7 @@ public: if (!unit || (unit->GetTypeId() != TYPEID_PLAYER)) player = handler->GetSession()->GetPlayer(); else - player = (Player*)unit; + player = unit->ToPlayer(); if (!unit) unit = player; diff --git a/src/server/scripts/Commands/cs_honor.cpp b/src/server/scripts/Commands/cs_honor.cpp index 9732e2557e9..75c7fcf71e2 100644 --- a/src/server/scripts/Commands/cs_honor.cpp +++ b/src/server/scripts/Commands/cs_honor.cpp @@ -90,8 +90,9 @@ public: } // check online security - if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity((Player*)target, 0)) - return false; + if (Player* player = target->ToPlayer()) + if (handler->HasLowerSecurity(player, 0)) + return false; handler->GetSession()->GetPlayer()->RewardHonor(target, 1); return true; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 4e1427dabd2..fd7bcaab1d3 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -655,11 +655,9 @@ public: return false; } - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (handler->HasLowerSecurity((Player*)target, 0, false)) + if (Player* player = target->ToPlayer()) + if (handler->HasLowerSecurity(player, 0, false)) return false; - } if (target->IsAlive()) { @@ -2227,11 +2225,9 @@ public: return false; } - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (handler->HasLowerSecurity((Player*)target, 0, false)) + if (Player* player = target->ToPlayer()) + if (handler->HasLowerSecurity(player, 0, false)) return false; - } if (!target->IsAlive()) return true; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index ddcd4c7d824..2895e85de71 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -545,11 +545,12 @@ public: bool OnGossipHello(Player* player, GameObject* go) OVERRIDE { - uint8 SpectralPlayers = 0; Map* map = go->GetMap(); if (!map->IsDungeon()) return true; +#if MAX_PLAYERS_IN_SPECTRAL_REALM > 0 + uint8 SpectralPlayers = 0; Map::PlayerList const &PlayerList = map->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { @@ -558,9 +559,13 @@ public: } if (player->HasAura(AURA_SPECTRAL_EXHAUSTION) || SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM) + { player->GetSession()->SendNotification(GO_FAILED); - else - player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true); + return true; + } +#endif + + player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true); return true; } }; diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index a5d3ed7d0d5..24452a5fb5f 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -1035,11 +1035,12 @@ class npc_margrave_dhakar : public CreatureScript if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true)) { - Creature* lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX()+10, morbidus->GetPositionY(), morbidus->GetPositionZ()); - _lichKingGuid = lichKing->GetGUID(); - lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX()+10, morbidus->GetPositionY(), morbidus->GetPositionZ()); - lichKing->SetFacingTo(morbidus->GetOrientation()); - lichKing->CastSpell(lichKing, SPELL_SIMPLE_TELEPORT, true); + if (Creature* lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX() + 10.0f, morbidus->GetPositionY(), morbidus->GetPositionZ())) + { + _lichKingGuid = lichKing->GetGUID(); + lichKing->SetFacingTo(morbidus->GetOrientation()); + lichKing->CastSpell(lichKing, SPELL_SIMPLE_TELEPORT, true); + } } _events.ScheduleEvent(EVENT_LK_SAY_1, 5000); @@ -1109,8 +1110,8 @@ class npc_margrave_dhakar : public CreatureScript private: EventMap _events; - uint64 _lichKingGuid; SummonList _summons; + uint64 _lichKingGuid; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE |