root/trunk/src/game/GossipDef.h @ 37

Revision 37, 7.9 kB (checked in by yumileroy, 17 years ago)

[svn] * svn:eol-style native set on all files that need it

Original author: Neo2003
Date: 2008-10-11 14:16:25-05:00

Line 
1/*
2 * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
3 *
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.
8 *
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.
13 *
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
17 */
18
19#ifndef MANGOSSERVER_GOSSIP_H
20#define MANGOSSERVER_GOSSIP_H
21
22#include "Common.h"
23#include "QuestDef.h"
24#include "NPCHandler.h"
25
26class WorldSession;
27
28#define GOSSIP_MAX_MENU_ITEMS 64                            // client supported items unknown, but provided number must be enough
29#define DEFAULT_GOSSIP_MESSAGE              0xffffff
30
31//POI defines
32enum Poi_Icon
33{
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
75};
76
77struct GossipMenuItem
78{
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;
86};
87
88typedef std::vector<GossipMenuItem> GossipMenuItemList;
89
90struct QuestMenuItem
91{
92    uint32      m_qId;
93    uint8       m_qIcon;
94};
95
96typedef std::vector<QuestMenuItem> QuestMenuItemList;
97
98class MANGOS_DLL_SPEC GossipMenu
99{
100    public:
101        GossipMenu();
102        ~GossipMenu();
103
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);
106
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);
110
111        unsigned int MenuItemCount() const
112        {
113            return m_gItems.size();
114        }
115
116        bool Empty() const
117        {
118            return m_gItems.empty();
119        }
120
121        GossipMenuItem const& GetItem( unsigned int Id )
122        {
123            return m_gItems[ Id ];
124        }
125
126        uint32 MenuItemSender( unsigned int ItemId );
127        uint32 MenuItemAction( unsigned int ItemId );
128        bool MenuItemCoded( unsigned int ItemId );
129
130        void ClearMenu();
131
132    protected:
133        GossipMenuItemList m_gItems;
134};
135
136class QuestMenu
137{
138    public:
139        QuestMenu();
140        ~QuestMenu();
141
142        void AddMenuItem( uint32 QuestId, uint8 Icon);
143        void ClearMenu();
144
145        uint8 MenuItemCount() const
146        {
147            return m_qItems.size();
148        }
149
150        bool Empty() const
151        {
152            return m_qItems.empty();
153        }
154
155        bool HasItem( uint32 questid );
156
157        QuestMenuItem const& GetItem( uint16 Id )
158        {
159            return m_qItems[ Id ];
160        }
161
162    protected:
163        QuestMenuItemList m_qItems;
164};
165
166class MANGOS_DLL_SPEC PlayerMenu
167{
168    private:
169        GossipMenu mGossipMenu;
170        QuestMenu  mQuestMenu;
171        WorldSession* pSession;
172
173    public:
174        PlayerMenu( WorldSession *Session );
175        ~PlayerMenu();
176
177        GossipMenu& GetGossipMenu() { return mGossipMenu; }
178        QuestMenu& GetQuestMenu() { return mQuestMenu; }
179
180        bool Empty() const { return mGossipMenu.Empty() && mQuestMenu.Empty(); }
181
182        void ClearMenus();
183        uint32 GossipOptionSender( unsigned int Selection );
184        uint32 GossipOptionAction( unsigned int Selection );
185        bool GossipOptionCoded( unsigned int Selection );
186
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 );
192
193        /*********************************************************/
194        /***                    QUEST SYSTEM                   ***/
195        /*********************************************************/
196        void SendQuestGiverStatus( uint8 questStatus, uint64 npcGUID );
197
198        void SendQuestGiverQuestList( QEmote eEmote, std::string Title, uint64 npcGUID );
199
200        void SendQuestQueryResponse ( Quest const *pQuest );
201        void SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID, bool ActivateAccept);
202
203        void SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, bool EnbleNext );
204        void SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel );
205};
206#endif
Note: See TracBrowser for help on using the browser.