/// <summary>Adds a new modifier to this Template</summary> public void AddMod(ItemModType modType, int value) { int num = (int)ArrayUtil.AddOnlyOne <StatModifier>(ref this.Mods, new StatModifier() { Type = modType, Value = value }); }
public static void ApplyStatMod(this Character owner, ItemModType modType, int value) { ItemMods.ItemModHandler addHandler = ItemMods.AddHandlers[(int)modType]; if (addHandler == null) { return; } addHandler(owner, value); }
public static void RemoveStatMod(this Character owner, ItemModType modType, int value) { ItemMods.ItemModHandler removeHandler = ItemMods.RemoveHandlers[(int)modType]; if (removeHandler == null) { return; } removeHandler(owner, value); }
public void SetBonus(ItemModType type, int amount) { if (b_i < bonuses.Length) { bonuses[b_i].Type = (int)type; bonuses[b_i].Value = amount; b_i++; } }
public static void RemoveStatMod(this Character owner, ItemModType modType, int value) { var handler = RemoveHandlers[(int)modType]; if (handler != null) { handler(owner, value); } }
internal void AddItemMod(SimcItem item, ItemModType modType, int statAllocation) { var newMod = new SimcItemMod { Type = modType, RawStatAllocation = statAllocation }; item.Mods.Add(newMod); }
/// <inheritdoc /> public StatInfo(ItemModType statType, int statValue) { if (!Enum.IsDefined(typeof(ItemModType), statType)) { throw new InvalidEnumArgumentException(nameof(statType), (int)statType, typeof(ItemModType)); } StatType = statType; StatValue = statValue; }
public int GetBonus(ItemModType type) { var t = (int)type; foreach (Bonus b in bonuses) { if (b.Type == (int)type) { return(b.Value); } } return(0); }
public ItemModData(string Identity, ItemModType ModType, ItemModEffects StatType, float ModBase, float ScalingFactor, float Variance, StatusTriggerTime StatusTriggerType, string Status, CoreStats?CoreStat = null, PrimaryStats?PrimaryStat = null, SecondaryStats?SecondaryStat = null) { //Debug.Log("[Mode Loaded] Mod Base: " + ModBase); this.Identity = Identity; this.ModType = ModType; this.StatType = StatType; this.ModBase = ModBase; this.ScalingFactor = ScalingFactor; this.Variance = Variance; this.CoreStat = CoreStat; this.PrimaryStat = PrimaryStat; this.SecondaryStat = SecondaryStat; this.StatusTriggerType = StatusTriggerType; this.Status = Resources.Load <StatusEffect>("Skills/StatusEffects/" + Status); }
public bool GetIsCombatRating(ItemModType modType) { // based on util::is_combat_rating switch (modType) { case ItemModType.ITEM_MOD_MASTERY_RATING: case ItemModType.ITEM_MOD_DODGE_RATING: case ItemModType.ITEM_MOD_PARRY_RATING: case ItemModType.ITEM_MOD_BLOCK_RATING: case ItemModType.ITEM_MOD_HIT_MELEE_RATING: case ItemModType.ITEM_MOD_HIT_RANGED_RATING: case ItemModType.ITEM_MOD_HIT_SPELL_RATING: case ItemModType.ITEM_MOD_CRIT_MELEE_RATING: case ItemModType.ITEM_MOD_CRIT_RANGED_RATING: case ItemModType.ITEM_MOD_CRIT_SPELL_RATING: case ItemModType.ITEM_MOD_CRIT_TAKEN_RANGED_RATING: case ItemModType.ITEM_MOD_CRIT_TAKEN_SPELL_RATING: case ItemModType.ITEM_MOD_HASTE_MELEE_RATING: case ItemModType.ITEM_MOD_HASTE_RANGED_RATING: case ItemModType.ITEM_MOD_HASTE_SPELL_RATING: case ItemModType.ITEM_MOD_HIT_RATING: case ItemModType.ITEM_MOD_CRIT_RATING: case ItemModType.ITEM_MOD_HIT_TAKEN_RATING: case ItemModType.ITEM_MOD_CRIT_TAKEN_RATING: case ItemModType.ITEM_MOD_RESILIENCE_RATING: case ItemModType.ITEM_MOD_HASTE_RATING: case ItemModType.ITEM_MOD_EXPERTISE_RATING: case ItemModType.ITEM_MOD_MULTISTRIKE_RATING: case ItemModType.ITEM_MOD_SPEED_RATING: case ItemModType.ITEM_MOD_LEECH_RATING: case ItemModType.ITEM_MOD_AVOIDANCE_RATING: case ItemModType.ITEM_MOD_VERSATILITY_RATING: case ItemModType.ITEM_MOD_EXTRA_ARMOR: return(true); default: return(false); } }
public static void HandleDBReply(Packet packet) { var size = packet.ReadInt32("Size"); var data = packet.ReadBytes(size); var db2File = new Packet(data, packet.Opcode, packet.Time, packet.Direction, packet.Number, packet.Writer, packet.FileName); var type = packet.ReadUInt32E <DB2Hash>("DB2 File"); packet.ReadTime("Hotfix date"); var entry = (uint)packet.ReadInt32("Entry"); if ((int)entry < 0) { packet.WriteLine("Row {0} has been removed.", -(int)entry); return; } switch (type) { case DB2Hash.BroadcastText: { BroadcastText broadcastText = new BroadcastText(); var id = db2File.ReadEntry("Id"); broadcastText.ID = (uint)id.Key; broadcastText.Language = db2File.ReadInt32("Language"); if (db2File.ReadUInt16() > 0) { broadcastText.MaleText = db2File.ReadCString("Male Text"); } if (db2File.ReadUInt16() > 0) { broadcastText.FemaleText = db2File.ReadCString("Female Text"); } broadcastText.EmoteID = new uint?[3]; broadcastText.EmoteDelay = new uint?[3]; for (int i = 0; i < 3; ++i) { broadcastText.EmoteID[i] = (uint)db2File.ReadInt32("Emote ID", i); } for (int i = 0; i < 3; ++i) { broadcastText.EmoteDelay[i] = (uint)db2File.ReadInt32("Emote Delay", i); } broadcastText.SoundId = db2File.ReadUInt32("Sound Id"); broadcastText.UnkEmoteId = db2File.ReadUInt32("Unk MoP 1"); // unk emote broadcastText.Type = db2File.ReadUInt32("Unk MoP 2"); // kind of type? Storage.BroadcastTexts.Add(broadcastText, packet.TimeSpan); packet.AddSniffData(StoreNameType.None, id.Key, "BROADCAST_TEXT"); break; } case DB2Hash.Creature: // New structure - 5.4.0 { db2File.ReadUInt32("Creature Id"); db2File.ReadUInt32("Item Id 1"); db2File.ReadUInt32("Item Id 2"); db2File.ReadUInt32("Item Id 3"); db2File.ReadUInt32("Mount"); for (var i = 0; i < 4; ++i) { db2File.ReadInt32("Display Id", i); } for (var i = 0; i < 4; ++i) { db2File.ReadSingle("Display Id Probability", i); } if (db2File.ReadUInt16() > 0) { db2File.ReadCString("Name"); } if (db2File.ReadUInt16() > 0) { db2File.ReadCString("SubName"); } if (db2File.ReadUInt16() > 0) { db2File.ReadCString("Female SubName"); } db2File.ReadUInt32("Rank"); db2File.ReadUInt32("Inhabit Type"); break; } case DB2Hash.CreatureDifficulty: { CreatureDifficulty creatureDifficulty = new CreatureDifficulty(); creatureDifficulty.ID = (uint)db2File.ReadEntry("Id").Key; creatureDifficulty.CreatureID = db2File.ReadUInt32("Creature Id"); creatureDifficulty.FactionID = db2File.ReadUInt32("Faction Template Id"); creatureDifficulty.Expansion = db2File.ReadInt32("Expansion"); creatureDifficulty.MinLevel = db2File.ReadInt32("Min Level"); creatureDifficulty.MaxLevel = db2File.ReadInt32("Max Level"); creatureDifficulty.Flags = new uint?[5]; for (int i = 0; i < 5; ++i) { creatureDifficulty.Flags[i] = db2File.ReadUInt32("Flags", i); } Storage.CreatureDifficulties.Add(creatureDifficulty, packet.TimeSpan); break; } case DB2Hash.GameObjects: { db2File.ReadEntry("GameObject Id"); db2File.ReadUInt32("Map"); db2File.ReadUInt32("Display Id"); db2File.ReadSingle("Position X"); db2File.ReadSingle("Position Y"); db2File.ReadSingle("Position Z"); db2File.ReadSingle("Rotation X"); db2File.ReadSingle("Rotation Y"); db2File.ReadSingle("Rotation Z"); db2File.ReadSingle("Rotation W"); db2File.ReadSingle("Size"); db2File.ReadInt32E <GameObjectType>("Type"); for (int i = 0; i < 4; i++) { db2File.ReadInt32("Data", i); } if (db2File.ReadUInt16() > 0) { db2File.ReadCString("Name"); } break; } case DB2Hash.Item: { ItemTemplate key = new ItemTemplate { Entry = entry }; ItemTemplate item = Storage.ItemTemplates.ContainsKey(key) ? Storage.ItemTemplates[key].Item1 : new ItemTemplate(); db2File.ReadUInt32 <ItemId>("Item Entry"); item.Class = db2File.ReadInt32E <ItemClass>("Class"); item.SubClass = db2File.ReadUInt32("Sub Class"); item.SoundOverrideSubclass = db2File.ReadInt32("Sound Override Subclass"); item.Material = db2File.ReadInt32E <Material>("Material"); item.DisplayID = db2File.ReadUInt32("Display ID"); item.InventoryType = db2File.ReadUInt32E <InventoryType>("Inventory Type"); item.SheathType = db2File.ReadInt32E <SheathType>("Sheath Type"); Storage.ItemTemplates.Add(item, packet.TimeSpan); packet.AddSniffData(StoreNameType.Item, (int)entry, "DB_REPLY"); break; } case DB2Hash.ItemExtendedCost: { db2File.ReadUInt32("Item Extended Cost Entry"); db2File.ReadUInt32("Required Honor Points"); db2File.ReadUInt32("Required Arena Points"); db2File.ReadUInt32("Required Arena Slot"); for (var i = 0; i < 5; ++i) { db2File.ReadUInt32("Required Item", i); } for (var i = 0; i < 5; ++i) { db2File.ReadUInt32("Required Item Count", i); } db2File.ReadUInt32("Required Personal Arena Rating"); db2File.ReadUInt32("Item Purchase Group"); for (var i = 0; i < 5; ++i) { db2File.ReadUInt32("Required Currency", i); } for (var i = 0; i < 5; ++i) { db2File.ReadUInt32("Required Currency Count", i); } db2File.ReadUInt32("Required Faction Id"); db2File.ReadUInt32("Required Faction Standing"); db2File.ReadUInt32("Requirement Flags"); db2File.ReadUInt32("Required Guild Level"); db2File.ReadUInt32("Required Achievement"); break; } case DB2Hash.Item_sparse: { ItemTemplate key = new ItemTemplate { Entry = entry }; ItemTemplate item = Storage.ItemTemplates.ContainsKey(key) ? Storage.ItemTemplates[key].Item1 : new ItemTemplate(); db2File.ReadUInt32 <ItemId>("Item Sparse Entry"); item.Quality = db2File.ReadInt32E <ItemQuality>("Quality"); item.Flags = db2File.ReadUInt32E <ItemProtoFlags>("Flags 1"); item.FlagsExtra = db2File.ReadInt32E <ItemFlagExtra>("Flags 2"); db2File.ReadUInt32("Flags 3"); item.Unk430_1 = db2File.ReadSingle("Unk430_1"); item.Unk430_2 = db2File.ReadSingle("Unk430_2"); item.BuyCount = db2File.ReadUInt32("Buy count"); item.BuyPrice = db2File.ReadUInt32("Buy Price"); item.SellPrice = db2File.ReadUInt32("Sell Price"); item.InventoryType = db2File.ReadInt32E <InventoryType>("Inventory Type"); item.AllowedClasses = db2File.ReadInt32E <ClassMask>("Allowed Classes"); item.AllowedRaces = db2File.ReadInt32E <RaceMask>("Allowed Races"); item.ItemLevel = db2File.ReadUInt32("Item Level"); item.RequiredLevel = db2File.ReadUInt32("Required Level"); item.RequiredSkillId = db2File.ReadUInt32("Required Skill ID"); item.RequiredSkillLevel = db2File.ReadUInt32("Required Skill Level"); item.RequiredSpell = (uint)db2File.ReadInt32 <SpellId>("Required Spell"); item.RequiredHonorRank = db2File.ReadUInt32("Required Honor Rank"); item.RequiredCityRank = db2File.ReadUInt32("Required City Rank"); item.RequiredRepFaction = db2File.ReadUInt32("Required Rep Faction"); item.RequiredRepValue = db2File.ReadUInt32("Required Rep Value"); item.MaxCount = db2File.ReadInt32("Max Count"); item.MaxStackSize = db2File.ReadInt32("Max Stack Size"); item.ContainerSlots = db2File.ReadUInt32("Container Slots"); item.StatTypes = new ItemModType?[10]; for (int i = 0; i < 10; i++) { ItemModType statType = db2File.ReadInt32E <ItemModType>("Stat Type", i); item.StatTypes[i] = statType == ItemModType.None ? ItemModType.Mana : statType; // TDB } item.StatValues = new int?[10]; for (int i = 0; i < 10; i++) { item.StatValues[i] = db2File.ReadInt32("Stat Value", i); } item.ScalingValue = new int?[10]; for (int i = 0; i < 10; i++) { item.ScalingValue[i] = db2File.ReadInt32("Scaling Value", i); } item.SocketCostRate = new int?[10]; for (int i = 0; i < 10; i++) { item.SocketCostRate[i] = db2File.ReadInt32("Socket Cost Rate", i); } item.ScalingStatDistribution = db2File.ReadInt32("Scaling Stat Distribution"); item.DamageType = db2File.ReadInt32E <DamageType>("Damage Type"); item.Delay = db2File.ReadUInt32("Delay"); item.RangedMod = db2File.ReadSingle("Ranged Mod"); item.TriggeredSpellIds = new int?[5]; for (int i = 0; i < 5; i++) { item.TriggeredSpellIds[i] = db2File.ReadInt32 <SpellId>("Triggered Spell ID", i); } item.TriggeredSpellTypes = new ItemSpellTriggerType?[5]; for (int i = 0; i < 5; i++) { item.TriggeredSpellTypes[i] = db2File.ReadInt32E <ItemSpellTriggerType>("Trigger Spell Type", i); } item.TriggeredSpellCharges = new int?[5]; for (int i = 0; i < 5; i++) { item.TriggeredSpellCharges[i] = db2File.ReadInt32("Triggered Spell Charges", i); } item.TriggeredSpellCooldowns = new int?[5]; for (int i = 0; i < 5; i++) { item.TriggeredSpellCooldowns[i] = db2File.ReadInt32("Triggered Spell Cooldown", i); } item.TriggeredSpellCategories = new uint?[5]; for (int i = 0; i < 5; i++) { item.TriggeredSpellCategories[i] = db2File.ReadUInt32("Triggered Spell Category", i); } item.TriggeredSpellCategoryCooldowns = new int?[5]; for (int i = 0; i < 5; i++) { item.TriggeredSpellCategoryCooldowns[i] = db2File.ReadInt32( "Triggered Spell Category Cooldown", i); } item.Bonding = db2File.ReadInt32E <ItemBonding>("Bonding"); if (db2File.ReadUInt16() > 0) { item.Name = db2File.ReadCString("Name", 0); } for (int i = 1; i < 4; ++i) { if (db2File.ReadUInt16() > 0) { db2File.ReadCString("Name", i); } } if (db2File.ReadUInt16() > 0) { item.Description = db2File.ReadCString("Description"); } item.PageText = db2File.ReadUInt32("Page Text"); item.Language = db2File.ReadInt32E <Language>("Language"); item.PageMaterial = db2File.ReadInt32E <PageMaterial>("Page Material"); item.StartQuestId = (uint)db2File.ReadInt32 <QuestId>("Start Quest"); item.LockId = db2File.ReadUInt32("Lock ID"); item.Material = db2File.ReadInt32E <Material>("Material"); item.SheathType = db2File.ReadInt32E <SheathType>("Sheath Type"); item.RandomPropery = db2File.ReadInt32("Random Property"); item.RandomSuffix = db2File.ReadUInt32("Random Suffix"); item.ItemSet = db2File.ReadUInt32("Item Set"); item.AreaID = db2File.ReadUInt32 <AreaId>("Area"); item.MapID = db2File.ReadInt32 <MapId>("Map ID"); item.BagFamily = db2File.ReadInt32E <BagFamilyMask>("Bag Family"); item.TotemCategory = db2File.ReadInt32E <TotemCategory>("Totem Category"); item.ItemSocketColors = new ItemSocketColor?[3]; for (int i = 0; i < 3; i++) { item.ItemSocketColors[i] = db2File.ReadInt32E <ItemSocketColor>("Socket Color", i); } item.SocketContent = new uint?[3]; for (int i = 0; i < 3; i++) { item.SocketContent[i] = db2File.ReadUInt32("Socket Item", i); } item.SocketBonus = db2File.ReadInt32("Socket Bonus"); item.GemProperties = db2File.ReadInt32("Gem Properties"); item.ArmorDamageModifier = db2File.ReadSingle("Armor Damage Modifier"); item.Duration = db2File.ReadUInt32("Duration"); item.ItemLimitCategory = db2File.ReadInt32("Limit Category"); item.HolidayID = db2File.ReadInt32E <Holiday>("Holiday"); item.StatScalingFactor = db2File.ReadSingle("Stat Scaling Factor"); item.CurrencySubstitutionID = db2File.ReadUInt32("Currency Substitution Id"); item.CurrencySubstitutionCount = db2File.ReadUInt32("Currency Substitution Count"); Storage.ObjectNames.Add(new ObjectName { ObjectType = ObjectType.Item, ID = (int)entry, Name = item.Name }, packet.TimeSpan); packet.AddSniffData(StoreNameType.Item, (int)entry, "DB_REPLY"); break; } case DB2Hash.KeyChain: { db2File.ReadUInt32("Key Chain Id"); db2File.ReadBytes("Key", 32); break; } case DB2Hash.SceneScript: // lua ftw! { db2File.ReadUInt32("Scene Script Id"); if (db2File.ReadUInt16() > 0) { db2File.ReadCString("Name"); } if (db2File.ReadUInt16() > 0) { db2File.ReadCString("Script"); } db2File.ReadUInt32("Previous Scene Script Part"); db2File.ReadUInt32("Next Scene Script Part"); break; } case DB2Hash.Vignette: { db2File.ReadUInt32("Vignette Entry"); if (db2File.ReadUInt16() > 0) { db2File.ReadCString("Name"); } db2File.ReadUInt32("Icon"); db2File.ReadUInt32("Flag"); // not 100% sure (8 & 32 as values only) - todo verify with more data db2File.ReadSingle("Unk Float 1"); db2File.ReadSingle("Unk Float 2"); break; } case DB2Hash.WbAccessControlList: { db2File.ReadUInt32("Id"); if (db2File.ReadUInt16() > 0) { db2File.ReadCString("Address"); } db2File.ReadUInt32("Unk MoP 1"); db2File.ReadUInt32("Unk MoP 2"); db2File.ReadUInt32("Unk MoP 3"); db2File.ReadUInt32("Unk MoP 4"); // flags? break; } default: { db2File.AddValue("Unknown DB2 file type", string.Format("{0} (0x{0:x})", type)); for (var i = 0;; ++i) { if (db2File.Length - 4 >= db2File.Position) { var blockVal = db2File.ReadUpdateField(); string value = blockVal.UInt32Value + "/" + blockVal.SingleValue; packet.AddValue("Block Value " + i, value); } else { var left = db2File.Length - db2File.Position; for (var j = 0; j < left; ++j) { var value = db2File.ReadByte(); packet.AddValue("Byte Value " + i, value); } break; } } break; } } db2File.ClosePacket(false); }
public void SetBonus(ItemModType type, int amount) { if(b_i < bonuses.Length) { bonuses[b_i].Type = (int)type; bonuses[b_i].Value = amount; b_i++; } }
/// <summary> /// Adds a new modifier to this Template /// </summary> public void AddMod(ItemModType modType, int value) { ArrayUtil.AddOnlyOne(ref Mods, new StatModifier { Type = modType, Value = value }); }
public string GetCommand(int entry, ItemClass iClass, int subClass, int unk0, string[] name, int dispId, ItemQuality quality, ItemFlag flags, ItemFlagExtra flags2, int buyPrice, int sellPrice, InventoryType invType, ClassMask allowClass, RaceMask allowRace, int itemLvl, int reqLvl, int reqSkill, int reqSkLvl, int reqSpell, int reqHonor, int reqCity, int reqRepFaction, int reqRepValue, int maxCount, int stacks, int contSlots, int statsCount, ItemModType[] statType, int[] statValue, int ssdId, int ssdVal, float[] dmgMin, float[] dmgMax, DamageType[] dmgType, int[] resistance, int delay, AmmoType ammoType, float rangedMod, int[] spellId, ItemSpellTriggerType[] spellTrigger, int[] spellCharges, int[] spellCooldown, int[] spellCategory, int[] spellCatCooldown, ItemBonding binding, string description, int pageText, Language langId, PageMaterial pageMat, int startQuest, int lockId, Material material, SheathType sheath, int randomProp, int randomSuffix, int block, int itemSet, int maxDura, int area, int map, BagFamilyMask bagFamily, TotemCategory totemCat, ItemSocketColor[] color, int[] content, int socketBonus, int gemProps, int reqDisEnchSkill, float armorDmgMod, int duration, int limitCategory, Holiday holidayId) { var builder = new CommandBuilder("item_template"); builder.AddColumnValue("entry", entry); builder.AddColumnValue("class", (int)iClass); builder.AddColumnValue("subclass", subClass); builder.AddColumnValue("unk0", unk0); builder.AddColumnValue("name", name[0]); builder.AddColumnValue("displayid", dispId); builder.AddColumnValue("Quality", (int)quality); builder.AddColumnValue("Flags", (int)flags); builder.AddColumnValue("BuyCount", 1); builder.AddColumnValue("BuyPrice", buyPrice); builder.AddColumnValue("SellPrice", sellPrice); builder.AddColumnValue("InventoryType", (int)invType); builder.AddColumnValue("AllowableClass", (int)allowClass); builder.AddColumnValue("AllowableRace", (int)allowRace); builder.AddColumnValue("ItemLevel", itemLvl); builder.AddColumnValue("RequiredLevel", reqLvl); builder.AddColumnValue("RequiredSkill", reqSkill); builder.AddColumnValue("RequiredSkillRank", reqSkLvl); builder.AddColumnValue("requiredspell", reqSpell); builder.AddColumnValue("requiredhonorrank", reqHonor); builder.AddColumnValue("RequiredCityRank", reqCity); builder.AddColumnValue("RequiredReputationFaction", reqRepFaction); builder.AddColumnValue("RequiredReputationRank", reqRepValue); builder.AddColumnValue("maxcount", maxCount); var stackVal = stacks; if (SQLOutput.Format == SqlFormat.Mangos && stacks > 1000) stackVal = -1; builder.AddColumnValue("stackable", stackVal); builder.AddColumnValue("ContainerSlots", contSlots); builder.AddColumnValue("StatsCount", statsCount); for (var i = 0; i < 10; i++) { int type; int value; if (i > statsCount - 1) { type = 0; value = 0; } else { type = (int)statType[i]; value = statValue[i]; } builder.AddColumnValue("stat_type" + (i + 1), type); builder.AddColumnValue("stat_value" + (i + 1), value); } builder.AddColumnValue("ScalingStatDistribution", ssdId); builder.AddColumnValue("ScalingStatValue", ssdVal); for (var i = 0; i < 2; i++) { builder.AddColumnValue("dmg_min" + (i + 1), dmgMin[i]); builder.AddColumnValue("dmg_max" + (i + 1), dmgMax[i]); builder.AddColumnValue("dmg_type" + (i + 1), (int)dmgType[i]); } builder.AddColumnValue("armor", resistance[0]); builder.AddColumnValue("holy_res", resistance[1]); builder.AddColumnValue("fire_res", resistance[2]); builder.AddColumnValue("nature_res", resistance[3]); builder.AddColumnValue("frost_res", resistance[4]); builder.AddColumnValue("shadow_res", resistance[5]); builder.AddColumnValue("arcane_res", resistance[6]); builder.AddColumnValue("delay", delay); builder.AddColumnValue("ammo_type", (int)ammoType); builder.AddColumnValue("RangedModRange", rangedMod); for (var i = 0; i < 5; i++) { builder.AddColumnValue("spellid_" + (i + 1), spellId[i]); builder.AddColumnValue("spelltrigger_" + (i + 1), (int)spellTrigger[i]); builder.AddColumnValue("spellcharges_" + (i + 1), spellCharges[i]); builder.AddColumnValue("spellppmRate_" + (i + 1), 0); builder.AddColumnValue("spellcooldown_" + (i + 1), spellCooldown[i]); builder.AddColumnValue("spellcategory_" + (i + 1), spellCategory[i]); builder.AddColumnValue("spellcategorycooldown_" + (i + 1), spellCatCooldown[i]); } builder.AddColumnValue("bonding", (int)binding); builder.AddColumnValue("description", description); builder.AddColumnValue("PageText", pageText); builder.AddColumnValue("LanguageID", (int)langId); builder.AddColumnValue("PageMaterial", (int)pageMat); builder.AddColumnValue("startquest", startQuest); builder.AddColumnValue("lockid", lockId); builder.AddColumnValue("Material", (int)material); builder.AddColumnValue("sheath", (int)sheath); builder.AddColumnValue("RandomProperty", randomProp); builder.AddColumnValue("RandomSuffix", randomSuffix); builder.AddColumnValue("block", block); builder.AddColumnValue("itemset", itemSet); builder.AddColumnValue("MaxDurability", maxDura); builder.AddColumnValue("area", area); builder.AddColumnValue("map", map); builder.AddColumnValue("BagFamily", (int)bagFamily); builder.AddColumnValue("TotemCategory", (int)totemCat); for (var i = 0; i < 3; i++) { builder.AddColumnValue("socketColor_" + (i + 1), (int)color[i]); builder.AddColumnValue("socketContent_" + (i + 1), content[i]); } builder.AddColumnValue("socketBonus", socketBonus); builder.AddColumnValue("GemProperties", gemProps); builder.AddColumnValue("RequiredDisenchantSkill", reqDisEnchSkill); builder.AddColumnValue("ArmorDamageModifier", armorDmgMod); builder.AddColumnValue("Duration", duration); builder.AddColumnValue("ItemLimitCategory", limitCategory); builder.AddColumnValue("HolidayID", (int)holidayId); builder.AddColumnValue("ScriptName", string.Empty); builder.AddColumnValue("DisenchantID", 0); builder.AddColumnValue("FoodType", 0); builder.AddColumnValue("minMoneyLoot", 0); builder.AddColumnValue("maxMoneyLoot", 0); builder.AddColumnValue("NonConsumable", 0); return builder.BuildInsert(true); }
public void HandleItemQueryResponse(Parser packet) { var entry = packet.ReadEntry(); WriteLine("Entry: " + entry.Key); if (entry.Value) return; var iClass = (ItemClass)packet.ReadInt32(); WriteLine("Class: " + iClass); var subClass = packet.ReadInt32(); WriteLine("Sub Class: " + subClass); var unk0 = packet.ReadInt32(); WriteLine("Unk Int32: " + unk0); var name = new string[4]; for (var i = 0; i < 4; i++) { name[i] = packet.ReadCString(); WriteLine("Name " + i + ": " + name[i]); } var dispId = packet.ReadInt32(); WriteLine("Display ID: " + dispId); var quality = (ItemQuality)packet.ReadInt32(); WriteLine("Quality: " + quality); var flags = (ItemFlag)packet.ReadInt32(); WriteLine("Flags: " + flags); var flags2 = (ItemFlagExtra)packet.ReadInt32(); WriteLine("Extra Flags: " + flags2); var buyPrice = packet.ReadInt32(); WriteLine("Buy Price: " + buyPrice); var sellPrice = packet.ReadInt32(); WriteLine("Sell Price: " + sellPrice); var invType = (InventoryType)packet.ReadInt32(); WriteLine("Inventory Type: " + invType); var allowClass = (ClassMask)packet.ReadInt32(); WriteLine("Allowed Classes: " + allowClass); var allowRace = (RaceMask)packet.ReadInt32(); WriteLine("Allowed Races: " + allowRace); var itemLvl = packet.ReadInt32(); WriteLine("Item Level: " + itemLvl); var reqLvl = packet.ReadInt32(); WriteLine("Required Level: " + reqLvl); var reqSkill = packet.ReadInt32(); WriteLine("Required Skill ID: " + reqSkill); var reqSkLvl = packet.ReadInt32(); WriteLine("Required Skill Level: " + reqSkLvl); var reqSpell = packet.ReadInt32(); WriteLine("Required Spell: " + reqSpell); var reqHonor = packet.ReadInt32(); WriteLine("Required Honor Rank: " + reqHonor); var reqCity = packet.ReadInt32(); WriteLine("Required City Rank: " + reqCity); var reqRepFaction = packet.ReadInt32(); WriteLine("Required Rep Faction: " + reqRepFaction); var reqRepValue = packet.ReadInt32(); WriteLine("Required Rep Value: " + reqRepValue); var maxCount = packet.ReadInt32(); WriteLine("Max Count: " + maxCount); var stacks = packet.ReadInt32(); WriteLine("Max Stack Size: " + stacks); var contSlots = packet.ReadInt32(); WriteLine("Container Slots: " + contSlots); var statsCount = packet.ReadInt32(); WriteLine("Stats Count: " + statsCount); var type = new ItemModType[statsCount]; var value = new int[statsCount]; for (var i = 0; i < statsCount; i++) { type[i] = (ItemModType)packet.ReadInt32(); WriteLine("Stat Type " + i + ": " + type[i]); value[i] = packet.ReadInt32(); WriteLine("Stat Value " + i + ": " + value[i]); } var ssdId = packet.ReadInt32(); WriteLine("SSD ID: " + ssdId); var ssdVal = packet.ReadInt32(); WriteLine("SSD Value: " + ssdVal); var dmgMin = new float[2]; var dmgMax = new float[2]; var dmgType = new DamageType[2]; for (var i = 0; i < 2; i++) { dmgMin[i] = packet.ReadSingle(); WriteLine("Damage Min " + i + ": " + dmgMin[i]); dmgMax[i] = packet.ReadSingle(); WriteLine("Damage Max " + i + ": " + dmgMax[i]); dmgType[i] = (DamageType)packet.ReadInt32(); WriteLine("Damage Type " + i + ": " + dmgType[i]); } var resistance = new int[7]; for (var i = 0; i < 7; i++) { resistance[i] = packet.ReadInt32(); WriteLine((DamageType)i + " Resistance: " + resistance[i]); } var delay = packet.ReadInt32(); WriteLine("Delay: " + delay); var ammoType = (AmmoType)packet.ReadInt32(); WriteLine("Ammo Type: " + ammoType); var rangedMod = packet.ReadSingle(); WriteLine("Ranged Mod: " + rangedMod); var spellId = new int[5]; var spellTrigger = new ItemSpellTriggerType[5]; var spellCharges = new int[5]; var spellCooldown = new int[5]; var spellCategory = new int[5]; var spellCatCooldown = new int[5]; for (var i = 0; i < 5; i++) { spellId[i] = packet.ReadInt32(); WriteLine("Triggered Spell ID " + i + ": " + spellId[i]); spellTrigger[i] = (ItemSpellTriggerType)packet.ReadInt32(); WriteLine("Triggered Spell Type " + i + ": " + spellTrigger[i]); spellCharges[i] = packet.ReadInt32(); WriteLine("Triggered Spell Charges " + i + ": " + spellCharges[i]); spellCooldown[i] = packet.ReadInt32(); WriteLine("Triggered Spell Cooldown " + i + ": " + spellCooldown[i]); spellCategory[i] = packet.ReadInt32(); WriteLine("Triggered Spell Category " + i + ": " + spellCategory[i]); spellCatCooldown[i] = packet.ReadInt32(); WriteLine("Triggered Spell Category Cooldown " + i + ": " + spellCatCooldown[i]); } var binding = (ItemBonding)packet.ReadInt32(); WriteLine("Bonding: " + binding); var description = packet.ReadCString(); WriteLine("Description: " + description); var pageText = packet.ReadInt32(); WriteLine("Page Text: " + pageText); var langId = (Language)packet.ReadInt32(); WriteLine("Language ID: " + langId); var pageMat = (PageMaterial)packet.ReadInt32(); WriteLine("Page Material: " + pageMat); var startQuest = packet.ReadInt32(); WriteLine("Start Quest: " + startQuest); var lockId = packet.ReadInt32(); WriteLine("Lock ID: " + lockId); var material = (Material)packet.ReadInt32(); WriteLine("Material: " + material); var sheath = (SheathType)packet.ReadInt32(); WriteLine("Sheath Type: " + sheath); var randomProp = packet.ReadInt32(); WriteLine("Random Property: " + randomProp); var randomSuffix = packet.ReadInt32(); WriteLine("Random Suffix: " + randomSuffix); var block = packet.ReadInt32(); WriteLine("Block: " + block); var itemSet = packet.ReadInt32(); WriteLine("Item Set: " + itemSet); var maxDura = packet.ReadInt32(); WriteLine("Max Durability: " + maxDura); var area = packet.ReadInt32(); WriteLine("Area: " + area); var map = packet.ReadInt32(); WriteLine("Map: " + map); var bagFamily = (BagFamilyMask)packet.ReadInt32(); WriteLine("Bag Family: " + bagFamily); var totemCat = (TotemCategory)packet.ReadInt32(); WriteLine("Totem Category: " + totemCat); var color = new ItemSocketColor[3]; var content = new int[3]; for (var i = 0; i < 3; i++) { color[i] = (ItemSocketColor)packet.ReadInt32(); WriteLine("Socket Color " + i + ": " + color[i]); content[i] = packet.ReadInt32(); WriteLine("Socket Item " + i + ": " + content[i]); } var socketBonus = packet.ReadInt32(); WriteLine("Socket Bonus: " + socketBonus); var gemProps = packet.ReadInt32(); WriteLine("Gem Properties: " + gemProps); var reqDisEnchSkill = packet.ReadInt32(); WriteLine("Required Disenchant Skill: " + reqDisEnchSkill); var armorDmgMod = packet.ReadSingle(); WriteLine("Armor Damage Modifier: " + armorDmgMod); var duration = packet.ReadInt32(); WriteLine("Duration: " + duration); var limitCategory = packet.ReadInt32(); WriteLine("Limit Category: " + limitCategory); var holidayId = (Holiday)packet.ReadInt32(); WriteLine("Holiday: " + holidayId); }
public int GetBonus(ItemModType type) { var t = (int)type; foreach(Bonus b in bonuses) { if(b.Type == (int)type) { return b.Value; } } return 0; }