r45018 - trunk/HellbenderDKP

0 views
Skip to first unread message

svnco...@wowace.com

unread,
Jul 27, 2007, 6:02:23 PM7/27/07
to wowace-gar...@googlegroups.com
Author: earthbane
Date: Fri Jul 27 18:02:23 2007
New Revision: 45018

Log:
HellbenderDKP: Initial import
- Hellbender DKP will dynamically calculate item DKP values from preset weights on item attributes.

Added:
trunk/HellbenderDKP/
trunk/HellbenderDKP/ClassItemUsage.lua (contents, props changed)
trunk/HellbenderDKP/CostModifiers.lua (contents, props changed)
trunk/HellbenderDKP/Hellbender.lua (contents, props changed)
trunk/HellbenderDKP/Hellbender.toc (contents, props changed)
trunk/HellbenderDKP/Locale-enUS.lua (contents, props changed)

Added: trunk/HellbenderDKP/ClassItemUsage.lua
==============================================================================
--- (empty file)
+++ trunk/HellbenderDKP/ClassItemUsage.lua Fri Jul 27 18:02:23 2007
@@ -0,0 +1,176 @@
+
+
+local BC = AceLibrary("Babble-Class-2.2");
+local BI = AceLibrary("Babble-Inventory-2.2");
+local L = AceLibrary("AceLocale-2.2"):new("Hellbender");
+
+--[[
+ Mark the primary users of each armor type.
+
+ Each class should only appear once as their primary armor
+ type even if they can us a different type (i.e. Druids are primary
+ Leather users even though they can us Cloth
+]]--
+ArmorUse = {
+ [BI['Cloth']] = {
+ [BC['Mage']] = 1,
+ [BC['Priest']] = 1,
+ [BC['Warlock']] = 1,
+ },
+ [BI['Leather']] = {
+ [BC['Druid']] = 1,
+ [BC['Rogue']] = 1,
+ },
+ [BI['Mail']] = {
+ [BC['Hunter']] = 1,
+ [BC['Shaman']] = 1,
+ },
+ [BI['Plate']] = {
+ [BC['Paladin']] = 1,
+ [BC['Warrior']] = 1,
+ },
+ [BI['Idol']] = {
+ [BC['Druid']] = 1,
+ },
+ [BI['Libram']] = {
+ [BC['Paladin']] = 1,
+ },
+ [BI['Shield']] = {
+ [BC['Paladin']] = 1,
+ [BC['Shaman']] = 1,
+ [BC['Warrior']] = 1,
+ },
+ [BI['Miscellaneous']] = {
+ [BC['Priest']] = 1,
+ [BC['Rogue']] = 1,
+ [BC['Warrior']] = 1,
+ [BC['Mage']] = 1,
+ [BC['Druid']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Warlock']] = 1,
+ [BC['Shaman']] = 1,
+ [BC['Paladin']] = 1,
+ }
+}
+
+--[[
+ Mark the eligable users of each weapon type
+]]--
+WeaponUse = {
+ [BI['Bows']] = {
+ [BC['Warrior']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Rogue']] = 1,
+ },
+ [BI['Crossbows']] = {
+ [BC['Warrior']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Rogue']] = 1,
+ },
+ [BI['Daggers']] = {
+ [BC['Priest']] = 1,
+ [BC['Rogue']] = 1,
+ [BC['Warrior']] = 1,
+ [BC['Mage']] = 1,
+ [BC['Druid']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Warlock']] = 1,
+ [BC['Shaman']] = 1,
+ },
+ [BI['Guns']] = {
+ [BC['Rogue']] = 1,
+ [BC['Warrior']] = 1,
+ [BC['Hunter']] = 1,
+ },
+ [BI['Fist Weapons']] = {
+ [BC['Rogue']] = 1,
+ [BC['Warrior']] = 1,
+ [BC['Druid']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Shaman']] = 1,
+ },
+ [BI['One-Handed Axes']] = {
+ [BC['Warrior']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Shaman']] = 1,
+ [BC['Paladin']] = 1,
+ },
+ [BI['One-Handed Maces']] = {
+ [BC['Priest']] = 1,
+ [BC['Rogue']] = 1,
+ [BC['Warrior']] = 1,
+ [BC['Druid']] = 1,
+ [BC['Warlock']] = 1,
+ [BC['Shaman']] = 1,
+ [BC['Paladin']] = 1,
+ },
+ [BI['One-Handed Swords']] = {
+ [BC['Rogue']] = 1,
+ [BC['Warrior']] = 1,
+ [BC['Mage']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Warlock']] = 1,
+ [BC['Paladin']] = 1,
+ },
+ [BI['Polearms']] = {
+ [BC['Warrior']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Paladin']] = 1,
+ },
+ [BI['Staves']] = {
+ [BC['Priest']] = 1,
+ [BC['Warrior']] = 1,
+ [BC['Mage']] = 1,
+ [BC['Druid']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Warlock']] = 1,
+ [BC['Shaman']] = 1,
+ },
+ [BI['Thrown']] = {
+ [BC['Rogue']] = 1,
+ [BC['Warrior']] = 1,
+ [BC['Hunter']] = 1,
+ },
+ [BI['Two-Handed Axes']] = {
+ [BC['Warrior']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Shaman']] = 1,
+ [BC['Paladin']] = 1,
+ },
+ [BI['Two-Handed Maces']] = {
+ [BC['Warrior']] = 1,
+ [BC['Druid']] = 1,
+ [BC['Shaman']] = 1,
+ [BC['Paladin']] = 1,
+ },
+ [BI['Two-Handed Swords']] = {
+ [BC['Warrior']] = 1,
+ [BC['Hunter']] = 1,
+ [BC['Paladin']] = 1,
+ },
+ [BI['Wands']] = {
+ [BC['Priest']] = 1,
+ [BC['Mage']] = 1,
+ [BC['Warlock']] = 1,
+ },
+}
+
+--[[
+ These are the stats that would flag a weapon as being
+ for casters. These do not apply to ranged weapons
+]]--
+
+CasterFlags = {
+ INT = true,
+ MANAGEN = true,
+ DMG = true,
+ HEAL = true,
+ CR_SPELLCRIT = true,
+ CR_SPELLHIT = true,
+ SPELLPEN = true,
+}
+
+NonCasterRangedLocations = {
+ ['INVTYPE_RANGED'] = true,
+ ['INVTYPE_THROWN'] = true,
+}
\ No newline at end of file

Added: trunk/HellbenderDKP/CostModifiers.lua
==============================================================================
--- (empty file)
+++ trunk/HellbenderDKP/CostModifiers.lua Fri Jul 27 18:02:23 2007
@@ -0,0 +1,381 @@
+--[[
+ DMG => +Healing & Damage Spells
+ CR_HIT => + to Melee hit
+]]--
+
+local BC = AceLibrary("Babble-Class-2.2");
+local BI = AceLibrary("Babble-Inventory-2.2");
+local L = AceLibrary("AceLocale-2.2"):new("Hellbender");
+
+StatModifiers = {
+ [L['SpellGeneric']] = {
+ STA = 0.20,
+ INT = 0.24,
+ SPI = 0.19,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ MANAREG = 0.30,
+ HEALTHREG = 0.30,
+ DMG = 0.12,
+ ARCANEDMG = 0.10,
+ FIREDMG = 0.10,
+ FROSTDMG = 0.10,
+ NATUREDMG = 0.10,
+ SHADOWDMG = 0.10,
+ DMGUNDEAD = 0.10,
+ HOLYDMG = 0.10,
+ HEAL = 0.025,
+ CR_SPELLCRIT = 0.2,
+ CR_SPELLCRITSingle = 0.2,
+ CR_SPELLHIT = 0.25,
+ STR = 0.13,
+ SPELLPEN = 0.15,
+ },
+ [BC['Mage']] = {
+ STA = 0.18,
+ INT = 0.25,
+ SPI = 0.17,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ MANAREG = 0.30,
+ HEALTHREG = 0.15,
+ DMG = 0.15,
+ ARCANEDMG = 0.10,
+ FIREDMG = 0.10,
+ FROSTDMG = 0.10,
+ NATUREDMG = 0.10,
+ SHADOWDMG = 0.10,
+ DMGUNDEAD = 0.10,
+ HOLYDMG = 0.10,
+ CR_SPELLCRIT = 0.215,
+ CR_SPELLCRITSingle = 0.215,
+ CR_SPELLHIT = 0.25,
+ SPELLPEN = 0.15,
+ },
+ [BC['Warlock']] = {
+ STA = 0.25,
+ INT = 0.20,
+ SPI = 0.15,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ MANAREG = 0.25,
+ HEALTHREG = 0.50,
+ DMG = 0.15,
+ ARCANEDMG = 0.10,
+ FIREDMG = 0.10,
+ FROSTDMG = 0.10,
+ NATUREDMG = 0.10,
+ SHADOWDMG = 0.10,
+ DMGUNDEAD = 0.10,
+ HOLYDMG = 0.10,
+ CR_SPELLCRIT = 0.215,
+ CR_SPELLCRITSingle = 0.215,
+ CR_SPELLHIT = 0.25,
+ SPELLPEN = 0.15,
+ HEAL = 0.0,
+ },
+ [BC['Priest']] = {
+ STA = 0.15,
+ INT = 0.25,
+ SPI = 0.22,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ MANAREG = 0.37,
+ HEALTHREG = 0.20,
+ DMG = 0.13,
+ ARCANEDMG = 0.13,
+ FIREDMG = 0.13,
+ FROSTDMG = 0.13,
+ NATUREDMG = 0.13,
+ SHADOWDMG = 0.13,
+ DMGUNDEAD = 0.13,
+ HOLYDMG = 0.13,
+ HEAL = 0.08,
+ CR_SPELLCRIT = 0.08,
+ CR_SPELLCRITSingle = 0.08,
+ CR_SPELLHIT = 0.05,
+ SPELLPEN = 0.10,
+ },
+ [BC['Druid']] = {
+ STA = 0.15,
+ INT = 0.28,
+ SPI = 0.17,
+ AGI = 0.13,
+ STR = 0.13,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ MANAREG = 0.40,
+ DMG = 0.11,
+ ARCANEDMG = 0.11,
+ FIREDMG = 0.11,
+ FROSTDMG = 0.11,
+ NATUREDMG = 0.11,
+ SHADOWDMG = 0.11,
+ DMGUNDEAD = 0.11,
+ HOLYDMG = 0.11,
+ HEAL = 0.08,
+ CR_HIT = 0.12,
+ CR_CRIT = 0.08,
+ CR_SPELLCRIT = 0.08,
+ CR_SPELLCRITSingle = 0.08,
+ CR_SPELLHIT = 0.05,
+ SPELLPEN = 0.10,
+ ATTACKPOWERFERAL = 0.05,
+ },
+ [BC['Paladin']] = {
+ STA = 0.20,
+ INT = 0.25,
+ SPI = 0.15,
+ AGI = 0.13,
+ STR = 0.15,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ MANAREG = 0.35,
+ DMG = 0.08,
+ ARCANEDMG = 0.08,
+ FIREDMG = 0.08,
+ FROSTDMG = 0.08,
+ NATUREDMG = 0.08,
+ SHADOWDMG = 0.08,
+ DMGUNDEAD = 0.08,
+ HOLYDMG = 0.08,
+ HEAL = 0.08,
+ CR_HIT = 0.12,
+ CR_CRIT = 0.11,
+ CR_SPELLCRIT = 0.11,
+ CR_SPELLCRITSingle = 0.08,
+ CR_SPELLHIT = 0.05,
+ CR_PARRY = 0.05,
+ ARMOR = 0.001,
+ SPELLPEN = 0.10,
+ },
+ [L['MeleeGeneric']] = {
+ STA = 0.22,
+ STR = 0.20,
+ AGI = 0.22,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ HEALTHREG = 0.50,
+ CR_HIT = 0.18,
+ CR_CRIT = 0.215,
+ ATTACKPOWER = 0.00,
+ CR_DEFENSE = 0.20,
+ CR_PARRY = 0.1,
+ CR_DODGE = 0,
+ },
+ [BC['Rogue']] = {
+ STA = 0.20,
+ STR = 0.10,
+ AGI = 0.30,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ CR_HIT = 0.18,
+ CR_CRIT = 0.215,
+ ATTACKPOWER = 0.11,
+ },
+ [BC['Hunter']] = {
+ STA = 0.20,
+ AGI = 0.27,
+ INT = 0.15,
+ SPI = 0.10,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ CR_HIT = 0.18,
+ CR_CRIT = 0.215,
+ ATTACKPOWER = 0.10,
+ RANGEDATTACKPOWER = 0.10,
+ },
+ [BC['Warrior']] = {
+ STA = 0.25,
+ STR = 0.23,
+ AGI = 0.15,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ HEALTHREG = 0.50,
+ CR_HIT = 0.18,
+ CR_CRIT = 0.215,
+ ATTACKPOWER = 0.09,
+ CR_DEFENSE = 0.20,
+ CR_PARRY = 0.1,
+ CR_DODGE = 0.1,
+ CR_BLOCK = 0.1,
+ ARMOR = 0.002,
+ },
+ [BC['Shaman']] = {
+ STA = 0.20,
+ INT = 0.28,
+ SPI = 0.15,
+ AGI = 0.13,
+ STR = 0.15,
+ ARCANERES = 0.10,
+ FIRERES = 0.10,
+ FROSTRES = 0.10,
+ NATURERES = 0.10,
+ SHADOWRES = 0.10,
+ MANAREG = 0.30,
+ DMG = 0.08,
+ ARCANEDMG = 0.08,
+ FIREDMG = 0.08,
+ FROSTDMG = 0.08,
+ NATUREDMG = 0.08,
+ SHADOWDMG = 0.08,
+ DMGUNDEAD = 0.08,
+ HOLYDMG = 0.08,
+ HEAL = 0.06,
+ CR_HIT = 0.12,
+ CR_CRIT = 0.08,
+ CR_SPELLCRIT = 0.11,
+ CR_SPELLCRITSingle = 0.20,
+ CR_SPELLHIT = 0.04,
+ SPELLPEN = 0.10,
+ },
+};
+
+ItemSlotWeights = {
+ ["INVTYPE_TRINKET"] = 1.5,
+ ["INVTYPE_FINGER"] = 1.5,
+ ["INVTYPE_NECK"] = 1.5,
+ ["INVTYPE_CLOAK"] = 1.2,
+ ["INVTYPE_RELIC"] = 2.0,
+ ["INVTYPE_RANGEDRIGHT"] = 2.6, -- Wand
+ ["INVTYPE_SHIELD"] = 1.2,
+};
+
+WeaponTypeWeights = {
+ [BI['Shield']] = 1.2,
+ [BI["Wands"]] = 2.6,
+};
+
+WarriorWeaponsWeights = {
+ ["INVTYPE_WEAPON"] = {
+ [BI["One-Handed Axes"]] = { dps = 0.47, top = 0.22, sub = 71.73},
+ [BI["One-Handed Swords"]] = { dps = 0.47, top = 0.22, sub = 72.10},
+ [BI["One-Handed Maces"]] = { dps = 0.48, top = 0.22, sub = 71.56},
+ [BI["Daggers"]] = { dps = 0.47, top = 0.29, sub = 66.04},
+ },
+ ["INVTYPE_2HWEAPON"] = {
+ [BI["Two-Handed Axes"]] = { dps = 0.42, top = 0.16, sub = 86.71},
+ [BI["Two-Handed Swords"]] = { dps = 0.40, top = 0.18, sub = 87.98},
+ [BI["Two-Handed Maces"]] = { dps = 0.43, top = 0.17, sub = 86.76},
+ [BI["Polearms"]] = { dps = 0.43, top = 0.18, sub = 86.01},
+ },
+ ["INVTYPE_WEAPONMAINHAND"] = {
+ [BI["One-Handed Axes"]] = { dps = 0.47, top = 0.22, sub = 71.73},
+ [BI["One-Handed Swords"]] = { dps = 0.47, top = 0.22, sub = 72.10},
+ [BI["One-Handed Maces"]] = { dps = 0.48, top = 0.22, sub = 71.56},
+ [BI["Daggers"]] = { dps = 0.47, top = 0.29, sub = 66.04},
+ [BI["Fist Weapons"]] = { dps = 0.47, top = 0.29, sub = 72.10},
+ },
+ ["INVTYPE_WEAPONOFFHAND"] = {
+ [BI["One-Handed Axes"]] = { dps = 0.47, top = 0.22, sub = 71.73},
+ [BI["One-Handed Swords"]] = { dps = 0.47, top = 0, sub = 72.10},
+ [BI["One-Handed Maces"]] = { dps = 0.48, top = 0.22, sub = 71.56},
+ [BI["Daggers"]] = { dps = 0.47, top = 0.29, sub = 66.04},
+ [BI["Fist Weapons"]] = { dps = 0.47, top = 0, sub = 66.68},
+ },
+};
+
+RogueWeaponsWeights = {
+ -- One Hand Weapons
+ ["INVTYPE_WEAPON"] = {
+ [BI["One-Handed Swords"]] = { dps = 0.52, top = 0.30, sub = 84.62},
+ [BI["One-Handed Maces"]] = { dps = 0.52, top = 0.30, sub = 81.52},
+ [BI["Daggers"]] = { dps = 0.52, top = 0.39, sub = 79.66},
+ },
+ ["INVTYPE_WEAPONMAINHAND"] = {
+ [BI["One-Handed Swords"]] = { dps = 0.52, top = 0.30, sub = 84.62},
+ [BI["One-Handed Maces"]] = { dps = 0.52, top = 0.30, sub = 84.62},
+ [BI["Daggers"]] = { dps = 0.52, top = 0.39, sub = 79.66},
+ [BI["Fist Weapons"]] = { dps = 0.52, top = 0.30, sub = 84.62},
+ },
+ ["INVTYPE_WEAPONOFFHAND"] = {
+ [BI["One-Handed Swords"]] = { dps = 0.52, top = 0, sub = 39.84},
+ [BI["One-Handed Maces"]] = { dps = 0.52, top = 0.30, sub = 84.62},
+ [BI["Daggers"]] = { dps = 0.52, top = 0.39, sub = 79.66},
+ [BI["Fist Weapons"]] = { dps = 0.52, top = 0, sub = 39.84},
+ },
+};
+
+CasterWeaponsWeights = {
+ ["INVTYPE_WEAPON"] = {
+ [BI["One-Handed Axes"]] = { dps = 0.47, top = 0.35, sub = 89.96},
+ [BI["One-Handed Maces"]] = { dps = 0.48, top = 0.34, sub = 89.32},
+ [BI["Daggers"]] = { dps = 0.47, top = 0.55, sub = 89.96},
+ },
+ ["INVTYPE_2HWEAPON"] = {
+ [BI["Two-Handed Axes"]] = { dps = 0.42, top = 0.22, sub = 101.4},
+ [BI["Two-Handed Maces"]] = { dps = 0.43, top = 0.23, sub = 101.43},
+ },
+ ["INVTYPE_WEAPONMAINHAND"] = {
+ [BI["One-Handed Axes"]] = { dps = 0.47, top = 0.35, sub = 89.96},
+ [BI["One-Handed Maces"]] = { dps = 0.48, top = 0.34, sub = 89.32},
+ [BI["Daggers"]] = { dps = 0.47, top = 0.55, sub = 89.96},
+ [BI["Fist Weapons"]] = { dps = 0.49, top = 0.54, sub = 87.77},
+ },
+ ["INVTYPE_WEAPONOFFHAND"] = {
+ [BI["Fist Weapons"]] = { dps = 0.49, top = 0.54, sub = 87.09},
+ },
+};
+
+HunterWeaponsWeights = {
+ ["INVTYPE_WEAPON"] = {
+ [BI["Axe"]] = { dps = 0.47, top = 0, sub = 39.05 },
+ [BI["Sword"]] = { dps = 0.47, top = 0, sub = 39.06 },
+ [BI["Dagger"]] = { dps = 0.47, top = 0, sub = 39.03 },
+ },
+ ["INVTYPE_2HWEAPON"] = {
+ [BI["Axe"]] = { dps = 0.42, top = 0, sub = 45.03 },
+ [BI["Sword"]] = { dps = 0.40, top = 0, sub = 46.44 },
+ [BI["Polearm"]] = { dps = 0.43, top = 0, sub = 46.15 },
+ },
+ ["INVTYPE_WEAPONMAINHAND"] = {
+ [BI["Axe"]] = { dps = 0.47, top = 0, sub = 39.05 },
+ [BI["Sword"]] = { dps = 0.47, top = 0, sub = 39.06 },
+ [BI["Dagger"]] = { dps = 0.47, top = 0, sub = 39.03 },
+ [BI["Fist Weapon"]] = { dps = 0.49, top = 0, sub = 38 },
+ },
+ ["INVTYPE_WEAPONOFFHAND"] = {
+ [BI["Axe"]] = { dps = 0.47, top = 0, sub = 39.05 },
+ [BI["Sword"]] = { dps = 0.47, top = 0, sub = 39.03 },
+ [BI["Dagger"]] = { dps = 0.47, top = 0, sub = 39.03 },
+ [BI["Fist Weapon"]] = { dps = 0.49, top = 0, sub = 37.87 },
+ },
+};
+
+RangedWeaponsWeights = {
+ [BI["Bows"]] = { dps = 0.50, top = 0.20, sub = 52.52 },
+ [BI["Guns"]] = { dps = 0.51, top = 0.20, sub = 51.56 },
+ [BI["Crossbows"]] = { dps = 0.51, top = 0.17, sub = 54.33 },
+ [BI["Thrown"]] = { dps = 0.50, top = 0.20, sub = 52.52 },
+ [BI["Wands"]] = { dps = 0.42, top = 0.1, sub = 49 },
+};

Added: trunk/HellbenderDKP/Hellbender.lua
==============================================================================
--- (empty file)
+++ trunk/HellbenderDKP/Hellbender.lua Fri Jul 27 18:02:23 2007
@@ -0,0 +1,464 @@
+
+--[[
+ Name: Hellbender DKP
+ Author: Earthbane @ Hellscream
+ Contact: earthb...@gishpuppy.com
+
+ Description:
+ Hellbender DKP is a replacement for HoB_DKP and works initially using the same
+ formulas as HoB_DKP. It will dynamically generate DKP values for items based on
+ the item's atributes. The importance of item atributes can be customized to tweek
+ the importance of certain stats to certain classes.
+
+ The aim for Hellbender is to be easier to customize the DKP weights and make it
+ easier for others to hack to their needs
+
+ Complimentary Addons:
+ CT_Raidtracker - Hellbender should be able to send it's DKP values to
+ CTRA when it records the item in the raid.
+--]]
+
+-------------------
+-- Localize globals
+-------------------
+local L = AceLibrary("AceLocale-2.2"):new("Hellbender");
+local BC = AceLibrary("Babble-Class-2.2");
+local BI = AceLibrary("Babble-Inventory-2.2");
+
+------------------
+-- Library Loading
+------------------
+local ibl = AceLibrary("ItemBonusLib-1.0")
+Hellbender = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0", "AceEvent-2.0", "AceDB-2.0","AceHook-2.1");
+
+-----------------------------
+-- Configure Default Settings
+-----------------------------
+local options = {
+ type='group',
+ args = {
+ debug = {
+ type = 'range',
+ name = L['Debug'],
+ desc = L['Enable debug output'],
+ get = "GetDebug",
+ set = "SetDebug",
+ min = 0,
+ max = 3,
+ },
+
+ showEligibleClasses = {
+ type = 'toggle',
+ name = L['Eligibility'],
+ desc = L['Toggle to show in tooltip those classes who are able to use the weapon'],
+ get = "ShowEligibleClasses",
+ set = "ToggleShowEligibleClasses",
+ },
+
+ showClass = {
+ type = 'toggle',
+ name = L['Class'],
+ desc = L["Toggle to show in tooltip which class's DKP modifiers were used for final DKP value"],
+ get = "ShowDKPClass",
+ set = "ToggleShowDKPClass",
+ },
+
+ dkpPrecision = {
+ type = 'range',
+ name = L['Precision'],
+ desc = L['Set precision in DKP result, how many decimal places to show.'],
+ min = 0,
+ max = 6,
+ get = "GetDKPPrecision",
+ set = "SetDKPPrecision",
+ },
+
+ dkpMultiplier = {
+ type = 'range',
+ name = L['multiplier'],
+ desc = L['Multiply the final DKP calculation by this amount'],
+ min = 1,
+ max = 100,
+ get = "GetDKPMultiplier",
+ set = "SetDKPMultiplier",
+ },
+ },
+}
+
+Hellbender:RegisterChatCommand(L["Slash-Commands"], options);
+
+Hellbender:RegisterDB("HellbenderDB","HellbenderDBPC");
+Hellbender:RegisterDefaults("profile", {
+ debug = 0,
+ showEligibleClasses = true,
+ showClass = true,
+ dkpPrecision = 2,
+ dkpMultiplier = 1,
+} )
+
+-----------------------------------
+-- Slash Command Property Functions
+-----------------------------------
+function Hellbender:GetDKPMultiplier()
+ return self.db.profile.dkpMultiplier;
+end
+
+function Hellbender:SetDKPMultiplier(NewValue)
+ self.db.profile.dkpMultiplier = NewValue;
+end
+
+function Hellbender:GetDKPPrecision()
+ return self.db.profile.dkpPrecision;
+end
+
+function Hellbender:SetDKPPrecision(NewValue)
+ self.db.profile.dkpPrecision = NewValue;
+end
+
+function Hellbender:ShowDKPClass()
+ return self.db.profile.showClass;
+end
+
+function Hellbender:ToggleShowDKPClass()
+ self.db.profile.showClass = not self.db.profile.showClass;
+end
+
+function Hellbender:ShowEligibleClasses()
+ return self.db.profile.showEligibleClasses;
+end
+
+function Hellbender:ToggleShowEligibleClasses()
+ self.db.profile.showEligibleClasses = not self.db.profile.showEligibleClasses;
+end
+
+function Hellbender:GetDebug()
+ return self.db.profile.debug;
+end
+
+function Hellbender:SetDebug(NewValue)
+ self.db.profile.debug = NewValue;
+end
+
+-----------------
+-- Event Handlers
+-----------------
+function Hellbender:OnInitialize()
+
+end
+
+function Hellbender:OnEnable()
+
+ -- Borrowed basic code and concept from TipHooker-1.0
+ tooltips = {
+ ["GameTooltip"] = true,
+ ["ItemRefTooltip"] = true,
+ ["ShoppingTooltip"] = true,
+ -- EquipCompare support
+ ["ComparisonTooltip"] = true,
+ -- EQCompare support
+ ["EQCompareTooltip"] = true,
+ -- takKompare support
+ ["tekKompareTooltip"] = true,
+ -- LinkWrangler support
+ ["IRR_"] = true,
+ ["LinkWrangler"] = true,
+ -- MultiTips support
+ -- Links support
+ ["LinksTooltip"] = true,
+ -- AtlasLoot support
+ ["AtlasLootTooltip"] = true,
+ -- ItemMagic support
+ ["ItemMagicTooltip"]= true,
+ -- Sniff support
+ ["SniffTooltip"] = true,
+ };
+
+ local tooltip = EnumerateFrames();
+ while tooltip do
+ if tooltip:GetObjectType() == "GameTooltip" then
+ local name = tooltip:GetName();
+ if name then
+ self:Debug("Found GameTooltip: "..name,1);
+ if tooltips[name] then
+ self:Debug("InitializeHook(item) = "..name,1);
+ self:HookScript(tooltip, "OnTooltipSetItem")
+ end
+ end
+ end
+ tooltip = EnumerateFrames(tooltip)
+ end
+
+ if self.db.profile.debug >= 1 then
+ self:HookReport();
+ end
+
+ if HDKP_GetDKP then
+ -- Replace call to Hob_DKP with our own magic juice
+ HDKP_GetDKP = Hellbender_HDKP_GetDKP_Hack;
+ self:Debug("HoB_DKP hook overridden",1);
+ end
+
+ self:Print("Enabled and registered");
+
+end
+
+function Hellbender:OnDisable()
+
+end
+
+
+function Hellbender:Debug(message, level)
+ if self.db.profile.debug >= level then
+ self:Print(message)
+ end
+end
+
+--------
+-- Hooks
+--------
+
+---------------------------------------------
+-- OnTooltipSetItem
+--
+-- A tooltip we hooked has recieved an item to
+-- display. We will extract the item, get the
+-- DKP value, and display it.
+---------------------------------------------
+function Hellbender:OnTooltipSetItem(tooltip,...)
+ if self.db.profile.debug >= 2 then
+ self:Print("In OnTooltipSetItem");
+ end
+ local item, link = tooltip:GetItem();
+ if not item then
+ self:Debug("No item given ("..item.." , "..link..") from "..tooltip:GetName(),2);
+ return self.hooks[tooltip].OnTooltipSetItem(tooltip, ...)
+ else
+ self:Debug("Got item ("..item.." , "..link..") from "..tooltip:GetName(),2);
+ end
+
+ local dkp, highClass, damageClass = self:GimmieDKP(link);
+
+ if highClass ~= nil then
+ self:Debug("Printing results.",1);
+
+ local dkpString = format("%."..self.db.profile.dkpPrecision.."f",dkp * self.db.profile.dkpMultiplier);
+ if self.db.profile.showClass then
+ dkpString = dkpString.." ("..highClass;
+ if damageClass ~= nil then
+ dkpString = dkpString.."/"..damageClass;
+ end
+ dkpString = dkpString..")";
+ end
+ tooltip:AddDoubleLine("DKP:",dkpString,1,1,1,1,1,1);
+ end
+
+ return self.hooks[tooltip].OnTooltipSetItem(tooltip, ...);
+end
+
+function Hellbender:GimmieDKP(itemLinkOrString)
+ local bonuses = ibl:ScanItem(itemLinkOrString,true);
+ local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount,itemEquipLoc, itemTexture = GetItemInfo(itemLinkOrString);
+
+ self:Debug(itemName..":"..itemLink..":"..itemRarity..":"..itemLevel..":"..itemMinLevel..":"..itemType..":"..itemSubType..":"..itemStackCount..":"..itemEquipLoc..":"..itemTexture,1);
+
+ if self.db.profile.debug >= 1 then
+ for stat,value in pairs(bonuses) do
+ self:Print(ibl:GetBonusFriendlyName(stat).."("..stat..") => "..value);
+ end
+ end
+
+ local slotModifier = 1;
+ local DKPValues = {};
+ local tempDKP = 0;
+ local highClass = nil;
+ local eligible = false;
+ local isCaster = false;
+ local users = {}; -- List of classes that can use item
+
+ if itemType == L['Armor'] and ItemSlotWeights[itemEquipLoc] ~= nil then
+ self:Debug("Slot Weight Adjusted. "..itemEquipLoc.." with weight "..ItemSlotWeights[itemEquipLoc],2);
+ slotModifier = ItemSlotWeights[itemEquipLoc];
+ end
+
+ -- Check if it's a caster weapon, ignore bows, xbows, and guns
+ if itemType == L['Weapon'] and NonCasterRangedLocations[itemEquipLoc] ~= nil then
+ if itemEqipLoc == "INVTYPE_RANGEDRIGHT" then
+ isCaster = true;
+ else
+ for stat,_ in pairs(bonuses) do
+ if CasterFlags[stat] ~= nil then
+ isCaster = true;
+ break;
+ end
+ end
+ end
+ end
+
+
+ --[[
+ Work out the DKP value for the stats of the item.
+
+ If it's a weapon, we will later check it's damage output
+ and add the Weapon Damage DKP to the stat DKP
+ ]]--
+ for class,weights in pairs(StatModifiers) do
+ eligible = false;
+ if itemType == L['Armor'] then
+ -- Work out if eligible class
+ self:Debug("Armor check. Class: ("..class..") Subtype: ("..itemSubType..")",2);
+ if ArmorUse[itemSubType] ~= nil and ArmorUse[itemSubType][class] ~= nil then
+ eligible = true;
+ end
+ end
+
+ if itemType == L['Weapon'] then
+ self:Debug("Weapon check. Class: ("..class..") Subtype: "..itemSubType,2);
+ if WeaponUse[itemSubType] ~= nil and WeaponUse[itemSubType][class] ~= nil then
+ self:Debug(class.." is able to use "..itemSubType,2);
+ eligible = true;
+ end
+ end
+
+ if eligible then
+ for stat,value in pairs(bonuses) do
+
+ if DKPValues[class] == nil then
+ DKPValues[class] = 0;
+ end
+
+ if weights[stat] ~= nil then
+ DKPValues[class] = DKPValues[class] + value * weights[stat] * slotModifier;
+ end
+
+ if highClass == nil then
+ highClass = class
+ else
+ if DKPValues[class] >= DKPValues[highClass] then
+ highClass = class;
+ end
+ end
+ end
+ end
+ --self:Print(key.." => "..value)
+ --tooltip:AddDoubleLine(ibl:GetBonusFriendlyName(key),value,1,1,1,r,g,b);
+ end
+
+ -- Now workout Weapon Damage DKP value
+ local damageClass = "No DMG";
+ local typeWeight = 1;
+ local weaponDKP = -1;
+ local sub = 0;
+ local dpsWeight = 1;
+ local topDamageWeight = 1;
+ local dps = 0;
+
+ if itemType == L['Weapon'] then
+
+ -- 2 Handed caster weapons will have Damage DKP included. All other caster items (save wand) have
+ -- Damage dkp values ignored
+ if isCaster and itemEquipLoc == "INVTYPE_2HWEAPON" and CasterWeaponsWeights[itemEquipLoc][itemSubType] ~= nil then
+
+ sub = CasterWeaponsWeights[itemEquipLoc][itemSubType].sub;
+ dpsWeight = CasterWeaponsWeights[itemEquipLoc][itemSubType].dps;
+ topDamageWeight = CasterWeaponsWeights[itemEquipLoc][itemSubType].top;
+
+ dps = ((bonuses["WEAPON_MAX"] + bonuses['WEAPON_MIN'])/2) / bonuses['WEAPON_SPEED'];
+ weaponDKP = (((dps * dpsWeight) + (bonuses["WEAPON_MAX"] * topDamageWeight) - sub) * 2 ) * 0.35;
+
+ -- Since only Shaman and Pallies can use these caster, we will figure out which of their
+ -- stat DKPs we will use
+ if DKPValues[BC["Shaman"]] > DKPValues[BC["Paladin"]] then
+ damageClass = BC["Shaman"];
+ else
+ damageClass = BC["Paladin"];
+ end
+
+ highClass = damageClass;
+
+ self:Debug("Caster 2H Results: "..damageClass.." ("..weaponDKP..") "..bonuses["WEAPON_MAX"]..","..bonuses["WEAPON_MIN"]..","..bonuses["WEAPON_SPEED"],1);
+ end
+
+ -- All other non-ranged weapon checks
+ -- Weapons are evaluated from a Warrior (Tank) standpoint and Rogue (Melee DPS) standpoint
+ -- The higher dkp result is the winner
+ if not isCaster and NonCasterRangedLocations[itemEquipLoc] == nil and itemEquipLoc ~= "INVTYPE_RANGEDRIGHT" then
+ -- IDEA Could possibly make this smoother. some of below is copy and pasted from above
+ local warDKP, rogueDKP = 0,0
+ dps = ((bonuses["WEAPON_MAX"] + bonuses['WEAPON_MIN'])/2) / bonuses['WEAPON_SPEED'];
+
+ if WarriorWeaponsWeights[itemEquipLoc][itemSubType] ~= nil then
+ sub = WarriorWeaponsWeights[itemEquipLoc][itemSubType].sub;
+ dpsWeight = WarriorWeaponsWeights[itemEquipLoc][itemSubType].dps;
+ topDamageWeight = WarriorWeaponsWeights[itemEquipLoc][itemSubType].top;
+
+ self:Debug("Warrior modifiers: "..sub..","..dpsWeight..","..topDamageWeight,1);
+
+ warDKP = ((dps * dpsWeight) + (bonuses["WEAPON_MAX"] * topDamageWeight) - sub) * 0.8;
+ if itemEquipLoc == "INVTYPE_2HWEAPON" then
+ warDKP = warDKP * 2;
+ end
+ end
+
+ if RogueWeaponsWeights[itemEquipLoc] ~= nil and RogueWeaponsWeights[itemEquipLoc][itemSubType] ~= nil then
+ sub = RogueWeaponsWeights[itemEquipLoc][itemSubType].sub;
+ dpsWeight = RogueWeaponsWeights[itemEquipLoc][itemSubType].dps;
+ topDamageWeight = RogueWeaponsWeights[itemEquipLoc][itemSubType].top;
+
+ self:Debug("Rogue modifiers: "..sub..","..dpsWeight..","..topDamageWeight,1);
+
+ rogueDKP = (dps * dpsWeight) + (bonuses["WEAPON_MAX"] * topDamageWeight) - sub;
+ end
+
+ if warDKP > rogueDKP then
+ weaponDKP = warDKP;
+ damageClass = BC["Warrior"];
+ else
+ damageClass = BC["Rogue"];
+ weaponDKP = rogueDKP;
+ end
+
+ self:Debug("Non-ranged melee Results: "..damageClass.." ("..weaponDKP..") "..bonuses["WEAPON_MAX"]..","..bonuses["WEAPON_MIN"]..","..bonuses["WEAPON_SPEED"],1);
+ end
+
+ -- Finish off weapon DKP calcs with ranged
+ if NonCasterRangedLocations[itemEquipLoc] ~= nil or itemEquipLoc == "INVTYPE_RANGEDRIGHT" then
+ sub = RangedWeaponsWeights[itemSubType].sub;
+ dpsWeight = RangedWeaponsWeights[itemSubType].dps;
+ topDamageWeight = RangedWeaponsWeights[itemSubType].top;
+
+ dps = ((bonuses["WEAPON_MAX"] + bonuses['WEAPON_MIN'])/2) / bonuses['WEAPON_SPEED'];
+ weaponDKP = (dps * dpsWeight) + (bonuses["WEAPON_MAX"] * topDamageWeight) - sub;
+
+ damageClass = L['Ranged'];
+
+ self:Debug("Ranged Results: "..damageClass.." ("..weaponDKP..") "..bonuses["WEAPON_MAX"]..","..bonuses["WEAPON_MIN"]..","..bonuses["WEAPON_SPEED"],1);
+
+ end
+ if WeaponTypeWeights[itemType] ~= nil then
+ weaponDKP = WeaponTypeWeights[itemType] * weaponDKP;
+ end
+
+ end
+
+ if itemType ~= L['Weapon'] then
+ damageClass = nil;
+ end
+
+ if weaponDKP > 0 then
+ DKPValues[highClass] = DKPValues[highClass] + weaponDKP;
+ end
+
+ return DKPValues[highClass], highClass, damageClass;
+end
+
+--[[
+ Taking function from HoB_DKP to work with CT_Raidassist
+]]--
+function Hellbender_HDKP_GetDKP_Hack(itemid, enchantid, subid, extra)
+ -- item:itemid:enchantid:subid:extra
+ Hellbender:Debug("In CTRT Hook: item:"..itemid..":"..enchantid..":"..subid..":"..extra,1);
+ local itemString = "item:"..itemid..":"..enchantid..":"..subid..":"..extra;
+ local dkp = Hellbender:GimmieDKP(itemString);
+ Hellbender:Debug("CTRA DKP Returned: "..dkp);
+ return dkp;
+end
\ No newline at end of file

Added: trunk/HellbenderDKP/Hellbender.toc
==============================================================================
--- (empty file)
+++ trunk/HellbenderDKP/Hellbender.toc Fri Jul 27 18:02:23 2007
@@ -0,0 +1,28 @@
+## Interface: 20100
+## Title: Hellbender DKP
+## Notes: Dynamic item DKP calculation
+## Author: Earthbane @ Hellsceam
+## eMail: earthb...@gishpuppy.com
+## Version: 1.0
+## X-Category: Raid
+## OptionalDeps: Ace2, CT_RaidAssist, Babble-2.2
+## SavedVariables: HellbenderDB
+## SavedVariablesPerCharacter: HellbenderDBPC
+
+libs\AceLibrary\AceLibrary.lua
+libs\AceOO-2.0\AceOO-2.0.lua
+libs\AceAddon-2.0\AceAddon-2.0.lua
+libs\AceConsole-2.0\AceConsole-2.0.lua
+libs\AceDB-2.0\AceDB-2.0.lua
+libs\AceEvent-2.0\AceEvent-2.0.lua
+libs\AceLocale-2.2\AceLocale-2.2.lua
+libs\AceHook-2.1\AceHook-2.1.lua
+libs\Babble-Class-2.2\Babble-Class-2.2.lua
+libs\Babble-Inventory-2.2\Babble-Inventory-2.2.lua
+libs\ItemBonusLib\ItemBonusLib-1.0\ItemBonusLib-1.0.lua
+
+
+Locale-enUS.lua
+CostModifiers.lua
+ClassItemUsage.lua
+Hellbender.lua
\ No newline at end of file

Added: trunk/HellbenderDKP/Locale-enUS.lua
==============================================================================
--- (empty file)
+++ trunk/HellbenderDKP/Locale-enUS.lua Fri Jul 27 18:02:23 2007
@@ -0,0 +1,47 @@
+local L = AceLibrary("AceLocale-2.2"):new("Hellbender");
+
+L:RegisterTranslations("enUS",
+
+ function()
+ return {
+ ["Slash-Commands"] = { "/hellbender","/hb","/snototter" },
+
+ ["Debug"] = true,
+ ["Message"] = true,
+ ['Enable debug output'] = true,
+
+ ['Eligibility'] = true,
+ ['Toggle to show in tooltip those classes who are able to use the weapon'] = true,
+
+ ['Class'] = true,
+ ["Toggle to show in tooltip which class's DKP modifiers were used for final DKP value"] = true,
+
+ ['Precision'] = true,
+ ['Set precision in DKP result, how many decimal places to show.'] = true,
+
+ ['multiplier'] = true,
+ ['Multiply the final DKP calculation by this amount'] = true,
+
+ ['SpellGeneric'] = true,
+ ['MeleeGeneric'] = true,
+
+ ['Armor'] = true,
+ ['Consumable'] = true,
+ ['Container'] = true,
+ ['Gem'] = true,
+ ['Key'] = true,
+ ['Miscellaneous'] = true,
+ ['Reagent'] = true,
+ ['Recipe'] = true,
+ ['Projectile'] = true,
+ ['Quest'] = true,
+ ['Quiver'] = true,
+ ['Trade Goods'] = true,
+ ['Weapon'] = true,
+
+ ['Caster'] = true,
+ ['Melee'] = true,
+ ['Ranged'] = true,
+ }
+ end
+)
\ No newline at end of file

Reply all
Reply to author
Forward
0 new messages