Automatic Halloween start and ending + localisation support for inkeepers
Index: Gossip_Innkeepers.cpp
===================================================================
--- Gossip_Innkeepers.cpp (revision 4678)
+++ Gossip_Innkeepers.cpp (working copy)
@@ -19,8 +19,6 @@
#include "Setup.h"
-// Event of Hallowen control
-//#define EVENT_HALLOWEEN // Decomment this for enable the event on Innkeepers
#define SPELL_TRICK_OR_TREATED 24755
#define SPELL_TREAT 24715
@@ -49,16 +47,20 @@
}
Arcemu::Gossip::Menu menu(pCreature->GetGUID(), TextID, 0);
-#ifdef EVENT_HALLOWEEN
+// Halloween control
+ tm * ct = localtime(&UNIXTIME);
+ if( ct->tm_mon == 9 && ( ct->tm_mday > 17 && ct->tm_mday <= 31 ) )
+{
if(!Plr->HasAura(SPELL_TRICK_OR_TREATED))
- menu.AddItem(Arcemu::Gossip::ICON_CHAT, "Trick or Treat!", 4);
-#endif
+ menu.AddItem(Arcemu::Gossip::ICON_CHAT, Plr->GetSession()->LocalizedWorldSrv(Arcemu::Gossip::TRICKORTREAT), 4);
+ }
+// End of Halloween control
if(pCreature->isVendor())
menu.AddItem(Arcemu::Gossip::ICON_VENDOR, Plr->GetSession()->LocalizedWorldSrv(Arcemu::Gossip::VENDOR), 1);
menu.AddItem(Arcemu::Gossip::ICON_CHAT, Plr->GetSession()->LocalizedWorldSrv(Arcemu::Gossip::INNKEEPER), 2);
- menu.AddItem(Arcemu::Gossip::ICON_CHAT, "What can I do at an inn?", 3);
+ menu.AddItem(Arcemu::Gossip::ICON_CHAT, Plr->GetSession()->LocalizedWorldSrv(Arcemu::Gossip::INNKEEPERASK), 3);
sQuestMgr.FillQuestMenu(pCreature, Plr, menu);
Index: Gossip.h
===================================================================
--- Gossip.h (revision 4678)
+++ Gossip.h (working copy)
@@ -64,6 +64,8 @@
CLASSTRAINER_TALENTCONFIRM,
PETTRAINER_TALENTCONFIRM,
DEATHKNIGHT = 82,
+ INNKEEPERASK = 83,
+ TRICKORTREAT = 84,
TXTID_TALENTRESET = 5674,
TXTID_PETUNTRAIN = 7722,
TXTID_DUALSPECPURCHASE = 14136 //this is not correct.
INSERT INTO `worldstring_tables` VALUES ('83', 'What can I do at an inn?');
INSERT INTO `worldstring_tables` VALUES ('84', 'Trick or Treat!');