TrinityCore
Loading...
Searching...
No Matches
ScriptedGossip.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#include "
ScriptedGossip.h
"
19
#include "
Creature.h
"
20
#include "
Player.h
"
21
22
uint32
GetGossipSenderFor
(
Player
* player,
uint32
menuId)
23
{
24
return
player->
PlayerTalkClass
->GetGossipOptionSender(menuId);
25
}
26
27
uint32
GetGossipActionFor
(
Player
* player,
uint32
gossipListId)
28
{
29
return
player->
PlayerTalkClass
->GetGossipOptionAction(gossipListId);
30
}
31
32
void
InitGossipMenuFor
(
Player
* player,
uint32
menuId)
33
{
34
player->
PlayerTalkClass
->GetGossipMenu().SetMenuId(menuId);
35
}
36
37
void
ClearGossipMenuFor
(
Player
* player)
38
{
39
player->
PlayerTalkClass
->ClearMenus();
40
}
41
42
// Using provided text, not from DB
43
void
AddGossipItemFor
(
Player
* player,
GossipOptionNpc
optionNpc, std::string text,
uint32
sender,
uint32
action)
44
{
45
player->
PlayerTalkClass
->GetGossipMenu().AddMenuItem(0, -1, optionNpc, std::move(text), 0,
GossipOptionFlags::None
, {}, 0, 0,
false
, 0,
""
, {}, {}, sender, action);
46
}
47
48
// Using provided texts, not from DB
49
void
AddGossipItemFor
(
Player
* player,
GossipOptionNpc
optionNpc, std::string text,
uint32
sender,
uint32
action, std::string popupText,
uint64
popupMoney,
bool
coded)
50
{
51
player->
PlayerTalkClass
->GetGossipMenu().AddMenuItem(0, -1, optionNpc, std::move(text), 0,
GossipOptionFlags::None
, {}, 0, 0, coded, popupMoney, std::move(popupText), {}, {}, sender, action);
52
}
53
54
// Uses gossip item info from DB
55
void
AddGossipItemFor
(
Player
* player,
uint32
gossipMenuID,
uint32
gossipMenuItemID,
uint32
sender,
uint32
action)
56
{
57
player->
PlayerTalkClass
->GetGossipMenu().AddMenuItem(gossipMenuID, gossipMenuItemID, sender, action);
58
}
59
60
void
SendGossipMenuFor
(
Player
* player,
uint32
npcTextID,
ObjectGuid
const
& guid)
61
{
62
player->
PlayerTalkClass
->SendGossipMenu(npcTextID, guid);
63
}
64
65
void
SendGossipMenuFor
(
Player
* player,
uint32
npcTextID,
Creature
const
* creature)
66
{
67
if
(creature)
68
SendGossipMenuFor
(player, npcTextID, creature->
GetGUID
());
69
}
70
71
void
CloseGossipMenuFor
(
Player
* player)
72
{
73
player->
PlayerTalkClass
->SendCloseGossip();
74
}
Creature.h
uint64
uint64_t uint64
Definition
Define.h:153
uint32
uint32_t uint32
Definition
Define.h:154
GossipOptionNpc
GossipOptionNpc
Definition
GossipDef.h:38
GossipOptionFlags::None
@ None
Player.h
GetGossipActionFor
uint32 GetGossipActionFor(Player *player, uint32 gossipListId)
Definition
ScriptedGossip.cpp:27
GetGossipSenderFor
uint32 GetGossipSenderFor(Player *player, uint32 menuId)
Definition
ScriptedGossip.cpp:22
AddGossipItemFor
void AddGossipItemFor(Player *player, GossipOptionNpc optionNpc, std::string text, uint32 sender, uint32 action)
Definition
ScriptedGossip.cpp:43
SendGossipMenuFor
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const &guid)
Definition
ScriptedGossip.cpp:60
ClearGossipMenuFor
void ClearGossipMenuFor(Player *player)
Definition
ScriptedGossip.cpp:37
InitGossipMenuFor
void InitGossipMenuFor(Player *player, uint32 menuId)
Definition
ScriptedGossip.cpp:32
CloseGossipMenuFor
void CloseGossipMenuFor(Player *player)
Definition
ScriptedGossip.cpp:71
ScriptedGossip.h
BaseEntity::GetGUID
ObjectGuid const & GetGUID() const
Definition
BaseEntity.h:163
Creature
Definition
Creature.h:82
ObjectGuid
Definition
ObjectGuid.h:308
Player
Definition
Player.h:1233
Player::PlayerTalkClass
std::unique_ptr< PlayerMenu > PlayerTalkClass
Definition
Player.h:2570
server
game
AI
ScriptedAI
ScriptedGossip.cpp
Generated on Sun May 10 2026 02:08:52 for TrinityCore by
1.9.8