UpdateMask.h
资源名称:wow.rar [点击查看]
上传用户:jxpjxmjjw
上传日期:2009-12-07
资源大小:5877k
文件大小:14k
源码类别:
模拟服务器
开发平台:
Visual C++
- // Copyright (C) 2004 Team Python
- //
- // This program is free software; you can redistribute it and/or modify
- // it under the terms of the GNU General Public License as published by
- // the Free Software Foundation; either version 2 of the License, or
- // (at your option) any later version.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program; if not, write to the Free Software
- // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- #ifndef WOWPYTHONSERVER_UPDATEMASKS_H
- #define WOWPYTHONSERVER_UPDATEMASKS_H
- #define UPDATE_BLOCKS 864
- #define UNIT_BLOCKS 5
- #define PLAYER_BLOCKS 27
- // List of Indices
- // Commented out fields basically are just placeholders showing how many bits between good Index enums
- enum ObjectUpdateFields {
- OBJECT_START = 0,
- OBJECT_FIELD_GUID = 0 + OBJECT_START,
- OBJECT_FIELD_TYPE = 2 + OBJECT_START,
- OBJECT_FIELD_ENTRY = 3 + OBJECT_START,
- OBJECT_FIELD_SCALE_X = 4 + OBJECT_START,
- OBJECT_FIELD_PADDING = 5 + OBJECT_START,
- OBJECT_END = 6 + OBJECT_START,
- };
- enum ItemUpdateFields {
- ITEM_START = OBJECT_END,
- ITEM_FIELD_OWNER = 0x00 + ITEM_START,
- ITEM_FIELD_CONTAINED = 0x02 + ITEM_START,
- ITEM_FIELD_CREATOR = 0x04 + ITEM_START,
- ITEM_FIELD_GIFTCREATOR = 0x06 + ITEM_START,
- ITEM_FIELD_STACK_COUNT = 0x08 + ITEM_START,
- ITEM_FIELD_DURATION = 0x09 + ITEM_START,
- ITEM_FIELD_SPELL_CHARGES = 0x0A + ITEM_START,
- ITEM_FIELD_FLAGS = 0x0F + ITEM_START,
- ITEM_FIELD_ENCHANTMENT = 0x10 + ITEM_START,
- ITEM_FIELD_PROPERTY_SEED = 0x25 + ITEM_START,
- ITEM_FIELD_RANDOM_PROPERTIES_ID = 0x26 + ITEM_START,
- ITEM_FIELD_ITEM_TEXT_ID = 0x27 + ITEM_START,
- ITEM_DURABILITY = 0x28 + ITEM_START,
- ITEM_MAXDURABILITY = 0x29 + ITEM_START,
- ITEM_END = 0x2A + ITEM_START,
- };
- enum ContainerUpdateFields {
- CONTAINER_START = ITEM_END,
- CONTAINER_FIELD_NUM_SLOTS = 0x00 + CONTAINER_START,
- CONTAINER_ALIGN_PAD = 0x01 + CONTAINER_START,
- CONTAINER_FIELD_SLOT_1 = 0x02 + CONTAINER_START,
- CONTAINER_END = 0x2A + CONTAINER_START,
- };
- enum UnitUpdateFields {
- UNIT_START = OBJECT_END,
- UNIT_FIELD_CHARM = 0x00 + UNIT_START, //2
- UNIT_FIELD_SUMMON = 0x02 + UNIT_START, //2
- UNIT_FIELD_CHARMEDBY = 0x04 + UNIT_START, //2
- UNIT_FIELD_SUMMONEDBY = 0x06 + UNIT_START, //2
- UNIT_FIELD_CREATEDBY = 0x08 + UNIT_START, //2
- UNIT_FIELD_TARGET = 0x00A + UNIT_START, //2
- UNIT_FIELD_CHANNEL_OBJECT = 0x00C + UNIT_START, //2
- UNIT_FIELD_HEALTH = 0x00E + UNIT_START, //1
- UNIT_FIELD_POWER1 = 0x00F + UNIT_START, //1
- UNIT_FIELD_POWER2 = 0x010 + UNIT_START, //1
- UNIT_FIELD_POWER3 = 0x011 + UNIT_START, //1
- UNIT_FIELD_POWER4 = 0x012 + UNIT_START, //1
- UNIT_FIELD_POWER5 = 0x013 + UNIT_START, //1
- UNIT_FIELD_MAXHEALTH = 0x014 + UNIT_START, //1
- UNIT_FIELD_MAXPOWER1 = 0x015 + UNIT_START, //1
- UNIT_FIELD_MAXPOWER2 = 0x016 + UNIT_START, //1
- UNIT_FIELD_MAXPOWER3 = 0x017 + UNIT_START, //1
- UNIT_FIELD_MAXPOWER4 = 0x018 + UNIT_START, //1
- UNIT_FIELD_MAXPOWER5 = 0x019 + UNIT_START, //1
- UNIT_FIELD_LEVEL = 0x01A + UNIT_START, //1
- UNIT_FIELD_FACTIONTEMPLATE = 0x01B + UNIT_START, //1
- UNIT_FIELD_BYTES_0 = 0x01C + UNIT_START, //1
- UNIT_VIRTUAL_ITEM_SLOT_DISPLAY = 0x01D + UNIT_START, //3
- UNIT_VIRTUAL_ITEM_INFO = 0x020 + UNIT_START, //6
- UNIT_FIELD_FLAGS = 0x026 + UNIT_START, //1
- UNIT_FIELD_AURA = 0x027 + UNIT_START, //38h
- UNIT_FIELD_AURALEVELS = 0x05F + UNIT_START, //0Ah
- UNIT_FIELD_AURAAPPLICATIONS = 0x069 + UNIT_START, //0Ah
- UNIT_FIELD_AURAFLAGS = 0x073 + UNIT_START, //7
- UNIT_FIELD_AURASTATE = 0x07A + UNIT_START, //1
- UNIT_FIELD_BASEATTACKTIME = 0x07B + UNIT_START, //2
- UNIT_FIELD_BOUNDINGRADIUS = 0x07D + UNIT_START, //1
- UNIT_FIELD_COMBATREACH = 0x07E + UNIT_START, //1
- UNIT_FIELD_DISPLAYID = 0x07F + UNIT_START, //1
- UNIT_FIELD_NATIVEDISPLAYID = 0x080 + UNIT_START, //1
- UNIT_FIELD_MOUNTDISPLAYID = 0x081 + UNIT_START, //1
- UNIT_FIELD_MINDAMAGE = 0x082 + UNIT_START, //1
- UNIT_FIELD_MAXDAMAGE = 0x083 + UNIT_START, //1
- UNIT_FIELD_BYTES_1 = 0x084 + UNIT_START, //1
- UNIT_FIELD_PETNUMBER = 0x085 + UNIT_START, //1
- UNIT_FIELD_PET_NAME_TIMESTAMP = 0x086 + UNIT_START, //1
- UNIT_FIELD_PETEXPERIENCE = 0x087 + UNIT_START, //1
- UNIT_FIELD_PETNEXTLEVELEXP = 0x088 + UNIT_START, //1
- UNIT_DYNAMIC_FLAGS = 0x089 + UNIT_START, //1
- UNIT_CHANNEL_SPELL = 0x08A + UNIT_START, //1
- UNIT_MOD_CAST_SPEED = 0x08B + UNIT_START, //1
- UNIT_CREATED_BY_SPELL = 0x08C + UNIT_START, //1
- UNIT_NPC_FLAGS = 0x08D + UNIT_START, //1
- UNIT_NPC_EMOTESTATE = 0x08E + UNIT_START, //1
- UNIT_TRAINING_POINTS = 0x08F + UNIT_START, //1
- UNIT_FIELD_STAT0 = 0x090 + UNIT_START, //1
- UNIT_FIELD_STAT1 = 0x091 + UNIT_START, //1
- UNIT_FIELD_STAT2 = 0x092 + UNIT_START, //1
- UNIT_FIELD_STAT3 = 0x093 + UNIT_START, //1
- UNIT_FIELD_STAT4 = 0x094 + UNIT_START, //1
- UNIT_FIELD_RESISTANCES = 0x095 + UNIT_START, //7
- UNIT_FIELD_ATTACKPOWER = 0x09C + UNIT_START, //1
- UNIT_FIELD_BASE_MANA = 0x09D + UNIT_START, //1
- UNIT_ATTACK_POWER_MODS = 0x09E + UNIT_START, //1
- UNIT_FIELD_PADDING = 0x09F + UNIT_START, //1
- UNIT_END = 0x0A0 + UNIT_START,
- };
- enum PlayerUpdateFields {
- PLAYER_START = UNIT_END,
- PLAYER_SELECTION = 0x000 + PLAYER_START, //size 2
- PLAYER_DUEL_ARBITER = 0x002 + PLAYER_START, //size 2
- PLAYER_GUILDID = 0x004 + PLAYER_START, //size 1
- PLAYER_GUILDRANK = 0x005 + PLAYER_START, //size 1
- PLAYER_BYTES = 0x006 + PLAYER_START, //size 1
- PLAYER_BYTES_2 = 0x007 + PLAYER_START, //size 1
- PLAYER_BYTES_3 = 0x008 + PLAYER_START, //1
- PLAYER_DUEL_TEAM = 0x009 + PLAYER_START, //1
- PLAYER_GUILD_TIMESTAMP = 0x00A + PLAYER_START, //1
- PLAYER_FIELD_PAD_0 = 0x00B + PLAYER_START, //1
- PLAYER_FIELD_INV_SLOT_HEAD = 0x00C + PLAYER_START, //2Eh
- PLAYER_FIELD_PACK_SLOT_1 = 0x03A + PLAYER_START, //20h
- PLAYER_FIELD_BANK_SLOT_1 = 0x05A + PLAYER_START, //30h
- PLAYER_FIELD_BANKBAG_SLOT_1 = 0x08A + PLAYER_START, //0Ch
- PLAYER_FIELD_VENDORBUYBACK_SLOT = 0x096 + PLAYER_START, //2
- PLAYER_FARSIGHT = 0x098 + PLAYER_START, //2
- PLAYER__FIELD_COMBO_TARGET = 0x09A + PLAYER_START, //2
- PLAYER_FIELD_BUYBACK_NPC = 0x09C + PLAYER_START, //2
- PLAYER_XP = 0x09E + PLAYER_START, //1
- PLAYER_NEXT_LEVEL_XP = 0x09F + PLAYER_START, //1
- PLAYER_SKILL_INFO_1_1 = 0x00A0 + PLAYER_START, //180
- PLAYER_QUEST_LOG_1_1 = 0x0220 + PLAYER_START, //3C
- PLAYER_CHARACTER_POINTS1 = 0x025C + PLAYER_START, //1
- PLAYER_CHARACTER_POINTS2 = 0x025D + PLAYER_START, //1
- PLAYER_TRACK_CREATURES = 0x025E + PLAYER_START, //1
- PLAYER_TRACK_RESOURCES = 0x025F + PLAYER_START, //1
- PLAYER_CHAT_FILTERS = 0x0260 + PLAYER_START, //1
- PLAYER_BLOCK_PERCENTAGE = 0x0261 + PLAYER_START, //1
- PLAYER_DODGE_PERCENTAGE = 0x0262 + PLAYER_START, //1
- PLAYER_PARRY_PERCENTAGE = 0x0263 + PLAYER_START, //1
- PLAYER_CRIT_PERCENTAGE = 0x0264 + PLAYER_START, //1
- PLAYER_EXPLORED_ZONES_1 = 0x0265 + PLAYER_START, //20
- PLAYER_REST_STATE_EXPERIENCE = 0x0285 + PLAYER_START, //1
- PLAYER_FIELD_COINAGE = 0x0286 + PLAYER_START, //1
- PLAYER_FIELD_POSSTAT0 = 0x0287 + PLAYER_START, //1
- PLAYER_FIELD_POSSTAT1 = 0x0288 + PLAYER_START, //1
- PLAYER_FIELD_POSSTAT2 = 0x0289 + PLAYER_START, //1
- PLAYER_FIELD_POSSTAT3 = 0x028A + PLAYER_START, //1
- PLAYER_FIELD_POSSTAT4 = 0x028B + PLAYER_START, //1
- PLAYER_FIELD_NEGSTAT0 = 0x028C + PLAYER_START, //1
- PLAYER_FIELD_NEGSTAT1 = 0x028D + PLAYER_START, //1
- PLAYER_FIELD_NEGSTAT2 = 0x028E + PLAYER_START, //1
- PLAYER_FIELD_NEGSTAT3 = 0x028F + PLAYER_START, //1
- PLAYER_FIELD_NEGSTAT4 = 0x0290 + PLAYER_START, //1
- PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE = 0x0291 + PLAYER_START, //7
- PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE = 0x0298 + PLAYER_START, //7
- PLAYER_FIELD_MOD_DAMAGE_DONE_POS = 0x029F + PLAYER_START, //7
- PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = 0x02A6 + PLAYER_START, //7
- PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = 0x02AD + PLAYER_START, //7
- PLAYER_FIELD_BYTES = 0x02B4 + PLAYER_START, //1
- PLAYER_AMMO_ID = 0x02B5 + PLAYER_START, //1
- PLAYER_FIELD_PVP_MEDALS = 0x02B6 + PLAYER_START, //1
- PLAYER_FIELD_BUYBACK_ITEM_ID = 0x02B7 + PLAYER_START, //1
- PLAYER_FIELD_BUYBACK_RANDOM_PROPERTIES_ID = 0x02B8 + PLAYER_START, //1
- PLAYER_FIELD_BUYBACK_SEED = 0x02B9 + PLAYER_START, //1
- PLAYER_FIELD_BUYBACK_PRICE = 0x02BA + PLAYER_START, //1
- PLAYER_FIELD_PADDING = 0x02BB + PLAYER_START, //1
- PLAYER_END = 0x02BC + PLAYER_START,
- };
- enum GameObjectUpdateFields {
- GAMEOBJECT_START = OBJECT_END,
- GAMEOBJECT_DISPLAYID = 0x00 + GAMEOBJECT_START, //1
- GAMEOBJECT_FLAGS = 0x01 + GAMEOBJECT_START, //1
- GAMEOBJECT_ROTATION = 0x02 + GAMEOBJECT_START, //4
- GAMEOBJECT_STATE = 0x06 + GAMEOBJECT_START, //1
- GAMEOBJECT_TIMESTAMP = 0x07 + GAMEOBJECT_START, //1
- GAMEOBJECT_POS_X = 0x08 + GAMEOBJECT_START, //1
- GAMEOBJECT_POS_Y = 0x09 + GAMEOBJECT_START, //1
- GAMEOBJECT_POS_Z = 0x00A + GAMEOBJECT_START, //1
- GAMEOBJECT_FACING = 0x00B + GAMEOBJECT_START, //1
- GAMEOBJECT_DYN_FLAGS = 0x00C + GAMEOBJECT_START, //1
- GAMEOBJECT_FACTION = 0x00D + GAMEOBJECT_START, //1
- GAMEOBJECT_TYPE_ID = 0x00E + GAMEOBJECT_START, //1
- GAMEOBJECT_LEVEL = 0x00F + GAMEOBJECT_START, //1
- GAMEOBJECT_END = 0x010 + GAMEOBJECT_START,
- };
- enum DynamicObjectUpdateFields {
- DYNAMICOBJECT_START = GAMEOBJECT_END,
- DYNAMICOBJECT_CASTER = 0x00 + DYNAMICOBJECT_START,
- DYNAMICOBJECT_BYTES = 0x02 + DYNAMICOBJECT_START,
- DYNAMICOBJECT_SPELLID = 0x03 + DYNAMICOBJECT_START,
- DYNAMICOBJECT_RADIUS = 0x04 + DYNAMICOBJECT_START,
- DYNAMICOBJECT_POS_X = 0x05 + DYNAMICOBJECT_START,
- DYNAMICOBJECT_POS_Y = 0x06 + DYNAMICOBJECT_START,
- DYNAMICOBJECT_POS_Z = 0x07 + DYNAMICOBJECT_START,
- DYNAMICOBJECT_FACING = 0x08 + DYNAMICOBJECT_START,
- DYNAMICOBJECT_PAD = 0x09 + DYNAMICOBJECT_START,
- DYNAMICOBJECT_END = 0x0A + DYNAMICOBJECT_START,
- };
- enum CorpseUpdateFields {
- CORPSE_START = GAMEOBJECT_END,
- CORPSE_FIELD_OWNER = 0x00 + CORPSE_START,
- CORPSE_FIELD_FACING = 0x02 + CORPSE_START,
- CORPSE_FIELD_POS_X = 0x03 + CORPSE_START,
- CORPSE_FIELD_POS_Y = 0x04 + CORPSE_START,
- CORPSE_FIELD_POS_Z = 0x05 + CORPSE_START,
- CORPSE_FIELD_DISPLAY_ID = 0x06 + CORPSE_START,
- CORPSE_FIELD_ITEM0 = 0x07 + CORPSE_START,
- CORPSE_FIELD_ITEM1 = 0x08 + CORPSE_START,
- CORPSE_FIELD_ITEM2 = 0x09 + CORPSE_START,
- CORPSE_FIELD_ITEM3 = 0x0A + CORPSE_START,
- CORPSE_FIELD_ITEM4 = 0x0B + CORPSE_START,
- CORPSE_FIELD_ITEM5 = 0x0C + CORPSE_START,
- CORPSE_FIELD_BYTES_1 = 0x1A + CORPSE_START,
- CORPSE_FIELD_BYTES_2 = 0x1B + CORPSE_START,
- CORPSE_FIELD_GUILD = 0x1C + CORPSE_START,
- CORPSE_FIELD_FLAGS = 0x1D + CORPSE_START,
- };
- struct UpdateMask {
- uint8 count;
- uint16 length;
- uint32 * updateMask;
- inline void setBit( const uint32 index ) {
- ( (uint8 *)updateMask )[ index >> 3 ] |= 1 << ( index & 0x7 );
- }
- inline void unSetBit( const uint32 index ) {
- ( (uint8 *)updateMask )[ index >> 3 ] &= (0xff ^ (1 << ( index & 0x7 ) ) );
- }
- void setCount(int newcount) {
- clear( );
- count = newcount;
- length = count*4;
- updateMask = new uint32[count];
- memset(updateMask, 0, length);
- }
- void clear(){
- if (updateMask){
- delete [] updateMask;
- updateMask = 0;
- }
- count = 0;
- length = 0;
- }
- UpdateMask( ) : updateMask( 0 ), count( 0 ), length( 0 ) { }
- ~UpdateMask( ) { clear( ); }
- };
- #endif
- /*
- PLAYER_REST_STATE_EXPERIENCE
- PLAYER_EXPLORED_ZONES_1
- PLAYER_BASE_MANA
- PLAYER_PARRY_PERCENTAGE
- PLAYER_DODGE_PERCENTAGE
- PLAYER_BLOCK_PERCENTAGE
- PLAYER_CHAT_FILTERS
- PLAYER_TRACK_RESOURCES
- PLAYER_TRACK_CREATURES
- PLAYER_CHARACTER_POINTS2
- PLAYER_CHARACTER_POINTS1
- PLAYER_QUEST_LOG_1_1
- PLAYER_SKILL_INFO_1_1
- PLAYER_NEXT_LEVEL_XP
- PLAYER_XP
- PLAYER_FIELD_COMBO_TARGET
- PLAYER_FARSIGHT
- PLAYER_FIELD_BANKBAG_SLOT_1
- PLAYER_FIELD_BANK_SLOT_1
- PLAYER_FIELD_PACK_SLOT_1
- PLAYER_FIELD_INV_SLOT_HEAD
- PLAYER_FIELD_PAD_0
- PLAYER_GUILD_TIMESTAMP
- PLAYER_DUEL_TEAM
- PLAYER_BYTES_3
- PLAYER_BYTES_2
- PLAYER_BYTES
- PLAYER_GUILDRANK
- PLAYER_GUILDID
- PLAYER_DUEL_ARBITER
- PLAYER_SELECTION
- UNIT_FIELD_CHARM
- UNIT_FIELD_SUMMON
- UNIT_FIELD_CHARMEDBY
- UNIT_FIELD_SUMMONEDBY
- UNIT_FIELD_CREATEDBY
- UNIT_FIELD_TARGET
- UNIT_FIELD_CHANNEL_OBJECT
- UNIT_FIELD_HEALTH
- UNIT_FIELD_POWER1
- UNIT_FIELD_POWER2
- UNIT_FIELD_POWER3
- UNIT_FIELD_POWER4
- UNIT_FIELD_POWER5
- UNIT_FIELD_MAXHEALTH
- UNIT_FIELD_MAXPOWER1
- UNIT_FIELD_MAXPOWER2
- UNIT_FIELD_MAXPOWER3
- UNIT_FIELD_MAXPOWER4
- UNIT_FIELD_MAXPOWER5
- UNIT_FIELD_LEVEL
- UNIT_FIELD_FACTIONTEMPLATE
- UNIT_FIELD_BYTES_0
- UNIT_VIRTUAL_ITEM_SLOT_DISPLAY
- UNIT_VIRTUAL_ITEM_INFO
- UNIT_FIELD_FLAGS
- UNIT_FIELD_AURA
- UNIT_FIELD_AURALEVELS
- UNIT_FIELD_AURAAPPLICATIONS
- UNIT_FIELD_AURAFLAGS
- UNIT_FIELD_AURASTATE
- UNIT_FIELD_BASEATTACKTIME
- UNIT_FIELD_BOUNDINGRADIUS
- UNIT_FIELD_COMBATREACH
- UNIT_FIELD_WEAPONREACH
- UNIT_FIELD_DISPLAYID
- UNIT_FIELD_MOUNTDISPLAYID
- UNIT_FIELD_MINDAMAGE
- UNIT_FIELD_MAXDAMAGE
- UNIT_FIELD_BYTES_1
- UNIT_FIELD_PETNUMBER
- UNIT_FIELD_PET_NAME_TIMESTAMP
- UNIT_FIELD_PETEXPERIENCE
- UNIT_FIELD_PETNEXTLEVELEXP
- UNIT_DYNAMIC_FLAGS
- UNIT_CHANNEL_SPELL
- UNIT_MOD_CAST_SPEED
- UNIT_CREATED_BY_SPELL
- UNIT_NPC_FLAGS
- UNIT_NPC_EMOTESTATE
- UNIT_FIELD_PADDING
- */