diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedGossip.cpp | 31 | ||||
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedGossip.h | 13 |
2 files changed, 43 insertions, 1 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedGossip.cpp b/src/server/game/AI/ScriptedAI/ScriptedGossip.cpp new file mode 100644 index 00000000000..0c4d372dd66 --- /dev/null +++ b/src/server/game/AI/ScriptedAI/ScriptedGossip.cpp @@ -0,0 +1,31 @@ +/* +* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> +* +* 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/>. +*/ + +#include "ScriptedGossip.h" +#include "Player.h" +#include "Creature.h" + +void ClearGossipMenuFor(Player* player) { player->PlayerTalkClass->ClearMenus(); } +// Using provided text, not from DB +void AddGossipItemFor(Player* player, uint32 icon, const char* text, uint32 sender, uint32 action) { player->PlayerTalkClass->GetGossipMenu().AddMenuItem(-1, icon, text, sender, action, "", 0); } +// Using provided texts, not from DB +void AddGossipItemFor(Player* player, uint32 icon, const char* text, uint32 sender, uint32 action, const char* popupText, uint32 popupMoney, bool coded) { player->PlayerTalkClass->GetGossipMenu().AddMenuItem(-1, icon, text, sender, action, popupText, popupMoney, coded); } +// Uses gossip item info from DB +void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action) { player->PlayerTalkClass->GetGossipMenu().AddMenuItem(gossipMenuID, gossipMenuItemID, sender, action); } +void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const& guid) { player->PlayerTalkClass->SendGossipMenu(npcTextID, guid); } +void SendGossipMenuFor(Player* player, uint32 npcTextID, Creature const* creature) { if (creature) SendGossipMenuFor(player, npcTextID, creature->GetGUID()); } +void CloseGossipMenuFor(Player* player) { player->PlayerTalkClass->SendCloseGossip(); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedGossip.h b/src/server/game/AI/ScriptedAI/ScriptedGossip.h index 5b7e7f63373..82b1be50a41 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedGossip.h +++ b/src/server/game/AI/ScriptedAI/ScriptedGossip.h @@ -82,8 +82,19 @@ enum eTradeskill GOSSIP_SENDER_SEC_STABLEMASTER = 10 }; -// Defined fuctions to use with player. +class Creature; +void ClearGossipMenuFor(Player* player); +// Using provided text, not from DB +void AddGossipItemFor(Player* player, uint32 icon, const char* text, uint32 sender, uint32 action); +// Using provided texts, not from DB +void AddGossipItemFor(Player* player, uint32 icon, const char* text, uint32 sender, uint32 action, const char* popupText, uint32 popupMoney, bool coded); +// Uses gossip item info from DB +void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action); +void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const& guid); +void SendGossipMenuFor(Player* player, uint32 npcTextID, Creature const* creature); +void CloseGossipMenuFor(Player* player); +// Defined fuctions to use with player. // This fuction add's a menu item, // a - Icon Id // b - Text |