cmangos / issues

This repository is used as a centralized point for all issues regarding CMaNGOS.
179 stars 47 forks source link

Delete Unused Code "npc_innkeeper" in ScriptDev2 #778

Closed NeatElves closed 6 days ago

NeatElves commented 8 years ago
diff --git a/sql/scriptdev2/scriptdev2.sql b/sql/scriptdev2/scriptdev2.sql
index 7c96bcb..f8cfb18 100644
--- a/sql/scriptdev2/scriptdev2.sql
+++ b/sql/scriptdev2/scriptdev2.sql
@@ -171,9 +171,6 @@ UPDATE creature_template SET ScriptName='npc_doctor' WHERE entry IN (12939,12920
 UPDATE creature_template SET ScriptName='npc_injured_patient' WHERE entry IN (12936,12937,12938,12923,12924,12925);
 UPDATE creature_template SET ScriptName='npc_prof_blacksmith' WHERE entry IN (5164,11145,11146,11176,11177,11178,11191,11192,11193);
 UPDATE creature_template SET ScriptName='npc_prof_leather' WHERE entry IN (7866,7867,7868,7869,7870,7871);
--- disabled, but can be used for custom
--- UPDATE creature_template SET ScriptName='' WHERE npcflag!=npcflag|65536 AND ScriptName='npc_innkeeper';
--- UPDATE creature_template SET ScriptName='npc_innkeeper' WHERE npcflag=npcflag|65536;
 UPDATE creature_template SET ScriptName='npc_spring_rabbit' WHERE entry=32791;
 UPDATE creature_template SET ScriptName='npc_redemption_target' WHERE entry IN (6172,6177,17542,17768);

diff --git a/src/scriptdev2/scripts/world/npcs_special.cpp b/src/scriptdev2/scripts/world/npcs_special.cpp
index 2bf7580..217a8ea 100644
--- a/src/scriptdev2/scripts/world/npcs_special.cpp
+++ b/src/scriptdev2/scripts/world/npcs_special.cpp
@@ -36,7 +36,6 @@ npc_guardian            100%    guardianAI used to prevent players from accessin
 npc_garments_of_quests   80%    NPC's related to all Garments of-quests 5621, 5624, 5625, 5648, 5650
 npc_injured_patient     100%    patients for triage-quests (6622 and 6624)
 npc_doctor              100%    Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage)
-npc_innkeeper            25%    ScriptName not assigned. Innkeepers in general.
 npc_spring_rabbit         1%    Used for pet "Spring Rabbit" of Noblegarden
 npc_redemption_target   100%    Used for the paladin quests: 1779,1781,9600,9685
 EndContentData */
@@ -1013,67 +1012,6 @@ CreatureAI* GetAI_npc_guardian(Creature* pCreature)
     return new npc_guardianAI(pCreature);
 }

-/*########
-# npc_innkeeper
-#########*/
-
-// Script applied to all innkeepers by npcflag.
-// Are there any known innkeepers that does not hape the options in the below?
-// (remember gossipHello is not called unless npcflag|1 is present)
-
-enum
-{
-    TEXT_ID_WHAT_TO_DO              = 1853,
-
-    SPELL_TRICK_OR_TREAT            = 24751,                // create item or random buff
-    SPELL_TRICK_OR_TREATED          = 24755,                // buff player get when tricked or treated
-};
-
-#define GOSSIP_ITEM_TRICK_OR_TREAT  "Trick or Treat!"
-#define GOSSIP_ITEM_WHAT_TO_DO      "What can I do at an Inn?"
-
-bool GossipHello_npc_innkeeper(Player* pPlayer, Creature* pCreature)
-{
-    pPlayer->PrepareGossipMenu(pCreature, pPlayer->GetDefaultGossipMenuForSource(pCreature));
-
-    if (IsHolidayActive(HOLIDAY_HALLOWS_END) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED, EFFECT_INDEX_0))
-        pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRICK_OR_TREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
-    // Should only apply to innkeeper close to start areas.
-    if (AreaTableEntry const* pAreaEntry = GetAreaEntryByAreaID(pCreature->GetAreaId()))
-    {
-        if (pAreaEntry->flags & AREA_FLAG_LOWLEVEL)
-            pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_WHAT_TO_DO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-    }
-
-    pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetObjectGuid());
-    pPlayer->SendPreparedGossip(pCreature);
-    return true;
-}
-
-bool GossipSelect_npc_innkeeper(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
-    switch (uiAction)
-    {
-        case GOSSIP_ACTION_INFO_DEF+1:
-            pPlayer->SEND_GOSSIP_MENU(TEXT_ID_WHAT_TO_DO, pCreature->GetObjectGuid());
-            break;
-        case GOSSIP_ACTION_INFO_DEF+2:
-            pPlayer->CLOSE_GOSSIP_MENU();
-            pCreature->CastSpell(pPlayer, SPELL_TRICK_OR_TREAT, true);
-            break;
-        case GOSSIP_OPTION_VENDOR:
-            pPlayer->SEND_VENDORLIST(pCreature->GetObjectGuid());
-            break;
-        case GOSSIP_OPTION_INNKEEPER:
-            pPlayer->CLOSE_GOSSIP_MENU();
-            pPlayer->SetBindPoint(pCreature->GetObjectGuid());
-            break;
-    }
-
-    return true;
-}
-
 /*######
 ## npc_spring_rabbit
 ## ATTENTION: This is actually a "fun" script, entirely done without proper source!
@@ -1400,12 +1338,6 @@ void AddSC_npcs_special()
     pNewScript->RegisterSelf();

     pNewScript = new Script;
-    pNewScript->Name = "npc_innkeeper";
-    pNewScript->pGossipHello = &GossipHello_npc_innkeeper;
-    pNewScript->pGossipSelect = &GossipSelect_npc_innkeeper;
-    pNewScript->RegisterSelf(false);                        // script and error report disabled, but script can be used for custom needs, adding ScriptName
-
-    pNewScript = new Script;
     pNewScript->Name = "npc_spring_rabbit";
     pNewScript->GetAI = &GetAI_npc_spring_rabbit;
     pNewScript->RegisterSelf();
cyberium commented 7 years ago

@killerwife @Gr3zs @cala Is that code realy not used?

killerwife commented 7 years ago

Looking over the code, this is all now possible to do generically.

jimmybrancaccio commented 5 years ago

@cyberium @killerwife Is this still an issue or can we close this one out?

cala commented 5 years ago

Yes and no. The original reason for this script can now be handled in DB. However, there is a feature in Classic (currently missing) and related to innkeepers that might require to script their gossip via SD2.

I’m not sure for now, this needs to be investigated further.

killerwife commented 5 years ago

@cala you mean the instance queuing?

cala commented 5 years ago

@killerwife yes, the instance queueing that will need the meeting stone system mentionned here but also various lore and description gossips for every dungeon available at players level. This was a feature specific for Classic.

al3xc1985 commented 4 years ago

Is rhis srill viable for tbc? Or fixed in tbc @killerwife I can't see this on tests on LH