diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp | 86 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/zone_azshara.cpp | 2 |
2 files changed, 63 insertions, 25 deletions
diff --git a/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp index b102873e940..a8f335e6d81 100644 --- a/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,28 +15,25 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Blasted_Lands -SD%Complete: 90 -SDComment: Quest support: 3628. Teleporter to Rise of the Defiler missing group support. -SDCategory: Blasted Lands -EndScriptData */ +/* +Blasted_Lands +Quest support: 3628. Teleporter to Rise of the Defiler. +*/ -/* ContentData +/* npc_deathly_usher -EndContentData */ +*/ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "ScriptedGossip.h" +#include "SpellScript.h" #include "Player.h" +#include "Group.h" /*###### ## npc_deathly_usher ######*/ -#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler." - enum DeathlyUsher { SPELL_TELEPORT_SINGLE = 12885, @@ -50,30 +46,72 @@ class npc_deathly_usher : public CreatureScript public: npc_deathly_usher() : CreatureScript("npc_deathly_usher") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE + struct npc_deathly_usherAI : public ScriptedAI { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) + npc_deathly_usherAI(Creature* creature) : ScriptedAI(creature) { } + + void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) OVERRIDE { player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true); + me->CastSpell(player, SPELL_TELEPORT_GROUP, true); } + }; - return true; + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_deathly_usherAI(creature); } +}; - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE - { - if (player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); +/*##### +# spell_razelikh_teleport_group +#####*/ + +class spell_razelikh_teleport_group : public SpellScriptLoader +{ + public: spell_razelikh_teleport_group() : SpellScriptLoader("spell_razelikh_teleport_group") { } + + class spell_razelikh_teleport_group_SpellScript : public SpellScript + { + PrepareSpellScript(spell_razelikh_teleport_group_SpellScript); - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + bool Validate(SpellInfo const* /*spell*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_TELEPORT_SINGLE) && !sSpellMgr->GetSpellInfo(SPELL_TELEPORT_SINGLE_IN_GROUP)) + return false; + return true; + } - return true; - } + void HandleScriptEffect(SpellEffIndex /* effIndex */) + { + if (Player* player = GetHitPlayer()) + { + if (Group* group = player->GetGroup()) + { + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + if (Player* member = itr->GetSource()) + if (member->IsWithinDistInMap(player, 20.0f) && !member->isDead()) + member->CastSpell(member, SPELL_TELEPORT_SINGLE_IN_GROUP, true); + } + else + player->CastSpell(player, SPELL_TELEPORT_SINGLE, true); + } + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_razelikh_teleport_group_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_razelikh_teleport_group_SpellScript(); + } }; void AddSC_blasted_lands() { new npc_deathly_usher(); + new spell_razelikh_teleport_group(); } diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index 2d7d2b3e8a9..9fd6ebd5d34 100644 --- a/src/server/scripts/Kalimdor/zone_azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -115,7 +115,7 @@ public: if (!UpdateVictim()) return; - // @todo add abilities for the different creatures + /// @todo add abilities for the different creatures DoMeleeAttackIfReady(); } }; |