diff options
| author | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-03-21 22:00:01 +0100 |
|---|---|---|
| committer | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-03-21 22:00:01 +0100 |
| commit | 15a249e28c3a6fbd44c964e48052651580caceb7 (patch) | |
| tree | 98b076e969b482d7914f37040efcb595bbca556b /src/server/scripts/Northrend | |
| parent | 41822a8ed392357aed43e52135a51456b0a42f96 (diff) | |
| parent | d05aac03ae4b4b9df765ed89adef25235c9639e9 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Entities/Pet/Pet.cpp
src/server/game/Entities/Pet/Pet.h
src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp
src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
src/server/scripts/Kalimdor/zone_azshara.cpp
Diffstat (limited to 'src/server/scripts/Northrend')
10 files changed, 37 insertions, 44 deletions
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index 3dcac3f68dc..2438273dcba 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -185,7 +185,7 @@ public: void JustSummoned(Creature* summon) { - lSummons.push_back(summon->GetGUID()); + lSummons.Summon(summon); if (summon->AI()) summon->AI()->AttackStart(me); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index e377f5f8d07..cab02c9ca75 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -687,7 +687,7 @@ class boss_professor_putricide : public CreatureScript me->SetFacingToObject(face); me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); Talk(SAY_TRANSFORM_2); - summons.remove_if(AbominationDespawner(me)); + summons.DespawnIf(AbominationDespawner(me)); events.ScheduleEvent(EVENT_RESUME_ATTACK, 8500, 0, PHASE_COMBAT_3); break; default: diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index 878107ab35d..0e5941138a6 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -89,11 +89,10 @@ class boss_sapphiron : public CreatureScript struct boss_sapphironAI : public BossAI { - boss_sapphironAI(Creature* creature) : BossAI(creature, BOSS_SAPPHIRON) - , _phase(PHASE_NULL) - { - _map = me->GetMap(); - } + boss_sapphironAI(Creature* creature) : + BossAI(creature, BOSS_SAPPHIRON), _phase(PHASE_NULL), + _map(me->GetMap()) + { } void InitializeAI() { diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 47e39574690..d861343116f 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -621,7 +621,7 @@ public: { VehicleCheckPredicate pred; summons.DoAction(ACTION_DELAYED_DESPAWN, pred); - summons.remove_if(pred); + summons.DespawnIf(pred); summons.DespawnAll(); } else if (_phase == PHASE_THREE) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 33a14aaa3df..3299148ea43 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -287,7 +287,6 @@ class boss_freya : public CreatureScript void Reset() { _Reset(); - summons.clear(); trioWaveCount = 0; trioWaveController = 0; waveCount = 0; @@ -494,7 +493,7 @@ class boss_freya : public CreatureScript { for (uint8 n = 0; n < 3; ++n) { - summons.remove(Elemental[n][i]->GetGUID()); + summons.Despawn(Elemental[n][i]); Elemental[n][i]->DespawnOrUnsummon(5000); trioDefeated[i] = true; Elemental[n][i]->CastSpell(me, SPELL_REMOVE_10STACK, true); @@ -625,7 +624,7 @@ class boss_freya : public CreatureScript case NPC_ANCIENT_WATER_SPIRIT: case NPC_STORM_LASHER: ElementalGUID[trioWaveController][trioWaveCount] = summoned->GetGUID(); - summons.push_back(summoned->GetGUID()); + summons.Summon(summoned); ++trioWaveController; if (trioWaveController > 2) trioWaveController = 0; @@ -633,7 +632,7 @@ class boss_freya : public CreatureScript case NPC_DETONATING_LASHER: case NPC_ANCIENT_CONSERVATOR: default: - summons.push_back(summoned->GetGUID()); + summons.Summon(summoned); break; } @@ -654,12 +653,12 @@ class boss_freya : public CreatureScript summoned->CastSpell(me, SPELL_REMOVE_2STACK, true); summoned->CastSpell(who, SPELL_DETONATE, true); summoned->DespawnOrUnsummon(5000); - summons.remove(summoned->GetGUID()); + summons.Despawn(summoned); break; case NPC_ANCIENT_CONSERVATOR: summoned->CastSpell(me, SPELL_REMOVE_25STACK, true); summoned->DespawnOrUnsummon(5000); - summons.remove(summoned->GetGUID()); + summons.Despawn(summoned); break; } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index b970dc6d7ab..0f99ea9cc2d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -821,7 +821,7 @@ class npc_hodir_mage : public CreatureScript void SummonedCreatureDespawn(Creature* summoned) { if (summoned->GetEntry() == NPC_TOASTY_FIRE) - summons.remove(summoned->GetGUID()); + summons.Despawn(summoned); } void UpdateAI(uint32 diff) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 5e94fc2ee5d..47fe7c8f80a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -219,7 +219,7 @@ class boss_kologarn : public CreatureScript summon->CastSpell(me, SPELL_FOCUSED_EYEBEAM_VISUAL_RIGHT, true); break; case NPC_RUBBLE: - summons.push_back(summon->GetGUID()); + summons.Summon(summon); // absence of break intended default: return; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index ef7ad659a24..75f643286b2 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -113,7 +113,7 @@ public: { Unit* dalronn = Unit::GetUnit(*me, instance->GetData64(DATA_DALRONN)); if (dalronn && dalronn->isDead()) - CAST_CRE(dalronn)->Respawn(); + dalronn->ToCreature()->Respawn(); instance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); } @@ -280,7 +280,7 @@ public: { Unit* skarvald = Unit::GetUnit(*me, instance->GetData64(DATA_SKARVALD)); if (skarvald && skarvald->isDead()) - CAST_CRE(skarvald)->Respawn(); + skarvald->ToCreature()->Respawn(); instance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); } diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index cfb3c03b12c..db70177f8a0 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -306,7 +306,7 @@ public: { summoned->SetSpeed(MOVE_RUN, 0.3f); summoned->GetMotionMaster()->MoveFollow(me, 0, 0); - m_waterElements.push_back(summoned->GetGUID()); + m_waterElements.Summon(summoned); instance->SetData64(DATA_ADD_TRASH_MOB, summoned->GetGUID()); } } @@ -315,7 +315,7 @@ public: { if (summoned) { - m_waterElements.remove(summoned->GetGUID()); + m_waterElements.Despawn(summoned); instance->SetData64(DATA_DEL_TRASH_MOB, summoned->GetGUID()); } } diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index fef900e1dfd..6fb1079d94c 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(); @@ -190,7 +190,7 @@ public: if (owner->GetTypeId() == TYPEID_PLAYER) { owner->CastSpell(owner, 46231, true); - CAST_CRE(who)->DespawnOrUnsummon(); + who->ToCreature()->DespawnOrUnsummon(); } } } @@ -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); @@ -1268,7 +1263,7 @@ public: if (me->isSummon()) if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(summoner)->AI())->arthasInPosition = true; + CAST_AI(npc_thassarian::npc_thassarianAI, summoner->ToCreature()->AI())->arthasInPosition = true; } }; @@ -1300,7 +1295,7 @@ public: me->CastSpell(me, SPELL_STUN, true); if (me->isSummon()) if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(summoner)->AI())->arlosInPosition = true; + CAST_AI(npc_thassarian::npc_thassarianAI, summoner->ToCreature()->AI())->arlosInPosition = true; } }; @@ -1357,7 +1352,7 @@ public: if (me->isSummon()) if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(summoner)->AI())->talbotInPosition = true; + CAST_AI(npc_thassarian::npc_thassarianAI, summoner->ToCreature()->AI())->talbotInPosition = true; } void UpdateAI(uint32 uiDiff) |
