root/trunk/src/arcemu-world/Map.h @ 2860

Revision 2860, 4.3 kB (checked in by Vlack, 12 months ago)

Notice: Trunk is now 3.2.0

FIXED: Mail sending (by providing a missing item for the world database, this item is necessary for the client - for the item, thanks goes to Darkgrööm)
FIXED: Battleground selection crash (now the server will queue you on Isle of Conquest - note: this does not mean you can play on it, but it solves the instant crash when players selected it)
FIXED: Glyphs (till we properly implement dual spec)
FIXED: A9 target GUID sending (on flags & UPDATEFLAG_HAS_TARGET - thanks Alleycat)
FIXED: Re-enabled ground targeted spells (on m_targetMask & TARGET_FLAG_DEST_LOCATION - if a spell where you can select the area of its effect crashes the client in the future, we'll revise this part)
FIXED: A9 (actually just moved the already existing code pieces up/down to better suit the required format, but to know the format right, I had looked into Mangos code too, as I haven't got months to figure out the right structure)
FIXED: TaxiMgr::GetGlobalTaxiNodeMask? (index check, as with the new DBCs we have a "to" with value "-1", and when that's used as an uint, it'll result in an index of 255, while the structure is from 0 to 11).
ADDED: Override support (this extends the core with special features for special gameobjects, like what's required for trams and transports, which include features as: "override update fields", "never despawn on same map", "announce on greater range" and "push to player on map entry").
FIXED: static map object pushing (repaired the buffer handling error which duplicated buffer content in a pretty unique way).
ADDED: SQL fixes for Deeprun and Ulduar Trams (retail data, but it works right only with the override system).
UPDATED: UpdateFields?.h
UPDATED: DBCs (thanks Xuni)
UPDATED: Error codes (thanks Hopla)
FIXED: various packets, especially the following ones: character enumeration, mail list, group details (raid difficulty), movement-related packets
FIXED: The display of quest rewards the player can choose from on the quest page before accepting it.
FIXED: A nasty bug when un-equipping an item to a bag and not to the backpack. The problem was that I have missed 2 for loops where the visible items get nulled out on unequip, it erased 17 fields instead of just 2, so it made the character pretty much naked.

  • Property svn:eol-style set to native
  • Property ff set to
    *.cpp = svn:eol-style=native
    Makefile = svn:eol-style=native
    README = svn:eol-style=native
    CHANGELOG = svn:eol-style=native
    LICENSE = svn:eol-style=native
Line 
1/*
2 * ArcEmu MMORPG Server
3 * Copyright (C) 2005-2007 Ascent Team <http://www.ascentemu.com/>
4 * Copyright (C) 2008-2009 <http://www.ArcEmu.org/>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21//
22// Map.h
23//
24
25#ifndef __MAP_H
26#define __MAP_H
27
28class MapMgr;
29class TemplateMgr;
30struct MapInfo;
31class TerrainMgr;
32
33#include "TerrainMgr.h"
34
35struct Formation;
36
37typedef struct
38{
39        uint32  id;//spawn ID
40        uint32  entry;
41        float   x;
42        float   y;
43        float   z;
44        float   o;
45        Formation* form;
46        uint8 movetype;
47        uint32 displayid;
48        uint32 factionid;
49        uint32 flags;
50        uint32 bytes0;
51        uint32 bytes1;
52        uint32 bytes2;
53        uint32 emote_state;
54        //uint32 respawnNpcLink;
55        uint16 channel_spell;
56        uint32 channel_target_go;
57        uint32 channel_target_creature;
58        uint16 stand_state;
59        uint32 MountedDisplayID;
60        uint32 Item1SlotDisplay;
61        uint32 Item2SlotDisplay;
62        uint32 Item3SlotDisplay;
63        uint32 CanFly;
64        uint32 phase;
65
66        /* sets one of the bytes of an uint32 */
67        uint32 setbyte(uint32 buffer, uint8 index, uint32 byte){
68   
69        /* We don't want a segfault, now do we? */
70        if(index >= 4)
71          return buffer;
72 
73        byte = byte << index*8;
74        buffer = buffer | byte;
75       
76        return buffer;
77        }
78}CreatureSpawn;
79
80typedef struct
81{
82        uint32  id;//spawn ID
83        uint32  entry;
84        float   x;
85        float   y;
86        float   z;
87        float   o;
88        float   o1;
89        float   o2;
90        float   o3;
91        float   facing;
92        uint32  flags;
93        uint32  state;
94        uint32  faction;
95        //uint32 level;
96        float scale;
97        //uint32 stateNpcLink;
98        uint32 phase;
99        uint32 overrides;
100} GOSpawn;
101
102typedef std::vector<CreatureSpawn*> CreatureSpawnList;
103typedef std::vector<GOSpawn*> GOSpawnList;
104
105typedef struct
106{
107        CreatureSpawnList CreatureSpawns;
108        GOSpawnList GOSpawns;
109}CellSpawns;
110
111class SERVER_DECL Map
112{
113public:
114        Map(uint32 mapid, MapInfo * inf);
115        ~Map();
116
117        ARCEMU_INLINE string GetNameString() { return name; }
118        ARCEMU_INLINE const char* GetName() { return name.c_str(); }
119        ARCEMU_INLINE MapEntry* GetDBCEntry() { return me; }
120
121        ARCEMU_INLINE CellSpawns *GetSpawnsList(uint32 cellx,uint32 celly)
122        {
123                ASSERT(cellx < _sizeX);
124                ASSERT(celly < _sizeY);
125                if(spawns[cellx]==NULL) return NULL;
126
127                return spawns[cellx][celly];
128        }
129        ARCEMU_INLINE CellSpawns * GetSpawnsListAndCreate(uint32 cellx, uint32 celly)
130        {
131                ASSERT(cellx < _sizeX);
132                ASSERT(celly < _sizeY);
133                if(spawns[cellx]==NULL)
134                {
135                        spawns[cellx] = new CellSpawns*[_sizeY];
136                        memset(spawns[cellx],0,sizeof(CellSpawns*)*_sizeY);
137                }
138
139                if(spawns[cellx][celly] == 0)
140                        spawns[cellx][celly] = new CellSpawns;
141                return spawns[cellx][celly];
142        }
143
144        void LoadSpawns(bool reload);//set to true to make clean up
145        uint32 CreatureSpawnCount;
146        uint32 GameObjectSpawnCount;
147
148        ARCEMU_INLINE float  GetLandHeight(float x, float y)
149        { 
150                if(_terrain)
151                {
152                        return _terrain->GetLandHeight(x, y);
153                }
154                else
155                {
156                        return 999999.0f;
157                }
158        }
159
160        ARCEMU_INLINE float  GetWaterHeight(float x, float y) 
161        { 
162                if(_terrain)
163                { 
164                        return _terrain->GetWaterHeight(x, y); 
165                }
166                else
167                { 
168                        return 999999.0f; 
169                }
170        }
171
172        ARCEMU_INLINE uint8  GetWaterType(float x, float y)
173        {
174                if(_terrain)
175                { 
176                        return _terrain->GetWaterType(x, y);
177                }
178                else
179                { 
180                        return 0;
181                }
182        }
183
184        ARCEMU_INLINE uint8  GetWalkableState(float x, float y)
185        {
186                if(_terrain)
187                { 
188                        return _terrain->GetWalkableState(x, y);
189                }
190                else
191                { 
192                        return 1; 
193                }
194        }
195
196        ARCEMU_INLINE uint16 GetAreaID(float x, float y)
197        {
198                if(_terrain)
199                { 
200                        return _terrain->GetAreaID(x, y);
201                }
202                else
203                { 
204                        return 0xFFFF;
205                }
206        }
207
208        ARCEMU_INLINE void CellGoneActive(uint32 x, uint32 y)
209        { 
210                if(_terrain)
211                { 
212                        _terrain->CellGoneActive(x,y);
213                }
214        }
215
216        ARCEMU_INLINE void CellGoneIdle(uint32 x,uint32 y)
217        { 
218                if(_terrain)
219                { 
220                        _terrain->CellGoneIdle(x,y);
221                }
222        }
223
224private:
225        MapInfo *          _mapInfo;
226        TerrainMgr*      _terrain;
227        uint32 _mapId;
228        string name;
229        MapEntry * me;
230
231        //new stuff
232        CellSpawns **spawns[_sizeX];
233public:
234        CellSpawns staticSpawns;
235};
236
237#endif
Note: See TracBrowser for help on using the browser.