Scripts/World: Dropped deprecated npc_innkeeper script

* costume stuff should be handled by candy buckets
This commit is contained in:
ModoX
2023-10-22 13:38:07 +02:00
parent 9eceff2bc2
commit b2393d6ade
3 changed files with 5 additions and 132 deletions

View File

@@ -0,0 +1,5 @@
--
UPDATE `creature_template` SET `ScriptName`='' WHERE `ScriptName`='npc_innkeeper';
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN(344,348,349,441,1290,1293,1294,1296,1297,1581,6525,6620,7173,7288,7301,7324,7468,7481,7855,9123) AND `SourceEntry` IN(0, 2);
DELETE FROM `gossip_menu_option` WHERE (`MenuID`=344 AND `OptionID` IN(2, 3)) OR (`MenuID`=348 AND `OptionID`=2) OR (`MenuID`=349 AND `OptionID` IN(2, 3)) OR (`MenuID`=441 AND `OptionID` IN(2, 4)) OR (`MenuID`=6620 AND `OptionID`=2) OR (`MenuID`=7173 AND `OptionID` IN(2, 3)) OR (`MenuID`=7288 AND `OptionID` IN(2, 3)) OR (`MenuID`=7301 AND `OptionID`=2) OR (`MenuID`=7324 AND `OptionID`=2) OR (`MenuID`=7481 AND `OptionID`=2) OR (`MenuID`=7855 AND `OptionID`=2) OR (`MenuID`=9123 AND `OptionID` IN(2, 3));

View File

@@ -1,130 +0,0 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Npc_Innkeeper
SDAuthor: WarHead
SD%Complete: 99%
SDComment: Complete
SDCategory: NPCs
EndScriptData */
#include "ScriptMgr.h"
#include "GameEventMgr.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "WorldSession.h"
enum Spells
{
SPELL_TRICK_OR_TREATED = 24755,
SPELL_TREAT = 24715
};
enum Npc
{
NPC_GOSSIP_MENU = 9733,
NPC_GOSSIP_MENU_EVENT = 342,
};
class npc_innkeeper : public CreatureScript
{
public:
npc_innkeeper() : CreatureScript("npc_innkeeper") { }
struct npc_innkeeperAI : public ScriptedAI
{
npc_innkeeperAI(Creature* creature) : ScriptedAI(creature) { }
bool OnGossipHello(Player* player) override
{
InitGossipMenuFor(player, NPC_GOSSIP_MENU);
if (IsHolidayActive(HOLIDAY_HALLOWS_END) && !player->HasAura(SPELL_TRICK_OR_TREATED))
AddGossipItemFor(player, NPC_GOSSIP_MENU_EVENT, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
if (me->IsQuestGiver())
player->PrepareQuestMenu(me->GetGUID());
if (me->IsVendor())
AddGossipItemFor(player, NPC_GOSSIP_MENU, 2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
if (me->IsInnkeeper())
AddGossipItemFor(player, NPC_GOSSIP_MENU, 1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INN);
player->TalkedToCreature(me->GetEntry(), me->GetGUID());
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
{
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
ClearGossipMenuFor(player);
if (action == GOSSIP_ACTION_INFO_DEF + 1 && IsHolidayActive(HOLIDAY_HALLOWS_END) && !player->HasAura(SPELL_TRICK_OR_TREATED))
{
player->CastSpell(player, SPELL_TRICK_OR_TREATED, true);
if (urand(0, 1))
player->CastSpell(player, SPELL_TREAT, true);
else
{
uint32 trickspell = 0;
switch (urand(0, 13))
{
case 0: trickspell = 24753; break; // cannot cast, random 30sec
case 1: trickspell = 24713; break; // lepper gnome costume
case 2: trickspell = 24735; break; // male ghost costume
case 3: trickspell = 24736; break; // female ghostcostume
case 4: trickspell = 24710; break; // male ninja costume
case 5: trickspell = 24711; break; // female ninja costume
case 6: trickspell = 24708; break; // male pirate costume
case 7: trickspell = 24709; break; // female pirate costume
case 8: trickspell = 24723; break; // skeleton costume
case 9: trickspell = 24753; break; // Trick
case 10: trickspell = 24924; break; // Hallow's End Candy
case 11: trickspell = 24925; break; // Hallow's End Candy
case 12: trickspell = 24926; break; // Hallow's End Candy
case 13: trickspell = 24927; break; // Hallow's End Candy
}
player->CastSpell(player, trickspell, true);
}
CloseGossipMenuFor(player);
return true;
}
CloseGossipMenuFor(player);
switch (action)
{
case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(me->GetGUID()); break;
case GOSSIP_ACTION_INN: player->SetBindPoint(me->GetGUID()); break;
}
return true;
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_innkeeperAI(creature);
}
};
void AddSC_npc_innkeeper()
{
new npc_innkeeper();
}

View File

@@ -26,7 +26,6 @@ void AddSC_go_scripts();
void AddSC_npc_guard();
void AddSC_item_scripts();
void AddSC_npc_professions();
void AddSC_npc_innkeeper();
void AddSC_npcs_special();
void AddSC_achievement_scripts();
void AddSC_action_ip_logger();
@@ -47,7 +46,6 @@ void AddWorldScripts()
AddSC_npc_guard();
AddSC_item_scripts();
AddSC_npc_professions();
AddSC_npc_innkeeper();
AddSC_npcs_special();
AddSC_achievement_scripts();
AddSC_chat_log(); // location: scripts\World\chat_log.cpp