diff options
Diffstat (limited to 'src/server/scripts')
24 files changed, 128 insertions, 190 deletions
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 591f797bfee..0a45506c736 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -166,6 +166,8 @@ public: // fill the gameobject data and save to the db object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMaskForSpawn()); + guidLow = object->GetSpawnId(); + // delete the old object and do a clean load from DB with a fresh new GameObject instance. // this is required to avoid weird behavior and memory leaks delete object; @@ -426,16 +428,26 @@ public: o = player->GetOrientation(); } + Map* map = object->GetMap(); + object->Relocate(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), o); object->UpdateRotationFields(); - object->DestroyForNearbyPlayers(); - object->UpdateObjectVisibility(); - object->SaveToDB(); - object->Refresh(); - handler->PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, object->GetGUID().GetCounter(), object->GetGOInfo()->name.c_str(), object->GetGUID().GetCounter(), o); + // Generate a completely new spawn with new guid + // 3.3.5a client caches recently deleted objects and brings them back to life + // when CreateObject block for this guid is received again + // however it entirely skips parsing that block and only uses already known location + object->Delete(); + + object = new GameObject(); + if (!object->LoadGameObjectFromDB(guidLow, map)) + { + delete object; + return false; + } + handler->PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, object->GetSpawnId(), object->GetGOInfo()->name.c_str(), object->GetSpawnId()); return true; } @@ -468,21 +480,20 @@ public: char* toY = strtok(NULL, " "); char* toZ = strtok(NULL, " "); + float x, y, z; if (!toX) { Player* player = handler->GetSession()->GetPlayer(); - object->Relocate(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), object->GetOrientation()); - object->DestroyForNearbyPlayers(); - object->UpdateObjectVisibility(); + player->GetPosition(x, y, z); } else { if (!toY || !toZ) return false; - float x = (float)atof(toX); - float y = (float)atof(toY); - float z = (float)atof(toZ); + x = (float)atof(toX); + y = (float)atof(toY); + z = (float)atof(toZ); if (!MapManager::IsValidMapCoord(object->GetMapId(), x, y, z)) { @@ -490,17 +501,27 @@ public: handler->SetSentErrorMessage(true); return false; } - - object->Relocate(x, y, z, object->GetOrientation()); - object->DestroyForNearbyPlayers(); - object->UpdateObjectVisibility(); } + Map* map = object->GetMap(); + + object->Relocate(x, y, z, object->GetOrientation()); object->SaveToDB(); - object->Refresh(); - handler->PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, object->GetGUID().GetCounter(), object->GetGOInfo()->name.c_str(), object->GetGUID().GetCounter()); + // Generate a completely new spawn with new guid + // 3.3.5a client caches recently deleted objects and brings them back to life + // when CreateObject block for this guid is received again + // however it entirely skips parsing that block and only uses already known location + object->Delete(); + + object = new GameObject(); + if (!object->LoadGameObjectFromDB(guidLow, map)) + { + delete object; + return false; + } + handler->PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, object->GetSpawnId(), object->GetGOInfo()->name.c_str(), object->GetSpawnId()); return true; } diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index 78c8f970f52..c960d3f3753 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -217,7 +217,7 @@ public: { playerName = param3; if (normalizePlayerName(playerName)) - player = sObjectAccessor->FindPlayerByName(playerName); + player = ObjectAccessor::FindPlayerByName(playerName); } if (!player) @@ -283,7 +283,7 @@ public: { playerName = param2; if (normalizePlayerName(playerName)) - player = sObjectAccessor->FindPlayerByName(playerName); + player = ObjectAccessor::FindPlayerByName(playerName); } if (!player) diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index dfb1d84c6cc..21a55b1558a 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -600,8 +600,10 @@ public: target->SaveToDB(); } else - // will resurrected at login without corpse - sObjectAccessor->ConvertCorpseForPlayer(targetGuid); + { + SQLTransaction trans(nullptr); + Player::OfflineResurrect(targetGuid, trans); + } return true; } @@ -820,7 +822,7 @@ public: // Save all players in the world static bool HandleSaveAllCommand(ChatHandler* handler, char const* /*args*/) { - sObjectAccessor->SaveAllPlayers(); + ObjectAccessor::SaveAllPlayers(); handler->SendSysMessage(LANG_PLAYERS_SAVED); return true; } diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 6fa84d1bc75..fe5ae940f88 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -100,7 +100,7 @@ public: // Triggering corpses expire check in world static bool HandleServerCorpsesCommand(ChatHandler* /*handler*/, char const* /*args*/) { - sObjectAccessor->RemoveOldCorpses(); + sWorld->RemoveOldCorpses(); return true; } diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp index b609dfe18dd..f7634381fc9 100644 --- a/src/server/scripts/Commands/cs_ticket.cpp +++ b/src/server/scripts/Commands/cs_ticket.cpp @@ -153,7 +153,7 @@ public: return true; } - sTicketMgr->CloseTicket(ticket->GetId(), player ? player->GetGUID() : ObjectGuid(uint64(-1))); + sTicketMgr->ResolveAndCloseTicket(ticket->GetId(), player ? player->GetGUID() : ObjectGuid(uint64(-1))); sTicketMgr->UpdateLastChange(); std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", NULL, NULL, NULL, NULL); @@ -248,7 +248,10 @@ public: if (Player* player = ticket->GetPlayer()) ticket->SendResponse(player->GetSession()); + Player* gm = handler->GetSession() ? handler->GetSession()->GetPlayer() : nullptr; + SQLTransaction trans = SQLTransaction(NULL); + ticket->SetResolvedBy(gm ? gm->GetGUID() : ObjectGuid(uint64(-1))); ticket->SetCompleted(); ticket->SaveToDB(trans); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 51e1bf67f16..a89571e8197 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -367,9 +367,9 @@ public: } } - void sGossipSelect(Player* player, uint32 sender, uint32 action) override + void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override { - if (sender == GOSSIP_ID && action == GOSSIP_OPTION_ID) + if (menuId == GOSSIP_ID && gossipListId == GOSSIP_OPTION_ID) { player->CLOSE_GOSSIP_MENU(); Talk(SAY_GAMESBEGIN_1); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp index 636554a0ae4..76ab4736275 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp @@ -221,9 +221,9 @@ public: DoMeleeAttackIfReady(); } - void sGossipSelect(Player* player, uint32 sender, uint32 action) override + void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override { - if (sender == GOSSIP_ID && action == 0) + if (menuId == GOSSIP_ID && gossipListId == 0) { player->CLOSE_GOSSIP_MENU(); BeginSpeech(player); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index f3c59654295..87945ccf916 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -25,7 +25,6 @@ EndScriptData */ /* ContentData npc_barnes -npc_berthold npc_image_of_medivh EndContentData */ @@ -416,41 +415,6 @@ public: }; /*### -# npc_berthold -####*/ - -#define GOSSIP_ITEM_TELEPORT "Teleport me to the Guardian's Library" - -class npc_berthold : public CreatureScript -{ -public: - npc_berthold() : CreatureScript("npc_berthold") { } - - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - player->CastSpell(player, SPELL_TELEPORT, true); - - player->CLOSE_GOSSIP_MENU(); - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (InstanceScript* instance = creature->GetInstanceScript()) - { - // Check if Shade of Aran event is done - if (instance->GetData(TYPE_ARAN) == DONE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - } - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } -}; - -/*### # npc_image_of_medivh ####*/ @@ -668,6 +632,5 @@ public: void AddSC_karazhan() { new npc_barnes(); - new npc_berthold(); new npc_image_of_medivh(); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index b37d505d766..9747d31952b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -729,13 +729,19 @@ class npc_dark_rider_of_acherus : public CreatureScript ## npc_salanar_the_horseman ######*/ -enum Spells_Salanar +enum SalanarTheHorseman { - SPELL_REALM_OF_SHADOWS = 52693, + GOSSIP_SALANAR_MENU = 9739, + GOSSIP_SALANAR_OPTION = 0, + SALANAR_SAY = 0, + QUEST_INTO_REALM_OF_SHADOWS = 12687, + NPC_DARK_RIDER_OF_ACHERUS = 28654, + NPC_SALANAR_IN_REALM_OF_SHADOWS = 28788, SPELL_EFFECT_STOLEN_HORSE = 52263, SPELL_DELIVER_STOLEN_HORSE = 52264, SPELL_CALL_DARK_RIDER = 52266, - SPELL_EFFECT_OVERTAKE = 52349 + SPELL_EFFECT_OVERTAKE = 52349, + SPELL_REALM_OF_SHADOWS = 52693 }; class npc_salanar_the_horseman : public CreatureScript @@ -743,15 +749,19 @@ class npc_salanar_the_horseman : public CreatureScript public: npc_salanar_the_horseman() : CreatureScript("npc_salanar_the_horseman") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_salanar_the_horsemanAI(creature); - } - struct npc_salanar_the_horsemanAI : public ScriptedAI { npc_salanar_the_horsemanAI(Creature* creature) : ScriptedAI(creature) { } + void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override + { + if (menuId == GOSSIP_SALANAR_MENU && gossipListId == GOSSIP_SALANAR_OPTION) + { + player->CastSpell(player, SPELL_REALM_OF_SHADOWS, true); + player->PlayerTalkClass->SendCloseGossip(); + } + } + void SpellHit(Unit* caster, const SpellInfo* spell) override { if (spell->Id == SPELL_DELIVER_STOLEN_HORSE) @@ -766,7 +776,7 @@ public: caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); caster->setFaction(35); DoCast(caster, SPELL_CALL_DARK_RIDER, true); - if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15)) + if (Creature* Dark_Rider = me->FindNearestCreature(NPC_DARK_RIDER_OF_ACHERUS, 15)) ENSURE_AI(npc_dark_rider_of_acherus::npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); } } @@ -784,10 +794,11 @@ public: { if (Player* player = charmer->ToPlayer()) { - // for quest Into the Realm of Shadows(12687) - if (me->GetEntry() == 28788 && player->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) + // for quest Into the Realm of Shadows(QUEST_INTO_REALM_OF_SHADOWS) + if (me->GetEntry() == NPC_SALANAR_IN_REALM_OF_SHADOWS && player->GetQuestStatus(QUEST_INTO_REALM_OF_SHADOWS) == QUEST_STATUS_INCOMPLETE) { - player->GroupEventHappens(12687, me); + player->GroupEventHappens(QUEST_INTO_REALM_OF_SHADOWS, me); + Talk(SALANAR_SAY); charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE); if (Creature* creature = who->ToCreature()) { @@ -796,14 +807,17 @@ public: } } - if (player->HasAura(SPELL_REALM_OF_SHADOWS)) - player->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS); + player->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS); } } } } }; + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_salanar_the_horsemanAI(creature); + } }; /*###### diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 3b52e6775b2..1927b0f9829 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -268,9 +268,9 @@ class npc_harrison_jones : public CreatureScript void EnterCombat(Unit* /*who*/) override { } - void sGossipSelect(Player* player, uint32 sender, uint32 action) override + void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override { - if (me->GetCreatureTemplate()->GossipMenuId == sender && !action) + if (me->GetCreatureTemplate()->GossipMenuId == menuId && !gossipListId) { player->CLOSE_GOSSIP_MENU(); me->SetFacingToObject(player); diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 8d9406adee1..ab7509c7a2b 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -226,7 +226,7 @@ public: } } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { DoCast(player, SPELL_TELEPORT_DARNASSUS); } diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index 6727aa69552..d6aa943123b 100644 --- a/src/server/scripts/Kalimdor/zone_azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -345,7 +345,7 @@ public: } } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { player->CLOSE_GOSSIP_MENU(); me->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index 388834d1eff..52e32d3d37c 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -230,7 +230,7 @@ public: Talk(ATTACK_YELL, who); } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { player->CLOSE_GOSSIP_MENU(); me->setFaction(FACTION_HOSTILE); diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp index 427d4bae217..c4ab8f76487 100644 --- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp @@ -541,7 +541,7 @@ public: case PHASE_PLANT_FIRST_DETONATE: // first explosives detonate finish for (GuidList::iterator itr = _explosivesGuids.begin(); itr != _explosivesGuids.end(); ++itr) { - if (GameObject* explosive = sObjectAccessor->GetGameObject(*me, *itr)) + if (GameObject* explosive = ObjectAccessor::GetGameObject(*me, *itr)) me->RemoveGameObject(explosive, true); } _explosivesGuids.clear(); @@ -638,7 +638,7 @@ public: case PHASE_PLANT_SECOND_DETONATE: // second explosives detonate finish for (GuidList::iterator itr = _explosivesGuids.begin(); itr != _explosivesGuids.end(); ++itr) { - if (GameObject* explosive = sObjectAccessor->GetGameObject(*me, *itr)) + if (GameObject* explosive = ObjectAccessor::GetGameObject(*me, *itr)) me->RemoveGameObject(explosive, true); } _explosivesGuids.clear(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 943be27943d..365e0a1588d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -203,6 +203,9 @@ enum Misc { DATA_MADE_A_MESS = 45374613, // 4537, 4613 are achievement IDs FACTION_SCOURGE = 974, + + GOSSIP_MENU_MURADIN_BRONZEBEARD = 10934, + GOSSIP_MENU_HIGH_OVERLORD_SAURFANG = 10952 }; enum MovePoints @@ -634,6 +637,15 @@ class npc_high_overlord_saurfang_icc : public CreatureScript _events.Reset(); } + void sGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override + { + if (menuId == GOSSIP_MENU_HIGH_OVERLORD_SAURFANG) + { + player->PlayerTalkClass->SendCloseGossip(); + DoAction(ACTION_START_EVENT); + } + } + void DoAction(int32 action) override { switch (action) @@ -798,28 +810,6 @@ class npc_high_overlord_saurfang_icc : public CreatureScript std::list<Creature*> _guardList; }; - bool OnGossipHello(Player* player, Creature* creature) override - { - InstanceScript* instance = creature->GetInstanceScript(); - if (instance && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "We are ready to go, High Overlord. The Lich King must fall!", 631, -ACTION_START_EVENT); - player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); - } - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - player->CLOSE_GOSSIP_MENU(); - if (action == -ACTION_START_EVENT) - creature->AI()->DoAction(ACTION_START_EVENT); - - return true; - } - CreatureAI* GetAI(Creature* creature) const override { return GetIcecrownCitadelAI<npc_high_overlord_saurfangAI>(creature); @@ -843,6 +833,15 @@ class npc_muradin_bronzebeard_icc : public CreatureScript _events.Reset(); } + void sGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override + { + if (menuId == GOSSIP_MENU_MURADIN_BRONZEBEARD) + { + player->PlayerTalkClass->SendCloseGossip(); + DoAction(ACTION_START_EVENT); + } + } + void DoAction(int32 action) override { switch (action) @@ -946,28 +945,6 @@ class npc_muradin_bronzebeard_icc : public CreatureScript std::list<Creature*> _guardList; }; - bool OnGossipHello(Player* player, Creature* creature) override - { - InstanceScript* instance = creature->GetInstanceScript(); - if (instance && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE) - { - player->ADD_GOSSIP_ITEM(0, "Let it begin...", 631, -ACTION_START_EVENT + 1); - player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); - } - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - player->CLOSE_GOSSIP_MENU(); - if (action == -ACTION_START_EVENT + 1) - creature->AI()->DoAction(ACTION_START_EVENT); - - return true; - } - CreatureAI* GetAI(Creature* creature) const override { return GetIcecrownCitadelAI<npc_muradin_bronzebeard_iccAI>(creature); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index 78730b535aa..babd444288f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -961,7 +961,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript } } - void sGossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) override { me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->GetTransport()->EnableMovement(true); @@ -1229,7 +1229,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript } } - void sGossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) override { me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->GetTransport()->EnableMovement(true); @@ -1394,7 +1394,7 @@ class npc_zafod_boombox : public CreatureScript me->SetReactState(REACT_PASSIVE); } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { player->AddItem(ITEM_GOBLIN_ROCKET_PACK, 1); player->PlayerTalkClass->SendCloseGossip(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 6c512546a24..4fadc0bf8fa 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1199,9 +1199,9 @@ class npc_tirion_fordring_tft : public CreatureScript SetEquipmentSlots(true); // remove glow on ashbringer } - void sGossipSelect(Player* /*player*/, uint32 sender, uint32 action) override + void sGossipSelect(Player* /*player*/, uint32 menuId, uint32 gossipListId) override { - if (me->GetCreatureTemplate()->GossipMenuId == sender && !action) + if (me->GetCreatureTemplate()->GossipMenuId == menuId && !gossipListId) { _events.SetPhase(PHASE_INTRO); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 59c28cd3a5a..6f07a88536d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -1508,9 +1508,9 @@ class npc_observation_ring_keeper : public CreatureScript DoCast(SPELL_KEEPER_ACTIVE); } - void sGossipSelect(Player* player, uint32 sender, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override { - if (sender != 10333) + if (menuId != 10333) return; me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index 83fd3859716..54b06260e78 100644 --- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -762,7 +762,7 @@ public: } } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { DoCast(player, SPELL_SUMMON_ASHWOOD_BRAND); } diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 25bf4826000..e86e907b550 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -85,13 +85,13 @@ public: DoMeleeAttackIfReady(); } - void sGossipSelect(Player* player, uint32 sender, uint32 action) override + void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override { - if (sender == GOSSIP_ID && action == GOSSIP_OPTION_ID) + if (menuId == GOSSIP_ID && gossipListId == GOSSIP_OPTION_ID) { player->CLOSE_GOSSIP_MENU(); me->setFaction(113); - npc_escortAI::Start(true, true, player->GetGUID()); + Start(true, true, player->GetGUID()); } } }; @@ -476,7 +476,7 @@ public: objectCounter = 0; } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { player->CLOSE_GOSSIP_MENU(); playerGUID = player->GetGUID(); diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 91c796a6e69..e36930f5745 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -267,7 +267,7 @@ public: return; } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { _events.ScheduleEvent(EVENT_RECRUIT_1, 100); player->CLOSE_GOSSIP_MENU(); @@ -552,7 +552,7 @@ public: } } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { player->CLOSE_GOSSIP_MENU(); DoCast(player, SPELL_ALCHEMIST_APPRENTICE_INVISBUFF); diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index 764cd9594ea..f044fcef5c7 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -15,22 +15,12 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* -Name: Black_Temple -Complete: 100% -Comment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. -*/ - #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "ScriptedGossip.h" #include "black_temple.h" -#include "Player.h" enum Spells { - // Spirit of Olum - SPELL_TELEPORT = 41566, // Wrathbone Flayer SPELL_CLEAVE = 15496, SPELL_IGNORED = 39544, @@ -53,36 +43,6 @@ enum Events }; // ######################################################## -// Spirit of Olum -// ######################################################## - -class npc_spirit_of_olum : public CreatureScript -{ -public: - npc_spirit_of_olum() : CreatureScript("npc_spirit_of_olum") { } - - struct npc_spirit_of_olumAI : public ScriptedAI - { - npc_spirit_of_olumAI(Creature* creature) : ScriptedAI(creature) { } - - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) override - { - if (action == 1) - { - player->CLOSE_GOSSIP_MENU(); - player->InterruptNonMeleeSpells(false); - player->CastSpell(player, SPELL_TELEPORT, false); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_spirit_of_olumAI(creature); - } -}; - -// ######################################################## // Wrathbone Flayer // ######################################################## @@ -123,7 +83,6 @@ public: void UpdateAI(uint32 diff) override { - if (!_enteredCombat) { _events.Update(diff); @@ -215,12 +174,11 @@ public: CreatureAI* GetAI(Creature* creature) const override { - return GetInstanceAI<npc_wrathbone_flayerAI>(creature); + return GetBlackTempleAI<npc_wrathbone_flayerAI>(creature); } }; void AddSC_black_temple() { - new npc_spirit_of_olum(); new npc_wrathbone_flayer(); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 7cc460d4548..f8c031f69e7 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1779,7 +1779,7 @@ public: DoMeleeAttackIfReady(); } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { player->CLOSE_GOSSIP_MENU(); EnterPhase(PHASE_CHANNEL); diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index e4369f0348d..25ff1bf9536 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -519,9 +519,9 @@ public: DoMeleeAttackIfReady(); } - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) override + void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override { - if (action == 0) + if (gossipListId == 0) { player->CLOSE_GOSSIP_MENU(); StartChannel = true; |
