aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp1
-rw-r--r--src/server/scripts/Examples/example_creature.cpp21
-rw-r--r--src/server/scripts/Examples/example_escort.cpp37
-rw-r--r--src/server/scripts/Examples/example_gossip_codebox.cpp36
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp1
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp1
-rw-r--r--src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp1
-rw-r--r--src/server/scripts/Northrend/sholazar_basin.cpp1
9 files changed, 55 insertions, 45 deletions
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
index ea914ba5e4f..cd1053e0ada 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
@@ -140,6 +140,7 @@ class npc_lore_keeper_of_norgannon : public CreatureScript
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
+ pPlayer->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
index 79d6ce4e3a5..cf92445b6b2 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
@@ -159,6 +159,7 @@ class npc_zulaman_hostage : public CreatureScript
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
+ pPlayer->PlayerTalkClass->ClearMenus();
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
pPlayer->CLOSE_GOSSIP_MENU();
diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp
index 9f06ea93ea4..8f0efe25032 100644
--- a/src/server/scripts/Examples/example_creature.cpp
+++ b/src/server/scripts/Examples/example_creature.cpp
@@ -258,27 +258,28 @@ class example_creature : public CreatureScript
}
};
- CreatureAI* GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* pCreature) const
{
- return new example_creatureAI(creature);
+ return new example_creatureAI(pCreature);
}
- bool OnGossipHello(Player* player, Creature* creature)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(907, creature->GetGUID());
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
return true;
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
+ pPlayer->PlayerTalkClass->ClearMenus();
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
- player->CLOSE_GOSSIP_MENU();
+ pPlayer->CLOSE_GOSSIP_MENU();
//Set our faction to hostile towards all
- creature->setFaction(FACTION_WORGEN);
- creature->AI()->AttackStart(player);
+ pCreature->setFaction(FACTION_WORGEN);
+ pCreature->AI()->AttackStart(pPlayer);
}
return true;
diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp
index 1d771e2f85a..84001a1f5d7 100644
--- a/src/server/scripts/Examples/example_escort.cpp
+++ b/src/server/scripts/Examples/example_escort.cpp
@@ -178,48 +178,49 @@ class example_escort : public CreatureScript
}
};
- CreatureAI* GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* pCreature) const
{
- return new example_escortAI(creature);
+ return new example_escortAI(pCreature);
}
- bool OnGossipHello(Player* player, Creature* creature)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
- player->PrepareGossipMenu(creature, 0);
+ pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
+ pPlayer->PrepareGossipMenu(pCreature, 0);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SendPreparedGossip(creature);
+ pPlayer->SendPreparedGossip(pCreature);
return true;
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- npc_escortAI* pEscortAI = CAST_AI(example_escort::example_escortAI, creature->AI());
+ pPlayer->PlayerTalkClass->ClearMenus();
+ npc_escortAI* pEscortAI = CAST_AI(example_escort::example_escortAI, pCreature->AI());
- switch(action)
+ switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
- player->CLOSE_GOSSIP_MENU();
+ pPlayer->CLOSE_GOSSIP_MENU();
if (pEscortAI)
- pEscortAI->Start(true, true, player->GetGUID());
+ pEscortAI->Start(true, true, pPlayer->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
- player->CLOSE_GOSSIP_MENU();
+ pPlayer->CLOSE_GOSSIP_MENU();
if (pEscortAI)
- pEscortAI->Start(false, false, player->GetGUID());
+ pEscortAI->Start(false, false, pPlayer->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
- player->CLOSE_GOSSIP_MENU();
+ pPlayer->CLOSE_GOSSIP_MENU();
if (pEscortAI)
- pEscortAI->Start(false, true, player->GetGUID());
+ pEscortAI->Start(false, true, pPlayer->GetGUID());
break;
default:
return false; // nothing defined -> trinity core handling
diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp
index 117b206fc56..3727014c30c 100644
--- a/src/server/scripts/Examples/example_gossip_codebox.cpp
+++ b/src/server/scripts/Examples/example_gossip_codebox.cpp
@@ -48,45 +48,47 @@ class example_gossip_codebox : public CreatureScript
{
}
- bool OnGossipHello(Player* player, Creature* creature)
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->PlayerTalkClass->SendGossipMenu(907, creature->GetGUID());
+ pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
return true;
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
- if (action == GOSSIP_ACTION_INFO_DEF+2)
+ pPlayer->PlayerTalkClass->ClearMenus();
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
{
- DoScriptText(SAY_NOT_INTERESTED, creature);
- player->CLOSE_GOSSIP_MENU();
+ DoScriptText(SAY_NOT_INTERESTED, pCreature);
+ pPlayer->CLOSE_GOSSIP_MENU();
}
return true;
}
- bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code)
+ bool OnGossipSelectCode(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction, const char* code)
{
- if (sender == GOSSIP_SENDER_MAIN)
+ pPlayer->PlayerTalkClass->ClearMenus();
+ if (uiSender == GOSSIP_SENDER_MAIN)
{
- switch (action)
+ switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
- if (std::strcmp(code, player->GetName()) != 0)
+ if (std::strcmp(code, pPlayer->GetName()) != 0)
{
- DoScriptText(SAY_WRONG, creature);
- creature->CastSpell(player, SPELL_POLYMORPH, true);
+ DoScriptText(SAY_WRONG, pCreature);
+ pCreature->CastSpell(pPlayer, SPELL_POLYMORPH, true);
}
else
{
- DoScriptText(SAY_CORRECT, creature);
- creature->CastSpell(player, SPELL_MARK_OF_THE_WILD, true);
+ DoScriptText(SAY_CORRECT, pCreature);
+ pCreature->CastSpell(pPlayer, SPELL_MARK_OF_THE_WILD, true);
}
- player->CLOSE_GOSSIP_MENU();
+ pPlayer->CLOSE_GOSSIP_MENU();
return true;
}
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
index 2572e3fc020..acf0caa05a4 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
@@ -54,6 +54,7 @@ public:
bool OnGossipSelect (Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
+ pPlayer->PlayerTalkClass->ClearMenus();
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
{
pPlayer->CastSpell(pPlayer, SPELL_TEACHING_GOLDTHORN_TEA, true);
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
index dc1bb246a25..bbe9cf54a3f 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
@@ -151,6 +151,7 @@ class npc_announcer_toc10 : public CreatureScript
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
+ pPlayer->PlayerTalkClass->ClearMenus();
InstanceScript* m_pInstance;
m_pInstance = (InstanceScript*)pCreature->GetInstanceScript();
if (!m_pInstance) return false;
diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp
index ab2b41ac9b3..8e075f2ae7c 100644
--- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp
@@ -1278,6 +1278,7 @@ public:
//bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
//{
+ // pPlayer->PlayerTalkClass->ClearMenus();
// switch(uiAction)
// {
// case GOSSIP_ACTION_INFO_DEF+1:
diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp
index 759f2575293..1ef36684b25 100644
--- a/src/server/scripts/Northrend/sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/sholazar_basin.cpp
@@ -503,6 +503,7 @@ public:
bool OnGossipSelect(Player *pPlayer, Creature *pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
+ pPlayer->PlayerTalkClass->ClearMenus();
uint32 spellId = 0;
switch (uiAction)
{