Guest User

Untitled

a guest
Nov 16th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var packets = {
  2.     // Unused in SkyFire, intended for auth verification.
  3.     CMSG_AUTH_SESSION: {
  4.         digest: 7+4+1+8+4+1+1+2, seed: u32, digest2: 4+6,
  5.         build: u16, digest3: 1+1+4+2,
  6.         addonTable: array(u32, u8), account: cString
  7.     },
  8.     CMSG_CHAR_ENUM: {},
  9.     CMSG_PLAYER_LOGIN: GUID,
  10.     CMSG_MESSAGECHAT_SAY: {lang: u32, msg: cString},
  11.     CMSG_MESSAGECHAT_WHISPER: {lang: u32, message: cString, name: cString},
  12.     CMSG_GOSSIP_HELLO: {guid: GUID},
  13.     CMSG_QUESTGIVER_HELLO: {guid: GUID},
  14.     CMSG_QUESTGIVER_ACCEPT_QUEST: {guid: GUID, quest: u32, unk: u32},
  15.     CMSG_QUESTGIVER_QUERY_QUEST: {guid: GUID, quest: u32, unk: u8},
  16.     CMSG_QUESTGIVER_CHOOSE_REWARD: {guid: GUID, quest: u32, reward: u32},
  17.     CMSG_QUESTGIVER_REQUEST_REWARD: {guid: GUID, quest: u32},
  18.     CMSG_QUESTGIVER_CANCEL: {},
  19.     CMSG_QUESTGIVER_COMPLETE_QUEST: {guid: GUID, quest: u32, unk: u8},
  20.     CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY: {},
  21.     CMSG_QUEST_QUERY: u32,
  22.     CMSG_QUEST_COMFIRM_ACCEPT: {quest: u32},
  23.     CMSG_START_QUEST: {unk: u32, quest: u32},
  24.  
  25.     MSG_LIST_STABLED_PETS: {guid: GUID, $num: u8, unk: u8, pets: array('$num', {
  26.         slot: u8, number: u32, entry: u32,
  27.         level: u16, name: cString, stable: u8
  28.     })},
  29.  
  30.     // Unused in SkyFire, intended for auth verification.
  31.     SMSG_AUTH_CHALLENGE: {seed1: 16, unk: u8, seed: u8, seed2: 16},
  32.     SMSG_AUTH_RESPONSE: {
  33.         code: u8,
  34.         billingTimeRemaining: u32, billingPlanFlags: u8, billingTimeRested: u32,
  35.         clientExpansion: u8, serverExpansion: u8
  36.     },
  37.     SMSG_CHAR_ENUM: array(u8, {
  38.         guid: GUID,
  39.         name: cString,
  40.         race: u8, class: u8, gender: u8,
  41.         skin: u8, face: u8, hairStyle: u8, hairColor: u8, facialHair: u8,
  42.         level: u8,
  43.         zone: u32, map: u32,
  44.         x: float, y: float, z: float,
  45.         guild: GUID,
  46.         flags: u32,
  47.         customize: u32,
  48.         firstLogin: u8,
  49.         petDisplayID: u32, petLevel: u32, petFamily: u32,
  50.         equipment: array(19, filter({displayInfoID: u32, inventoryType: u8, enchant: u32}, function(x) {
  51.             return x.displayInfoID ? x : null;
  52.         })),
  53.         //HACK Not filled in SkyFire.
  54.         $bags: array(4, {displayInfoID: u32, inventoryType: u8, enchant: u32})
  55.     }),
  56.     SMSG_INITIALIZE_FACTIONS: array(u32, filter({flags: u8, standing: u32}, function(x) {
  57.         return x.flags ? x : null;
  58.     })),
  59.     SMSG_ACTION_BUTTONS: {type: u8,
  60.         butons: eq('type', 2, null, array(wow.MAX_ACTION_BUTTONS, filter(u32, function(x) {
  61.             return x || null;
  62.         })))
  63.     },
  64.     SMSG_EQUIPMENT_SET_LIST: array(u32, {
  65.         guid: packGUID, idx: u32, name: cString, iconName: cString,
  66.         slots: array(19, packGUID)
  67.     }),
  68.     SMSG_INIT_WORLD_STATES: {map: u32, zone: u32, area: u32, fields: array(filter(u16, function(x) {
  69.         // HACK SkyFire sends num=8 for 5 fields.
  70.         return Math.min(x, Math.floor((this._stream._buffer.length-this._stream._pos)/8));
  71.     }), [u32, u32])},
  72.     SMSG_UPDATE_WORLD_STATE: [u32, u32],
  73.     SMSG_LEARNED_DANCE_MOVES: u64,
  74.     SMSG_PLAY_SOUND: u32,
  75.     SMSG_EMOTE: {anim: u32, guid: GUID},
  76.     SMSG_WEATHER: {state: u32, grade: float, unk: u8},
  77.     SMSG_MOTD: /*lines*/array(u32, cString),
  78.     SMSG_GOSSIP_MESSAGE: {
  79.         guid: GUID, menuID: u32, titleTextID: u32,
  80.         menus: array(u32, {id: u32, icon: u8, isCoded: bool, boxMoney: u32, message: cString, boxMessage: cString}),
  81.         quests: array(u32, {id: u32, icon: u32, level: i32, flags: u32, unk: u8, title: cString})
  82.     },
  83.     SMSG_GOSSIP_COMPLETE: {},
  84.     SMSG_QUESTGIVER_QUEST_DETAILS: {
  85.         guid: GUID, unk1: u64, id: u32,
  86.         title: cString, details: cString, objectives: cString,
  87.         targetText: cString, targetName: cString, unk2: u16, targetDisplayID: u32,
  88.         unk3: u32, autoFinish: bool, flags: u32, suggestedPlayers: u32,
  89.         unk4: u8, questStartType: u8, requiredSpell: u32,
  90.         rewardChoicesCount: u32, rewardChoices: array(wow.QUEST_REWARD_CHOICES_COUNT, {itemID: u32, count: u32, displayID: u32}),
  91.         rewardsCount: u32, rewards: array(wow.QUEST_REWARDS_COUNT, {itemID: u32, count: u32, displayID: u32}),
  92.         rewardMoney: u32, xp: u32, charTitleID: u32, unk5: [u32, u32],
  93.         bonusTalents: u32, unk6: [u32, u32],
  94.         reputations: array(wow.QUEST_REPUTATIONS_COUNT, {faction: u32, valueID: i32, value: i32}),
  95.         rewardSpellCast: i32, unk7: u32,
  96.         currencies: array(wow.QUEST_CURRENCY_COUNT, {id: u32, count: u32}),
  97.         unk8: [u32, u32],
  98.         emotes: array(u32, {emote: u32, delay: u32})
  99.     },
  100.     SMSG_QUESTGIVER_OFFER_REWARD: {
  101.         guid: GUID, id: u32,
  102.         title: cString, offerReward: cString,
  103.         questGiverTextWindow: cString, questGiverName: cString,
  104.         questCompleteTextWindow: cString, questCompleteName: cString,
  105.         questGiverPortrait: u32, questTurnInPortrait: u32,
  106.         autoFinish: bool, flags: u32, suggestedPlayers: u32,
  107.         emotes: array(u32, {delay: u32, emote: u32}),
  108.         rewardChoicesCount: u32, rewardChoices: array(wow.QUEST_REWARD_CHOICES_COUNT, {itemID: u32, count: u32, displayID: u32}),
  109.         rewardsCount: u32, rewards: array(wow.QUEST_REWARDS_COUNT, {itemID: u32, count: u32, displayID: u32}),
  110.         rewardMoney: u32, xp: u32, charTitleID: u32, unk1: [u32, u32],
  111.         bonusTalents: u32, unk2: [u32, u32],
  112.         reputations: array(wow.QUEST_REPUTATIONS_COUNT, {faction: u32, valueID: i32, value: i32}),
  113.         rewardSpellCast: i32, unk3: u32,
  114.         currencies: array(wow.QUEST_CURRENCY_COUNT, {id: u32, count: u32}),
  115.         unk4: [u32, u32]
  116.     },
  117.     SMSG_QUESTGIVER_STATUS: {guid: GUID, status: u32},
  118.     SMSG_QUESTGIVER_STATUS_MULTIPLE: array(u32, {guid: GUID, status: u32}),
  119.     SMSG_TALENTS_INFO: {
  120.         pet: bool,
  121.         unspent: u32,
  122.         talents: eq('pet', true, array(u8, {id: u32, rank: u8})),
  123.         $numSpecs: eq('pet', false, u8),
  124.         active: eq('pet', false, u8),
  125.         specs: eq('pet', false, array('$numSpecs', {
  126.             tree: u32,
  127.             talents: array(u8, {id: u32, rank: u8}),
  128.             glyphs: array(u8, u16)
  129.         }))
  130.     },
  131.     SMSG_POWER_UPDATE: {guid: packGUID, powers: array(u32, {power: u8, val: u32})},
  132.     SMSG_AURA_UPDATE: {target: packGUID,
  133.         slot: u8, id: u32,
  134.         $: eq('id', 0, null, join({
  135.             flags: u8, level: u8, stack: u8,
  136.             //NOTE this looks rather anti-logical, maybe SkyFire is wrong.
  137.             caster: flag(wow.auraFlag.CASTER, null, packGUID),
  138.             maxDuration: flag(wow.auraFlag.DURATION, u32),
  139.             duration: flag(wow.auraFlag.DURATION, u32),
  140.             effectAmounts: flag(wow.auraFlag.ANY_EFFECT_AMOUNT_SENT, _(function(update) {
  141.                 var amounts = [];
  142.                 for(var i = 0; i < wow.MAX_SPELL_EFFECTS; i++)
  143.                     if(update.flags & (i << i))
  144.                         amounts[i] = this.read(u32);
  145.                 return amounts;
  146.             }))
  147.         }))
  148.     },
  149.     SMSG_THREAT_UPDATE: {guid: packGUID, threats: array(u32, {guid: packGUID, threat: filter(u32, function(x) {return x/100;}, function(x) {return Math.floor(x*100);})})},
  150.     SMSG_HIGHEST_THREAT_UPDATE: {guid: packGUID, target: packGUID, threats: array(u32, {guid: packGUID, threat: u32})},
  151.     SMSG_AI_REACTION: {guid: GUID, type: u32},
  152.     SMSG_ATTACKSTART: {guid: GUID, victim: GUID},
  153.     SMSG_SPELL_START: {
  154.         source: packGUID, caster: packGUID, castCount: u8,
  155.         id: u32, flags: u32, timer: i32,
  156.         power: flag(wow.castFlag.POWER_LEFT_SELF, u32),
  157.         runes: flag(wow.castFlag.RUNE_LIST, {
  158.             before: u8, after: u8,
  159.             cooldowns: array(wow.MAX_RUNES, filter(u8, function(x) {return x/255;}, function(x) {return Math.floor(x*255);}))
  160.         }),
  161.         unk_23: flag(wow.castFlag.UNKNOWN_23, [u32, u32])
  162.     },
  163.     SMSG_DESTROY_OBJECT: {guid: GUID, animated: bool}
  164. };
Add Comment
Please, Sign In to add comment