I do not feel proud at all for making this, how unoptimized is it, I don't think its use-able is it? Everything works but...
The script updates the dynamic tooltip for the players hero, Q W E R T F D without having to use abilcode
Players only have 1 hero, MOBA map, max 9 players. So at most, 9 people can proc this with their hero
The script updates the dynamic tooltip for the players hero, Q W E R T F D without having to use abilcode
Players only have 1 hero, MOBA map, max 9 players. So at most, 9 people can proc this with their hero
JASS:
// Dynamic setting for abilities
constant string COLOR_GOLD = "|cffffd700"
constant string COLOR_RED = "|cffff3b3b"
constant string COLOR_BLUE = "|cff1e90ff"
constant string COLOR_GREEN = "|cff03cf64"
constant string COLOR_GRAY = "|cffc0c0c0"
constant string COLOR_RESET = "|r"
ability array abil_Q
ability array abil_W
ability array abil_E
ability array abil_R
ability array abil_T
ability array abil_F
ability array abil_D
string array abil_Q_Normal
string array abil_Q_NormalExtended
string array abil_W_Normal
string array abil_W_NormalExtended
string array abil_E_Normal
string array abil_E_NormalExtended
string array abil_R_Normal
string array abil_R_NormalExtended
string array abil_T_Normal
string array abil_T_NormalExtended
string array abil_F_Normal
string array abil_F_NormalExtended
string array abil_D_Normal
string array abil_D_NormalExtended
init
dynamicUpdateTooltip_init()
function abilityLevel(unit u, ability abil_) returns int
return GetUnitAbilityLevel(u, BlzGetAbilityId(abil_))
function dynamicTooltip_Cond() returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO)
function dynamicUpdateTooltip_Act() // (Dynamic Tooltip) updates on hero level up, skill learn/upgrade or item gain/drop
let u = GetTriggerUnit()
let id = u.getOwner().getId()
let str = u.getStr(true)
let agi = u.getAgi(true)
let intel = u.getInt(true)
string array abilNormal
string array abilNormalExt
ability array abilArray
ability spell
for i = 0 to 6
spell = BlzGetUnitAbilityByIndex(u, i)
if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 0 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 2 and spell != null // Q
abil_Q[id] = spell
abilArray[0] = spell
if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 1 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 2 and spell != null // W
abil_W[id] = spell
abilArray[1] = spell
if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 2 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 2 and spell != null // E
abil_E[id] = spell
abilArray[2] = spell
if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 3 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 2 and spell != null // R
abil_R[id] = spell
abilArray[3] = spell
if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 3 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 1 and spell != null // T
abil_T[id] = spell
abilArray[4] = spell
if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 2 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 1 and spell != null // F
abil_F[id] = spell
abilArray[5] = spell
if BlzGetAbilityPosX(BlzGetAbilityId(spell)) == 1 and BlzGetAbilityPosY(BlzGetAbilityId(spell)) == 1 and spell != null // D
abil_D[id] = spell
abilArray[6] = spell
// ----------------------------- Variables Config -----------------------------
// Ability Q is: abil_Q[id]
// Ability W is: abil_W[id]
// Ability E is: abil_E[id]
// Ability R is: abil_R[id]
// Ability T is: abil_T[id]
// Ability F is: abil_F[id]
// Ability D is: abil_D[id]
// ----------------------------- Variables Config -----------------------------
// ------------------------------------------------ Hero Ver. 1 ------------------------------------------------
if u.getTypeId() == 'H049' // Hero Ver. 1
let DMG_Q = 100*abilityLevel(u, abil_Q[id]) // 100, 200, 300, 400, 500
let DMG_W = (1+abilityLevel(u, abil_W[id]))*agi // 2, 3, 4, 5, 6
let DMG_E = ((0.5*(abilityLevel(u, abil_E[id])-1)+1) * agi).toInt() // 1, 1.5, 2, 2.5, 3
let DMG_R = (9+abilityLevel(u, abil_R[id]))*agi // 10, 11, 12
let DMG_T = 15*agi // 15
let DMG_F = (9+abilityLevel(u, abil_F[id]))*agi // 10, 11, 12
let DMG_D = 0 // 0
// --------------------------------------------- Ability Translations --------------------------------------------
abil_Q_Normal[id] = COLOR_BLUE+"Fireball Spitter"+COLOR_RESET
abil_Q_NormalExtended[id] = COLOR_GOLD+"The Fireball Spitter is a very potent ability, it spits so hard Gajeel wants to fall over and fart.|n|n"+
"This powerful ability deals ("+COLOR_GREEN+(DMG_Q).toString()+COLOR_GOLD+") damage.|n"+
"Fireball spit your enemies!"+COLOR_RESET
abil_W_Normal[id] = COLOR_BLUE+"Ass Smash 1"+COLOR_RESET
abil_W_NormalExtended[id] = COLOR_GOLD+"The Ass Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+ (DMG_W).toString() +COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_E_Normal[id] = COLOR_BLUE+"Ass Smash 2"+COLOR_RESET
abil_E_NormalExtended[id] = COLOR_GOLD+"The Ass Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+ (DMG_E).toString() +COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_R_Normal[id] = COLOR_BLUE+"Ass Smash 3"+COLOR_RESET
abil_R_NormalExtended[id] = COLOR_GOLD+"The Butt Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+ (DMG_R).toString() +COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_T_Normal[id] = COLOR_BLUE+GetAbilityName(BlzGetAbilityId(abil_T[id]))+COLOR_RESET
abil_T_NormalExtended[id] = COLOR_GOLD+"The Ass Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+(DMG_T).toString()+COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_F_Normal[id] = COLOR_BLUE+"Ass Smash 5"+COLOR_RESET
abil_F_NormalExtended[id] = COLOR_GOLD+"The Ass Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+(DMG_F).toString()+COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_D_Normal[id] = GetAbilityName(BlzGetAbilityId(abil_D[id]))
abil_D_NormalExtended[id] = "Normal Extended. This unit has "+str.toString()+" strength and "+intel.toString()+" intelligence, and does Damage: "+DMG_D.toString()
// --------------------------------------- Ability Translations --------------------------------------
// ------------------------------------------------ Hero Ver. 2 ------------------------------------------------
if u.getTypeId() == 'H045' // Hero Ver. 2
let DMG_Q = 100*abilityLevel(u, abil_Q[id]) // 100, 200, 300, 400, 500
let DMG_W = (1+abilityLevel(u, abil_W[id]))*intel // 2, 3, 4, 5, 6
let DMG_E = ((0.5*(abilityLevel(u, abil_E[id])-1)+1) * intel).toInt() // 1, 1.5, 2, 2.5, 3
let DMG_R = (9+abilityLevel(u, abil_R[id]))*intel // 10, 11, 12
let DMG_T = 15*intel // 15
let DMG_F = (9+abilityLevel(u, abil_F[id]))*intel // 10, 11, 12
let DMG_D = 0 // 0
// --------------------------------------------- Ability Translations --------------------------------------------
abil_Q_Normal[id] = COLOR_BLUE+"Fireball Spitter"+COLOR_RESET
abil_Q_NormalExtended[id] = COLOR_GOLD+"The Fireball Spitter is a very potent ability, it spits so hard Gajeel wants to fall over and fart.|n|n"+
"This powerful ability deals ("+COLOR_GREEN+(DMG_Q).toString()+COLOR_GOLD+") damage.|n"+
"Fireball spit your enemies!"+COLOR_RESET
abil_W_Normal[id] = COLOR_BLUE+"Ass Smash 1"+COLOR_RESET
abil_W_NormalExtended[id] = COLOR_GOLD+"The Ass Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+ (DMG_W).toString() +COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_E_Normal[id] = COLOR_BLUE+"Ass Smash 2"+COLOR_RESET
abil_E_NormalExtended[id] = COLOR_GOLD+"The Ass Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+ (DMG_E).toString() +COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_R_Normal[id] = COLOR_BLUE+"Ass Smash 3"+COLOR_RESET
abil_R_NormalExtended[id] = COLOR_GOLD+"The Butt Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+ (DMG_R).toString() +COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_T_Normal[id] = COLOR_BLUE+GetAbilityName(BlzGetAbilityId(abil_T[id]))+COLOR_RESET
abil_T_NormalExtended[id] = COLOR_GOLD+"The Ass Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+(DMG_T).toString()+COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_F_Normal[id] = COLOR_BLUE+"Ass Smash 5"+COLOR_RESET
abil_F_NormalExtended[id] = COLOR_GOLD+"The Ass Smash has such destructive force, ones ass cease to exist when hit by this.|n|n"+
"Ass Smash deals ("+COLOR_GREEN+(DMG_F).toString()+COLOR_GOLD+") damage.|n"+
"Smash any enemies you come across!"+COLOR_RESET
abil_D_Normal[id] = GetAbilityName(BlzGetAbilityId(abil_D[id]))
abil_D_NormalExtended[id] = "Normal Extended. This unit has "+str.toString()+" strength and "+intel.toString()+" intelligence, and does Damage: "+DMG_D.toString()
// --------------------------------------- Ability Translations --------------------------------------
// ------------ Update translations ------------
abilNormal[0] = abil_Q_Normal[id]
abilNormalExt[0] = abil_Q_NormalExtended[id]
abilNormal[1] = abil_W_Normal[id]
abilNormalExt[1] = abil_W_NormalExtended[id]
abilNormal[2] = abil_E_Normal[id]
abilNormalExt[2] = abil_E_NormalExtended[id]
abilNormal[3] = abil_R_Normal[id]
abilNormalExt[3] = abil_R_NormalExtended[id]
abilNormal[4] = abil_T_Normal[id]
abilNormalExt[4] = abil_T_NormalExtended[id]
abilNormal[5] = abil_F_Normal[id]
abilNormalExt[5] = abil_F_NormalExtended[id]
abilNormal[6] = abil_D_Normal[id]
abilNormalExt[6] = abil_D_NormalExtended[id]
// ------------ Update translations ------------
// ------------------------------------ Apply Translations ------------------------------------
for i = 0 to 6
if abilArray[i] != null and abilNormal[i] != null and abilNormalExt[i] != null
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL, 0, abilNormal[i])
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL, 1, abilNormal[i])
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL, 2, abilNormal[i])
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL, 3, abilNormal[i])
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL, 4, abilNormal[i])
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, 0, abilNormalExt[i])
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, 1, abilNormalExt[i])
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, 2, abilNormalExt[i])
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, 3, abilNormalExt[i])
BlzSetAbilityStringLevelField(abilArray[i], ABILITY_SLF_TOOLTIP_NORMAL_EXTENDED, 4, abilNormalExt[i])
// ------------------------------------ Apply Translations ------------------------------------
function dynamicUpdateTooltip_init()
CreateTrigger()
..registerAnyUnitEvent(EVENT_PLAYER_HERO_LEVEL)
..registerAnyUnitEvent(EVENT_PLAYER_UNIT_PICKUP_ITEM)
..registerAnyUnitEvent(EVENT_PLAYER_UNIT_DROP_ITEM)
..registerAnyUnitEvent(EVENT_PLAYER_HERO_SKILL)
..registerAnyUnitEvent(EVENT_PLAYER_UNIT_SPELL_CAST)
..addCondition(Condition (function dynamicTooltip_Cond))
..addAction(function dynamicUpdateTooltip_Act)