* Fix some warlock talent work
[getmangos.git] / src / game / GossipDef.h
blobba5b360082d8b1c568933091fa641027a46e7c38
1 /*
2 * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef MANGOSSERVER_GOSSIP_H
20 #define MANGOSSERVER_GOSSIP_H
22 #include "Common.h"
23 #include "QuestDef.h"
24 #include "NPCHandler.h"
26 class WorldSession;
28 #define GOSSIP_MAX_MENU_ITEMS 64 // client supported items unknown, but provided number must be enough
29 #define DEFAULT_GOSSIP_MESSAGE 0xffffff
31 //POI defines
32 enum Poi_Icon
34 ICON_POI_0 = 0, // Grey ?
35 ICON_POI_1 = 1, // Red ?
36 ICON_POI_2 = 2, // Blue ?
37 ICON_POI_BWTOMB = 3, // Blue and White Tomb Stone
38 ICON_POI_HOUSE = 4, // House
39 ICON_POI_TOWER = 5, // Tower
40 ICON_POI_REDFLAG = 6, // Red Flag with Yellow !
41 ICON_POI_TOMB = 7, // Tomb Stone
42 ICON_POI_BWTOWER = 8, // Blue and White Tower
43 ICON_POI_REDTOWER = 9, // Red Tower
44 ICON_POI_BLUETOWER = 10, // Blue Tower
45 ICON_POI_RWTOWER = 11, // Red and White Tower
46 ICON_POI_REDTOMB = 12, // Red Tomb Stone
47 ICON_POI_RWTOMB = 13, // Red and White Tomb Stone
48 ICON_POI_BLUETOMB = 14, // Blue Tomb Stone
49 ICON_POI_NOTHING = 15, // NOTHING
50 ICON_POI_16 = 16, // Red ?
51 ICON_POI_17 = 17, // Grey ?
52 ICON_POI_18 = 18, // Blue ?
53 ICON_POI_19 = 19, // Red and White ?
54 ICON_POI_20 = 20, // Red ?
55 ICON_POI_GREYLOGS = 21, // Grey Wood Logs
56 ICON_POI_BWLOGS = 22, // Blue and White Wood Logs
57 ICON_POI_BLUELOGS = 23, // Blue Wood Logs
58 ICON_POI_RWLOGS = 24, // Red and White Wood Logs
59 ICON_POI_REDLOGS = 25, // Red Wood Logs
60 ICON_POI_26 = 26, // Grey ?
61 ICON_POI_27 = 27, // Blue and White ?
62 ICON_POI_28 = 28, // Blue ?
63 ICON_POI_29 = 29, // Red and White ?
64 ICON_POI_30 = 30, // Red ?
65 ICON_POI_GREYHOUSE = 31, // Grey House
66 ICON_POI_BWHOUSE = 32, // Blue and White House
67 ICON_POI_BLUEHOUSE = 33, // Blue House
68 ICON_POI_RWHOUSE = 34, // Red and White House
69 ICON_POI_REDHOUSE = 35, // Red House
70 ICON_POI_GREYHORSE = 36, // Grey Horse
71 ICON_POI_BWHORSE = 37, // Blue and White Horse
72 ICON_POI_BLUEHORSE = 38, // Blue Horse
73 ICON_POI_RWHORSE = 39, // Red and White Horse
74 ICON_POI_REDHORSE = 40 // Red Horse
77 struct GossipMenuItem
79 uint8 m_gIcon;
80 bool m_gCoded;
81 std::string m_gMessage;
82 uint32 m_gSender;
83 uint32 m_gAction;
84 std::string m_gBoxMessage;
85 uint32 m_gBoxMoney;
88 typedef std::vector<GossipMenuItem> GossipMenuItemList;
90 struct QuestMenuItem
92 uint32 m_qId;
93 uint8 m_qIcon;
96 typedef std::vector<QuestMenuItem> QuestMenuItemList;
98 class MANGOS_DLL_SPEC GossipMenu
100 public:
101 GossipMenu();
102 ~GossipMenu();
104 void AddMenuItem(uint8 Icon, std::string Message, bool Coded = false);
105 void AddMenuItem(uint8 Icon, std::string Message, uint32 dtSender, uint32 dtAction, std::string BoxMessage, uint32 BoxMoney, bool Coded = false);
107 // for using from scripts, don't must be inlined
108 void AddMenuItem(uint8 Icon, char const* Message, bool Coded = false);
109 void AddMenuItem(uint8 Icon, char const* Message, uint32 dtSender, uint32 dtAction, char const* BoxMessage, uint32 BoxMoney, bool Coded = false);
111 unsigned int MenuItemCount() const
113 return m_gItems.size();
116 bool Empty() const
118 return m_gItems.empty();
121 GossipMenuItem const& GetItem( unsigned int Id )
123 return m_gItems[ Id ];
126 uint32 MenuItemSender( unsigned int ItemId );
127 uint32 MenuItemAction( unsigned int ItemId );
128 bool MenuItemCoded( unsigned int ItemId );
130 void ClearMenu();
132 protected:
133 GossipMenuItemList m_gItems;
136 class QuestMenu
138 public:
139 QuestMenu();
140 ~QuestMenu();
142 void AddMenuItem( uint32 QuestId, uint8 Icon);
143 void ClearMenu();
145 uint8 MenuItemCount() const
147 return m_qItems.size();
150 bool Empty() const
152 return m_qItems.empty();
155 bool HasItem( uint32 questid );
157 QuestMenuItem const& GetItem( uint16 Id )
159 return m_qItems[ Id ];
162 protected:
163 QuestMenuItemList m_qItems;
166 class MANGOS_DLL_SPEC PlayerMenu
168 private:
169 GossipMenu mGossipMenu;
170 QuestMenu mQuestMenu;
171 WorldSession* pSession;
173 public:
174 PlayerMenu( WorldSession *Session );
175 ~PlayerMenu();
177 GossipMenu& GetGossipMenu() { return mGossipMenu; }
178 QuestMenu& GetQuestMenu() { return mQuestMenu; }
180 bool Empty() const { return mGossipMenu.Empty() && mQuestMenu.Empty(); }
182 void ClearMenus();
183 uint32 GossipOptionSender( unsigned int Selection );
184 uint32 GossipOptionAction( unsigned int Selection );
185 bool GossipOptionCoded( unsigned int Selection );
187 void SendGossipMenu( uint32 TitleTextId, uint64 npcGUID );
188 void CloseGossip();
189 void SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName );
190 void SendTalking( uint32 textID );
191 void SendTalking( char const * title, char const * text );
193 /*********************************************************/
194 /*** QUEST SYSTEM ***/
195 /*********************************************************/
196 void SendQuestGiverStatus( uint8 questStatus, uint64 npcGUID );
198 void SendQuestGiverQuestList( QEmote eEmote, std::string Title, uint64 npcGUID );
200 void SendQuestQueryResponse ( Quest const *pQuest );
201 void SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID, bool ActivateAccept);
203 void SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, bool EnbleNext );
204 void SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel );
206 #endif