diff options
-rw-r--r-- | src/server/scripts/Custom/npc_acherus_taxi.cpp | 44 | ||||
-rw-r--r-- | src/server/scripts/Custom/npc_wyrmresttempel_taxi.cpp | 122 |
2 files changed, 75 insertions, 91 deletions
diff --git a/src/server/scripts/Custom/npc_acherus_taxi.cpp b/src/server/scripts/Custom/npc_acherus_taxi.cpp index dff5165ce70..86530ac2094 100644 --- a/src/server/scripts/Custom/npc_acherus_taxi.cpp +++ b/src/server/scripts/Custom/npc_acherus_taxi.cpp @@ -20,33 +20,33 @@ #define GOSSIP_FLIGHT "I need a ride" -bool GossipHello_npc_acherus_taxi(Player *pPlayer, Creature *pCreature) +class npc_acherus_taxi : public CreatureScript { - pPlayer->SetTaxiCheater(true); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(9978, pCreature->GetGUID()); - return true; -} +public: + npc_acherus_taxi() : CreatureScript("npc_acherus_taxi") { } -bool GossipSelect_npc_acherus_taxi(Player *pPlayer, Creature * /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + bool OnGossipHello(Player *pPlayer, Creature *pCreature) { - if (pPlayer->GetPositionZ() >= 316) - pPlayer->GetSession()->SendDoFlight(24446, 1053); - else - pPlayer->GetSession()->SendDoFlight(24446, 1054); + pPlayer->SetTaxiCheater(true); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(9978, pCreature->GetGUID()); + return true; } - return true; -} + + bool OnGossipSelect(Player *pPlayer, Creature * /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) + { + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + if (pPlayer->GetPositionZ() >= 316) + pPlayer->GetSession()->SendDoFlight(24446, 1053); + else + pPlayer->GetSession()->SendDoFlight(24446, 1054); + } + return true; + } +}; void AddSC_npc_acherus_taxi() { - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_acherus_taxi"; - newscript->pGossipHello = &GossipHello_npc_acherus_taxi; - newscript->pGossipSelect = &GossipSelect_npc_acherus_taxi; - newscript->RegisterSelf(); + new npc_acherus_taxi; } diff --git a/src/server/scripts/Custom/npc_wyrmresttempel_taxi.cpp b/src/server/scripts/Custom/npc_wyrmresttempel_taxi.cpp index cec34365c67..ac72117da1a 100644 --- a/src/server/scripts/Custom/npc_wyrmresttempel_taxi.cpp +++ b/src/server/scripts/Custom/npc_wyrmresttempel_taxi.cpp @@ -25,105 +25,89 @@ #define GOSSIP_BOTTOM "Yes, Please. I would like to return to the ground floor of the temple." #define GOSSIP_ONEDOWN "I would like to see Lord Afrasastrasz, in the middle of the temple." -bool GossipHello_npc_wyrmresttempel_middle_taxi(Player* pPlayer, Creature* pCreature) +class npc_wyrmrest_temple_middle_taxi : public CreatureScript { -pPlayer->SetTaxiCheater(true); +public: + npc_wyrmrest_temple_middle_taxi() : CreatureScript("npc_wyrmresttempelmiddle_taxi") { } -pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); -pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(12887, pCreature->GetGUID()); + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + pPlayer->SetTaxiCheater(true); - return true; -} + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(12887, pCreature->GetGUID()); -bool GossipSelect_npc_wyrmresttempel_middle_taxi(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pPlayer->GetSession()->SendDoFlight(6376, 881); + return true; } - if (uiAction == GOSSIP_ACTION_INFO_DEF + 2) + bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) { - pPlayer->GetSession()->SendDoFlight(6376, 882); + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->GetSession()->SendDoFlight(6376, 881); + if (uiAction == GOSSIP_ACTION_INFO_DEF + 2) + pPlayer->GetSession()->SendDoFlight(6376, 882); + + return true; } -return true; -} +}; -bool GossipHello_npc_wyrmresttempel_bottom_taxi(Player* pPlayer, Creature* pCreature) +class npc_wyrmrest_temple_bottom_taxi : public CreatureScript { -pPlayer->SetTaxiCheater(true); +public: + npc_wyrmrest_temple_bottom_taxi() : CreatureScript("npc_wyrmresttempelbottom_taxi") { } + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + pPlayer->SetTaxiCheater(true); -pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TOP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); -pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MIDDLE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TOP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MIDDLE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); pPlayer->SEND_GOSSIP_MENU(12713, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_wyrmresttempel_bottom_taxi(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 4) - { - pPlayer->GetSession()->SendDoFlight(6376, 878); + return true; } - if (uiAction == GOSSIP_ACTION_INFO_DEF + 3) + bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) { - pPlayer->GetSession()->SendDoFlight(6376, 883); + if (uiAction == GOSSIP_ACTION_INFO_DEF + 4) + pPlayer->GetSession()->SendDoFlight(6376, 878); + if (uiAction == GOSSIP_ACTION_INFO_DEF + 3) + pPlayer->GetSession()->SendDoFlight(6376, 883); + return true; } -return true; -} +}; -bool GossipHello_npc_wyrmresttempel_top_taxi(Player* pPlayer, Creature* pCreature) +class npc_wyrmrest_temple_top_taxi : public CreatureScript { -pPlayer->SetTaxiCheater(true); +public: + npc_wyrmrest_temple_top_taxi() : CreatureScript("npc_wyrmresttempeltop_taxi") { } + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + pPlayer->SetTaxiCheater(true); -pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BOTTOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); -pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ONEDOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BOTTOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ONEDOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); pPlayer->SEND_GOSSIP_MENU(12714, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_wyrmresttempel_top_taxi(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 5) - { - pPlayer->GetSession()->SendDoFlight(6376, 879); + return true; } - if (uiAction == GOSSIP_ACTION_INFO_DEF + 6) - + bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) { - pPlayer->GetSession()->SendDoFlight(6376, 880); + if (uiAction == GOSSIP_ACTION_INFO_DEF + 5) + pPlayer->GetSession()->SendDoFlight(6376, 879); + if (uiAction == GOSSIP_ACTION_INFO_DEF + 6) + pPlayer->GetSession()->SendDoFlight(6376, 880); + return true; } -return true; -} +}; void AddSC_npc_wyrmresttempel_taxi() { - Script *newscript; - -newscript = new Script; -newscript->Name = "npc_wyrmresttempelmiddle_taxi"; -newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_middle_taxi; -newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_middle_taxi; -newscript->RegisterSelf(); - -newscript = new Script; -newscript->Name = "npc_wyrmresttempelbottom_taxi"; -newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_bottom_taxi; -newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_bottom_taxi; -newscript->RegisterSelf(); - -newscript = new Script; -newscript->Name = "npc_wyrmresttempeltop_taxi"; -newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_top_taxi; -newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_top_taxi; -newscript->RegisterSelf(); - + new npc_wyrmrest_temple_middle_taxi; + new npc_wyrmrest_temple_bottom_taxi; + new npc_wyrmrest_temple_top_taxi; } |