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

Revision 2, 7.7 kB (checked in by yumileroy, 17 years ago)

[svn] * Proper SVN structure

Original author: Neo2003
Date: 2008-10-02 16:23:55-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()
112        {
113            return m_gItems.size();
114        }
115
116        GossipMenuItem const& GetItem( unsigned int Id )
117        {
118            return m_gItems[ Id ];
119        }
120
121        uint32 MenuItemSender( unsigned int ItemId );
122        uint32 MenuItemAction( unsigned int ItemId );
123        bool MenuItemCoded( unsigned int ItemId );
124
125        void ClearMenu();
126
127    protected:
128        GossipMenuItemList m_gItems;
129};
130
131class QuestMenu
132{
133    public:
134        QuestMenu();
135        ~QuestMenu();
136
137        void AddMenuItem( uint32 QuestId, uint8 Icon);
138        void ClearMenu();
139
140        uint8 MenuItemCount()
141        {
142            return m_qItems.size();
143        }
144        bool HasItem( uint32 questid );
145
146        QuestMenuItem const& GetItem( uint16 Id )
147        {
148            return m_qItems[ Id ];
149        }
150
151    protected:
152        QuestMenuItemList m_qItems;
153};
154
155class MANGOS_DLL_SPEC PlayerMenu
156{
157    private:
158        GossipMenu* pGossipMenu;
159        QuestMenu* pQuestMenu;
160        WorldSession* pSession;
161
162    public:
163        PlayerMenu( WorldSession *Session );
164        ~PlayerMenu();
165
166        GossipMenu* GetGossipMenu() { return pGossipMenu; }
167        QuestMenu* GetQuestMenu() { return pQuestMenu; }
168
169        void ClearMenus();
170        uint32 GossipOptionSender( unsigned int Selection );
171        uint32 GossipOptionAction( unsigned int Selection );
172        bool GossipOptionCoded( unsigned int Selection );
173
174        void SendGossipMenu( uint32 TitleTextId, uint64 npcGUID );
175        void CloseGossip();
176        void SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName );
177        void SendTalking( uint32 textID );
178        void SendTalking( char const * title, char const * text );
179
180        /*********************************************************/
181        /***                    QUEST SYSTEM                   ***/
182        /*********************************************************/
183        void SendQuestGiverStatus( uint8 questStatus, uint64 npcGUID );
184
185        void SendQuestGiverQuestList( QEmote eEmote, std::string Title, uint64 npcGUID );
186
187        void SendQuestQueryResponse ( Quest const *pQuest );
188        void SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID, bool ActivateAccept);
189
190        void SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, bool EnbleNext );
191        void SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel );
192};
193#endif
Note: See TracBrowser for help on using the browser.