From 0f9fe8dbeb3990175cfac07a3b7349c9d8e668b7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 2 Sep 2010 10:40:32 +0200 Subject: Core/Players: Don't set instanceId to 0 when player is on transport during loading, there CAN be transports inside instances Core/Scripts: Added waypoint id to OnRelocate transport hook Core/Scripts: Make use of ZoneScript::GetGameObjectEntry at gameobject creation (makes it possible to override gameobject entries in instances) Core/Transports: Call InstanceScript::EventInform for transport events Core/Transports: Use guid from db for transports, not just its entry - adds partial support for instancing them (still cannot use transports table for it, but can spawn manually now) Scripts/Icecrown Citadel: Fixed crash in Deathbringer Saurfang when event is started by more than one person (can't do this anymore) Closes isssue #3749. --HG-- branch : trunk --- .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index bb4645615ce..c8c9254d404 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -537,6 +537,10 @@ class npc_high_overlord_saurfang_icc : public CreatureScript { if (action == ACTION_START_EVENT) { + // Prevent crashes + if (events.GetPhaseMask() & PHASE_INTRO_MASK) + return; + GetCreatureListWithEntryInGrid(guardList, me, NPC_SE_KOR_KRON_REAVER, 20.0f); guardList.sort(Trinity::ObjectDistanceOrderPred(me)); uint32 x = 1; @@ -695,8 +699,10 @@ class npc_high_overlord_saurfang_icc : public CreatureScript return true; } - bool OnGossipSelect(Player* /*pPlayer*/, Creature* pCreature, uint32 /*sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* pCreature, uint32 /*sender*/, uint32 action) { + player->PlayerTalkClass->ClearMenus(); + player->CLOSE_GOSSIP_MENU(); if (action == -ACTION_START_EVENT) pCreature->AI()->DoAction(ACTION_START_EVENT); @@ -730,6 +736,11 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { if (action == ACTION_START_EVENT) { + // Prevent crashes + if (events.GetPhaseMask() & PHASE_INTRO_MASK) + return; + + events.SetPhase(PHASE_INTRO_A); GetCreatureListWithEntryInGrid(guardList, me, NPC_SE_SKYBREAKER_MARINE, 20.0f); guardList.sort(Trinity::ObjectDistanceOrderPred(me)); uint32 x = 1; @@ -739,7 +750,6 @@ class npc_muradin_bronzebeard_icc : public CreatureScript me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); DoScriptText(SAY_INTRO_ALLIANCE_1, me); events.ScheduleEvent(EVENT_INTRO_ALLIANCE_4, 2500+17500+9500, 0, PHASE_INTRO_A); - events.SetPhase(PHASE_INTRO_A); if (pInstance) { uiDeathbringerSaurfangGUID = pInstance->GetData64(DATA_DEATHBRINGER_SAURFANG); @@ -825,8 +835,10 @@ class npc_muradin_bronzebeard_icc : public CreatureScript return true; } - bool OnGossipSelect(Player* /*pPlayer*/, Creature* pCreature, uint32 /*sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* pCreature, uint32 /*sender*/, uint32 action) { + player->PlayerTalkClass->ClearMenus(); + player->CLOSE_GOSSIP_MENU(); if (action == -ACTION_START_EVENT+1) pCreature->AI()->DoAction(ACTION_START_EVENT); -- cgit v1.2.3