Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
TasUnitBonus is a unit Stat Lua system for Warcraft 3 V1.31 or higher, also can be used by GUI.
It gives an one way api to inc/dec unit stats, the types of stats is "easy" expandable. Includes addons to handle bonus over Buffs, Items, LevelUps, Learning Skills & Skill-Fields.
To increase a stat of an unit using TasUnitBonus you would run TasUnitBonus(unit, key, value) key is one of the supported keys of TasUnitBonus. As said before you can add own custom keys/stats pretty easy, checkout the examples at the bottom.
The main System contains prebuilt warcraft 3 stats, the stats prebuilt only use code no ability-features -> no object Editor setup required.
Life -- max life + heal
Mana
MaxLife --no heal
MaxMana
LifeReg
ManaReg
Armor
Attack
AttackM -- only Melee
AttackR -- only Ranged
AttackSpeed
AttackSpeedM
AttackSpeedR
AttackRange -- (Not V1.31.1)
AttackRangeR -- (Not V1.31.1) only Ranged
MoveSpeed
Agi
Str
Int
Primary
StrAgiInt
CastPoint
CastBackswing
TurnSpeed
UnitLevel
HeroLevel
EXP -- hero EXP
Ability
Ability2 Ability3 Ability4
AbilityInc
AbilityInc2 AbilityInc3 AbilityInc4
Spell -- like Ability but keeps cooldown when lost & regained by this key (in Warcraft 3 V1.31.1 spell is silenced)
Spell2 Spell3 Spell4
Tech
Tech2 Tech3 Tech4
AggroRange --same as AcquireRange
AcquireRange
Add 10 Primary Hero Stat (white numbers) TasUnitBonus(unit, "Primary", 10)
Bonus Strenght is an ability feature for such is the TasUnitBonusSkill addon, can require custom abilities and object Editor setup.
The Addons: TasUnitBonusSkill handles & adds TasUnitBonus-Keys that require abilities to be given like bonus str, bonus def, bonus attack, evasion, default crit and such in the default all Keys of this Section end with + like "STR+". TasUnitBonusItem gives TasUnitBonus on pick/drop items has unit-events. You can define data-Lua-tables for specific items and of items with a given rawCode. TasUnitBonusHero give TasUnitBonus on Levelups for any hero, that hero and Heroes of class x, Has unit-events. TasUnitBonusBuff attach a TasUnitBonus to a Warcraft 3 BuffCode. You need to tell the types of bonuses once and then when the buff is gained by an unit tell how much of each stat. TasUnitBonusBuffTable kinda like TasUnitBonusBuff but use bonusTables instead of multiargs TasUnitBonusLearn give TasUnitBonus when Learning a Skill over warcraft 3 Hero Learn ui, can be called from the outside in case you heroes gain skills in a other way, Has unit-events. TasUnitBonusEquipment give TasUnitBonus while items are inside a custom Inventory + that custom inventory. TasUnitBonusItemTooltip addon for TasUnitBonusItem/TasUnitBonusEquipment update tooltips to display TasUnitBonus gained by items. TasUnitBonusSuperHero adds BonusKeys that alter the gameplay very much like %Bonus to Spell dmg, %Heal for spells, scale HP/ATK of summons ...
How to install
Option Seperated Requiers Warcraft 3 1.31+ or higher
Copy the TasUnitBonus Script/Folder (trigger Editor).
Or Copy the TasUnitBonus code from this post in your map, probably the addons aswell.
Without Total Init run InitTasUnitBonusHero() & InitTasUnitBonusItem() & InitTasUnitBonusLearn() & InitTasUnitBonusEquipment() inside a mapInit/function main action to create events.
if you want to use TasUnitBonusEquipment then you need the fdf&TOC (map imported files) and TasFrameAction
Check the data in TasUnitBonusSkill, make sure that the skills used work for your map and are of expected base behaviour.
Installed
Option AlInOne
Download AllInOne.Lua copy paste all of it into a Script Trigger Edtior
Without Total Init run AllInOneTasUnitBonusInit() to create warcraft 3 unit events
if you want to use TasUnitBonusEquipment then you need the fdf&TOC (map imported files) and TasFrameAction
Demos & Examples
TasUnitBonusItem
TasUnitBonusItem leveling Item
Custom Stats
TasUnitBonusLearn
TasUnitBonusBuff
TasUnitBonusBuffTable
GUI
TasUnitBonusEquipment
Simple Items
Lua:
--[[
example use of TasUnitBonusItem
setup what each items of RawCode gives while carried by a hero
--]]
do
itemPower = TasUnitBonusItem -- need to write less text
itemPower[FourCC'I000'] = {Armor = 3} -- 3 base armor
itemPower[FourCC'I001'] = {["STR+"] = 3} -- +3 bonus str
itemPower[FourCC'I002'] = {["MOVE+"] = 50}
itemPower[FourCC'I003'] = {Int = 6} -- + 6 base int
itemPower[FourCC'I004'] = {Attack = 9} -- + 9 base dmg
itemPower[FourCC'I005'] = {["INT+"] = 4, ["AGI+"] = 4} -- gives 4 bonus agi and int
itemPower[FourCC'I006'] = {["DMG+"] = 6} -- + 6 bonus dmg
itemPower[FourCC'I007'] = {["PRIMARY+"] = 15}
itemPower[FourCC'I00B'] = {["ATKSP+"] = 0.25}
itemPower[FourCC'I00C'] = {"STR+", 4, "AGI+", 4} -- gives 4 bonus agi and str Format2 key. value, key takes less performance
end
Lua:
-- MaskOfDeath is an example for item specific TasUnitBonus combined with itemCode bonus.
--+20 ATK|n+5 for each last hit done while holding this item, upto 100 additional ATK.
MaskOfDeathCode = FourCC'I008'
function MaskOfDeath()
TasUnitBonusItem[MaskOfDeathCode] = {["DMG+"] = 20} -- + 20 bonus dmg
local trig = CreateTrigger()
TriggerAddAction(trig, function()
local killer = GetKillingUnit()
if not IsUnitType(killer, UNIT_TYPE_HERO) then return end
for i = 0, bj_MAX_INVENTORY -1 do
local item = UnitItemInSlot(killer, i)
if GetItemTypeId(item) == MaskOfDeathCode then
-- create item speicifc table when not existing yet
if not TasUnitBonusItem[item] then TasUnitBonusItem[item] = {["DMG+"] = 0} end
if TasUnitBonusItem[item]["DMG+"] < 100 then
TasUnitBonusItem[item]["DMG+"] = TasUnitBonusItem[item]["DMG+"] + 5
-- give the bonus now, because TasUnitBonusItem is only given and taken on PIckUP/drop events
TasUnitBonus(killer, "DMG+", 5)
-- update item name & tooltip
TasUnitBonusItemTooltip(item)
BlzSetItemName(item, GetObjectName(MaskOfDeathCode) .. "(+".. TasUnitBonusItem[item]["DMG+"] ..")")
end
end
end
end)
TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
end
Lua:
--example of 2 custom types backstab and UndeadSlayer
-- backstab gives Bonus ATK when hitting into the back
-- UndeadSlayer gives Bonus ATK when attacking units with the UNDEAD-Class
-- needed for backstab
function AngleW2W(source, target)
return bj_RADTODEG * Atan2(GetWidgetY(target) - GetWidgetY(source), GetWidgetX(target) - GetWidgetX(source))
end
do --
function CustomStats()
udg_BackStab = __jarray(0)
udg_UndeadSlayer = __jarray(0)
TasUnitBonus.AddSimpleType("udg_BackStab")
TasUnitBonus.AddSimpleType("udg_UndeadSlayer")
itemPower[FourCC'I009'] = {udg_UndeadSlayer = 27}
itemPower[FourCC'I00A'] = {udg_BackStab = 35}
-- current Bonus used for reset
local oldBackStab = __jarray(0)
local oldUndeadSlayer = __jarray(0)
local trig = CreateTrigger()
TriggerAddAction(trig, function()
local unit, attacker = GetTriggerUnit(), GetAttacker()
local newValue = udg_BackStab[attacker]
if oldBackStab[attacker] ~= 0 or newValue ~= 0 then
if CosBJ(AngleW2W(attacker, unit) - GetUnitFacing(unit)) < 0 then newValue = 0 end
TasUnitBonus(attacker, "ATK+", newValue - oldBackStab[attacker])
oldBackStab[attacker] = newValue
end
newValue = udg_UndeadSlayer[attacker]
if oldUndeadSlayer[attacker] ~= 0 or newValue ~= 0 then
if not IsUnitType(unit, UNIT_TYPE_UNDEAD) then newValue = 0 end
TasUnitBonus(attacker, "ATK+", newValue - oldUndeadSlayer[attacker])
oldUndeadSlayer[attacker] = newValue
end
end)
TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_ATTACKED)
end
end
Lua:
TasUnitBonusLearn[FourCC'AHhb'] = { -- HolyLight
["DMG+"] = 3 -- 3 Bonus ATK every time Skilled
,[2] = { Str = 10} -- Skilling level 2 10 base Str
}
Lua:
-- example for TasUnitBonusBuff
function InitDemoSpellCast()
-- define once what bonus keys buffs give
TasUnitBonusBuff.DefineKeys('Binv', "MOVE+")
TasUnitBonusBuff.DefineKeys('Binf', "STR+")
TasUnitBonusBuff.DefineKeys('Bblo', "Ability")
-- do not run this again
InitDemoSpellCast = nil
end
function DemoSpellCast()
if InitDemoSpellCast then InitDemoSpellCast() end
-- the spellcasts tell TasUnitBonusBuff how much to add for a given buffCode
--Invis buff gives 500 movespeed
if GetSpellAbilityId() == FourCC'Aivs' then TasUnitBonusBuff.add(GetSpellTargetUnit(), 'Binv', 500) end
-- inner fire gives hero str
-- first cast adds 15 recast give 5 more 15 20 25 30
local buffCode = FourCC'Binf'
if GetSpellAbilityId() == FourCC'Ainf' then
local value = TasUnitBonusBuff.Data[buffCode]["STR+"][GetSpellTargetUnit()] or 0
if value < 15 then value = 15 else value = value + 5 end
TasUnitBonusBuff.add(GetSpellTargetUnit(), buffCode, value ) end
-- bloodlust gives an endurance aura
local skill = FourCC'AIae'
if GetSpellAbilityId() == FourCC'ACbb' then TasUnitBonusBuff.add(GetSpellTargetUnit(), 'Bblo', skill) end
end
Lua:
-- example for TasUnitBonusBuffTable
do
local bonusInvis = {["MOVE+"]=500}
local bonusBlood = {Ability='AIae'}
local frostArmor = {
{}
,{Life = 100}
,{Life = 100, LifeReg = 5}
}
function DemoSpellCast()
local unit = GetSpellTargetUnit()
-- the spellcasts tell TasUnitBonusBuff how much to add for a given buffCode
--Invis buff gives 500 movespeed
if GetSpellAbilityId() == FourCC'Aivs' then TasUnitBonusBuffTable.add(unit, 'Binv', bonusInvis) end
-- inner fire gives hero str
-- first cast adds 15, recast give 5 more; 15 20 25 30
local buffCode = FourCC'Binf'
if GetSpellAbilityId() == FourCC'Ainf' then
local value = 0
local buffData = TasUnitBonusBuffTable.Data[buffCode]
if buffData and buffData[unit] then value = buffData[unit]["STR+"] end
if value < 15 then value = 15 else value = value + 5 end
TasUnitBonusBuffTable(unit, buffCode, {["STR+"]= value})
end
-- bloodlust gives an endurance aura
if GetSpellAbilityId() == FourCC'ACbb' then TasUnitBonusBuffTable.add(unit, 'Bblo', bonusBlood) end
-- Frost armog gives with the first rebuff 100 HP with the second Rebuff also HP/s
local buffCode = FourCC'BUfa'
if GetSpellAbilityId() == FourCC'ACfa' then
local currentBonus = TasUnitBonusBuffTable.get(unit, buffCode)
local newBonus = currentBonus
if not currentBonus then newBonus = frostArmor[1]
elseif currentBonus == frostArmor[1] then newBonus = frostArmor[2]
elseif currentBonus == frostArmor[2] then newBonus = frostArmor[3]
end
TasUnitBonusBuffTable(unit, buffCode, newBonus)
end
end
end
DemoGUISobiMask
Events
Map initialization
Conditions
Actions
Set TasUnitBonus_ItemCode = Sobi-Maske
Set TasUnitBonus_Key = ManaReg
Set TasUnitBonus_Amount = 5.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
Set TasUnitBonus_ItemCode = Sobi-Maske
Set TasUnitBonus_Key = INT+
Set TasUnitBonus_Amount = 2.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
Set TasUnitBonus_Item = Sobi-Maske 0210 <gen>
Gegenstand - Set Extended Tooltip of TasUnitBonus_Item to ((Extended Item Tooltip of TasUnitBonus_Item) + |n+15 ATK vs Undead)
Gegenstand - Set Name of TasUnitBonus_Item to ((Name of TasUnitBonus_Item) + Paladin)
Set TasUnitBonus_Key = udg_UndeadSlayer
Set TasUnitBonus_Amount = 15.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
Set TasUnitBonus_Item = Sobi-Maske 0208 <gen>
Gegenstand - Set Extended Tooltip of TasUnitBonus_Item to ((Extended Item Tooltip of TasUnitBonus_Item) + |n+15 ATK vs Undead)
Gegenstand - Set Name of TasUnitBonus_Item to ((Name of TasUnitBonus_Item) + Paladin)
Set TasUnitBonus_Key = udg_UndeadSlayer
Set TasUnitBonus_Amount = 15.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
GUI example for a instant self Buff with static power. The power of the buff is setuped once on first cast and then applied to caster units.
The benefitting unit should gain/have the buff now or in the next 0.1 seconds.
DemoGUIWindWalk
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Windlauf
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Execution count of (This trigger)) Equal to 1
Then - Actions
-------- First use -> create the bonus --------
-------- Unit gains 11 HP/s --------
Set TasUnitBonus_BuffCode = Windlauf
Set TasUnitBonus_Key = LifeReg
Set TasUnitBonus_Amount = 11.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
-------- Custom GUI Array is increased under this buff --------
-------- Requires an UnitIndexer --------
Set TasUnitBonus_BuffCode = Windlauf
Set TasUnitBonus_Key = udg_UnitSneaks
Set TasUnitBonus_Amount = 1.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
Else - Actions
-------- apply the bonus to the casting unit --------
-------- while it has the buff it benefits from the bonus for this buff --------
Set TasUnitBonus_Unit = (Triggering unit)
Set TasUnitBonus_BuffCode = Windlauf
Trigger - Run TasUnitBonusGUIUse <gen> (ignoring conditions)
GUI example for a instant target Buff, the power of the buff depends on the current Mana of the caster.
The benefitting unit should gain/have the buff now or in the next 0.1 seconds.
DemoGUIInnerFireMana
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Inneres Fire (Mana)
Actions
-------- Each Cast has unique Data --------
Set TasUnitBonus_BuffCode = Inneres Fire Mana
Trigger - Run TasUnitBonusGUIMakeBuff <gen> (ignoring conditions)
-------- Setup BuffBonus --------
Set TasUnitBonus_BuffCode = Inneres Fire Mana
Set TasUnitBonus_Key = ATK+
Set TasUnitBonus_Amount = ((Mana of (Triggering unit)) x 0.20)
-------- ATK+ needs to be an integer --------
Set TasUnitBonus_Amount = (Real((Integer(TasUnitBonus_Amount))))
Game - Display to (All players) the text: (String(TasUnitBonus_Amount))
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
-------- Apply Buff Bonus --------
Set TasUnitBonus_Unit = (Target unit of ability being cast)
Set TasUnitBonus_BuffCode = Inneres Fire Mana
Trigger - Run TasUnitBonusGUIUse <gen> (ignoring conditions)
-------- Pay Custom cost --------
Unit - Set mana of (Triggering unit) to ((Percentage mana of (Triggering unit)) - 35.00)%
DemoGUIBladeMaster
Events
Map initialization
Conditions
Actions
-------- --- --------
-------- Possible Keys you find at top of TasUnitBonus --------
-------- Also inside TasUnitBonusSkill --------
-------- --- --------
-------- I want to make a special bonus given at level 5 --------
-------- Therefore the blademaster bonusTable needs to be in mapFormat --------
Set TasUnitBonus_Format = True
-------- --- --------
-------- BladeMaster gets +2 Agi on levelUps --------
Set TasUnitBonus_HeroCode = Klingenmeister
Set TasUnitBonus_Key = AGI+
Set TasUnitBonus_Amount = 2.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
-------- BladeMaster gets +1 ATK on levelUps --------
Set TasUnitBonus_HeroCode = Klingenmeister
Set TasUnitBonus_Key = ATK+
Set TasUnitBonus_Amount = 1.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
-------- BladeMaster At Level 5 get 20 Str+ --------
Set TasUnitBonus_HeroCode = Klingenmeister
Set TasUnitBonus_Key = STR+
Set TasUnitBonus_HeroLevel = 5
Set TasUnitBonus_Amount = 20.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
-------- Revert back to arrayFormat, now used by new bonuses --------
Set TasUnitBonus_Format = False
-------- --- --------
-------- Possible Keys you find at top of TasUnitBonus --------
-------- Also inside TasUnitBonusSkill thisData["STR+"] = -> STR+ is the key --------
-------- --- --------
-------- make an GUI array useable in TasUnitBonus --------
-------- in GUI this feature requires an unit indexer that makes Custom Unit Value unique for each unit --------
-------- dont forget the prefix udg_ --------
Set TasUnitBonus_Key = udg_UnitSneaks
Trigger - Run TasUnitBonusGUINewKey <gen> (ignoring conditions)
DemoGUI AddStats
Events
Map initialization
Conditions
Actions
Set TasUnitBonus_Unit = Oger-Magier 0029 <gen>
Set TasUnitBonus_Key = ATK+
Set TasUnitBonus_Amount = 11.00
Trigger - Run TasUnitBonusGUIUse <gen> (ignoring conditions)
Set TasUnitBonus_Unit = Oger-Magier 0137 <gen>
Trigger - Run TasUnitBonusGUIUse <gen> (ignoring conditions)
DemoGUIKrit
Events
Map initialization
Conditions
Actions
-------- Level Specific bonuses require the map format --------
Set TasUnitBonus_Format = True
-------- Learning every Level of Krit give + 12 ATK --------
Set TasUnitBonus_LearnCode = Kritischer Schlag
Set TasUnitBonus_Key = ATK+
Set TasUnitBonus_Amount = 12.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
-------- Learning Level 3 gives +5 Int --------
Set TasUnitBonus_LearnCode = Kritischer Schlag
Set TasUnitBonus_Key = INT+
Set TasUnitBonus_Level = 3
Set TasUnitBonus_Amount = 5.00
Trigger - Run TasUnitBonusGUIAdd <gen> (ignoring conditions)
-------- new bonuses will be in array format --------
Set TasUnitBonus_Format = False
TasUnitBonusEquipment is an addon for TasUnitBonus that gives a custom Inventory with UI. It gives a TasUnitBonus while items are inside that custom inventory.
Items move into the custom Inventory when the hero clicks them in the Warcraft 3 inventory, items need to have a valid active for that. Option B Items are equiped when autoequip is enabled and it would be added to the hero's warcraft 3 inventory.
The first free slot, valid for this item, is taken by the new equip.
Autoequip will not unequip items when no slot is free. While active equiping will unequip and take the last valid slot for that item.
Lua:
TasUnitBonusEquipment.UIAutoEquip = {} -- equip items gained (not tomes) can be set for [0] or [hero] or [player] or [unitTypeId]
The custom inventory needs setup.
How many inventory buttons are there and how are they structured?
The inventoryButtons use the Position of the Parent aka local Pos. For their structure there are 2 choices a scrollable grid requires TasFrameList
Lua:
this.UIGridMode = false -- (true) requires TasFrameList, (false) -> use this.UIFormation
this.UIGridModeRows = 9 -- should not be changed after InitTasUnitBonusEquipment() run
this.UIGridModeCols = 6
The other options is to have a fixed amount of buttons with chooseable positions called UIFormation in this system. One does that with a Lua table of x,y pairs (x1,y1, x2,y2, x3,y3, ...)
Lua:
-- 2d offset array each x&y set is one button and how much to move from the previous button, from center to next center
local formationU10 = {-2,0, 0,-1, 0,-1, 0,-1, 1,0, 1,0, 1,0, 0,1, 0,1, 0,1}
local formationTriAngle9 = { 0,0, -1,-1, -1,-1, 1,0, 1,0,1,0,1,0, -1,1, -1,0}
this.UIFormation = formationU10 -- used inside the frame creation when InitTasUnitBonusEquipment() runs
The previous setup was for the ui. One also needs to setup what units can put into the custom Inventory. this is done over the table TasUnitBonusEquipment.Inventory.
it holds the rule what an inventory can hold and it defines as what an item counts.
Lua:
TasUnitBonusEquipment.Inventory[unit] a rule for this unit only
TasUnitBonusEquipment.Inventory[GetUnitTypeId] all paladins use TasUnitBonusEquipment.Inventory.Hpal
TasUnitBonusEquipment.Inventory[Player(0)] units owned by Red Player
TasUnitBonusEquipment.Inventory[0] is the rule used by everyone when the others dont apply for a unit.
prio unit > GetUnitTypeId > player > 0
TasUnitBonusEquipment.Inventory is an array, each entry is one slot for an item.
-1 or ITEM_TYPE_ANY allows any item
-- slot values with special behaviour
this.INV_SLOT_ANY = -1
this.INV_SLOT_BAG = -2 -- inventory slot that can hold anything, but dont give stats
this.INV_SLOT_NONE = -3 -- hidden Slot that cant hold items
supports warcraft 3 itemTypes like ITEM_TYPE_ARTIFACT
or random madeUp numbers, Strings, Lua table
TasUnitBonusEquipment.Inventory[0] = {-1,-1,-1,-1,-1,-1,-1,-1,-1} -- all heroes can equip 9 items of any type
--bloodMage can equip 4 items then has 2 bag Slots
TasUnitBonusEquipment.Inventory[FourCC'Hblm'] = {-1,-1,-1,-1, -2,-2}
equipPower = TasUnitBonusEquipment -- need to write less text
EquipClass_Wand = 3 -- define a new EquipClass
--equipPower.Strings[EquipClass_Wand] = "Wand"
-- i want to write less
InventoryRules = TasUnitBonusEquipment.Inventory
-- bloodMage can equip 10 items and auto equips them
-- 2 ARTIFACT and 7 normal items and 1 Wand
InventoryRules.Hblm = {}
for i= 1, 2 do InventoryRules.Hblm[i] = ITEM_TYPE_ARTIFACT end
for i= 3, 9 do InventoryRules.Hblm[i] = ITEM_TYPE_PERMANENT end
InventoryRules.Hblm[10] = EquipClass_Wand
equipPower.UIAutoEquip[FourCC'Hblm'] = true
Where is the inventory?
The invenotry has possitions for its show drop button and for the custom inventory.
Lua:
local Pos = function(frame) -- where to place this ui
--BlzFrameSetPoint(frame, FRAMEPOINT_TOPRIGHT, BlzGetFrameByName("ResourceBarSupplyText", 0), FRAMEPOINT_TOPRIGHT, 0, 0)
BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPRIGHT, 0.55, 0.25)
end
this.OpenButton.Pos = function(frame) -- where to place this ui
BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPRIGHT, 0.79, 0.55)
end
this.DropAllButton.Pos = function(frame) -- where to place this ui
BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPRIGHT, 0.79, 0.52)
end
local ParentFunc = function() -- who is the parent of this ui
return BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
end
There a 2 ui control buttons, one shows/hides the custom UI when clicked, the other drops all inside the custom UI. Both can be hidden in the setup and therefore made not useable by the player.
Stats given by Equipment
Like TasUnitBonusItem you setup table(s) that hold infos what an item gives.
One can set a bonus for an specific item and of its TypeId/ItemCode, the item will give both.
Supports all the things TasUnitBonus can do.
TasUnitBonusEquipment Bonus only is given while items are in the custom inventory.
When you change the stats of an specific item during the game it is recommented to use this 2 functions. They add the stats to the current holder. When nobody was able to hold it yet then you can just make the table as shown above.
TasUnitBonusEquipment.Add(item, key, amount)
TasUnitBonusEquipment.Remove(item[, key, amount])
ChangeLog
1.27) added TasUnitBonusSuperHero
1.25) Add TasUnitBonus.Temp can give a bonusTable for dur seconds, AllInOne made a init function calls itself when already gamestarted by bj global.
1.24) Removed TasUnitBonus.Heal
1.23 animation Equip
1.22) Removed TasUnitBonus.Heal, Life & mana also reduce current amount but dont kill
1.21) TasUnitBonusEquipment animation for gaining/losing equip, another losing animation
1.20) TasUnitBonus calls TasUnitBonus.UnitAdd
1.19) TasUnitBonusEquipment Compare Items and show diff
1.18+++) TasUnitBonusEquipment default position open/drop buttons
1.18++) Bugfix TasUnitBonusEquipment [player] inventory
1.18) faster update TasUnitBonusEquipment
1.17) STRAGIINT+ & StrAgiInt, updates for TasUnitBonusEquipment
1.16) ChargeBoxes TasUnitBonusEquipment
1.15+) TasUnitBonusEquipment GUI support
1.15) TasUnitBonusEquipment INV_SLOT_BAG & INV_SLOT_NONE
1.14) optional Condition for TasUnitBonusSkill, new TasUnitBonusSkill Keys, fix key Spell
1.13) More TasUnitBonus base Keys
1.12) Updated TasUnitBonusItemTooltip, new Addon TasUnitBonusEquipment, disabled the included cheatBox in multiplayer
1.11+) TasUnitBonusGUI hold items
1.11) Add for TasUnitBonusHero & TasUnitBonusItem updated TasUnitBonusItemTooltip
1.10++ & 10+) Added GUI support
1.10) TasUnitBonusHero supports array format
1.9) Additonal Format for TasUnitBonus.UnitAdd
1.8) TasUnitBonus.AddSimpleType can create an array, added config TasUnitBonus.Heal, added TasUnitBonusBuffTable.get
1.7b) small error fix
1.7a) fixed an critical error of 1.7, args of TasUnitBonus.UnitAdd reordered, improve comments
1.7) fixed a desync possiblity, call TasUnitBonusBuffTable, NewType copies FourCCValueKey, +Key Ability2 to 4
1.6a) improved TasUnitBonusBuffTable rebuff
1.6) improve comments, Improved Keys Ability,AbilityInc,Tech
1.5) improve comments, ability survives morphs, seperated TasUnitBonusSkill more from TasUnitBonus, Added Key Tech inc/dec Reserach by 1
1.4) fix key AttackRange
1.3x) Added TasUnitBonusLearn
1.3) Added TasUnitBonusItemTooltip & 4 stats
1.2c) Fixed TasUnitBonusHero
1.2b) added TasUnitBonusHero
1.2a) replaced HealUnit(Mana) with native aviable functions
A nice collection of quality-of-life libraries that make adding/removing abilities and stat bonuses much easier. Almost any stat/ability is included and the system can easily be expanded to include your own types.
Approved
small update:
Removed TasUnitBonus.Heal
Stat Life & mana always heal or reduce current amount but dont kill. use MaxLife/MaxMana to avoid the healing
Edit: updated included TasCheatBox, added a Lua AllInOneFile as download has TasUnitBonus and all the addons.
Edit 28.01.2026:
Added function TasUnitBonus.Temp(unit, dur, bonusTable) gain bonusTable for dur seconds.
AllInOne creates events when run inside a editbox
Deleted the system-code inside the hive website, use the AllInOne download instead
Added Addon TasUnitBonusSuperHero, Adds stats that require events and lead to kind of a Super Hero gameplay.
Lua:
TasSpellPower Increase Dmg of ATTACK_TYPE_NORMAL = Spell by Percent 100 Points = 2x dmg -100 = half dmg
TasATKPower TasSpellPower for other ATTACK_TYPEES
TasSpellVamp Heal for Spell Dmg done 100 dmg with 0.20 SpellVamp heal 20 Life
TasATKVamp Heal for none Spell Dmg ^^
TasSpellDef Reduces taken spell dmg by Percent
TasATKDef Reduces taken not spell dmg by Percent, basicly another Armor stat which multiples with the default if you have 100 Armor & 100 TasATKDef you block for 300 total def
TasSummonLife Flat Life Bonus for units summoned
TasSummonLifePower Faktor for Life
TasSummonATK Flat Base ATK bonus ^^
TasSummonATKPower Faktor for ATK, with dice sides the max ATK scales incorrect
TasSummonArmor ^^ +base Armor
TasSummonSpellDef Gives summons TasSpellDef
TasSpellBlade Deal Spell Dmg when you deal Non SpellDmg, within EVENT_PLAYER_UNIT_DAMAGED Cleave does not trigger this but multishot and splash does
TasSpellBlade.Grafik[unit] or TasSpellBlade.Grafik[FourCC] = "model" plays the death animation
TasSpellBladeChance when set TasSpellBlade only happens sometimes, 100 Chance happens always
TasSpellCost %Bonus ManaCost within EVENT_UNIT_SPELL_EFFECT
TasSpellSpeed simple cooldown % within EVENT_UNIT_SPELL_EFFECT
TasHealPower %Bonus for heal spells within EVENT_UNIT_SPELL_EFFECT, BlzSetAbilityRealLevelField detects them by orderId
TasLooter gain more Gold&Lumber from last hitting by this unit, not displayed in the texttag
Edit: Updated TasUnitBonusSuperHero added some common wanted bonusTypes.
Lua:
TasMaxLifeMulti Percent Bonus to Max Life only, +20 & 100 Life -> 120 Life, another +20 -> 140 Life
TasMaxManaMulti ^^ for Max Mana
TasStrMaxLife Per Point each Str give 1 more HP, only for heroes
TasIntMaxMana ^^ Int & Mana
TasPrimeATK Per Point each Primary attribute gives 1 more ATK
TasPrimeATK+ ^^ give bonus ATK (green number requires TasUnitBonusSkill)
these bonusTypes updates constantly when TasUnitBonusSuperHero.AutoUpdate = true,
these bonusTypes dont have a FourCC setup
Updated TasUnitBonusSuperHero,
Fixed TasSpellCost working when the new manacost is not an integer
Added TasSpellBladeInt & TasSpellBladePrim & TasHasStunDef
TasHasStunDef While under stun/sleep/pause block 1/3 dmg. A unit has it when it has more than 0 of TasHasStunDef under [unit] or [FourCC unit]
Renamed used summon bonus function to TasUnitBonusSuperHero.UseSummon(unit, summoner)
Added TasUnitBonusSuperHero.GetHealPower(unit)
Added TasHealPower.Exclude = {} --unit, FourCC UnitCode or SpellCode not allowed to use TasHealPower
TasHealPower ignores spells with baseHeal of 1 or less
Updated TasUnitBonusHero fixed some bugs for heroes recreated by function RestoreUnit & gamecache.
^^In the 2 Warcraft 3 versions i tested, V1.31.1 and V1.26a giving bonus inside the levelup event for Restored Units leads to stat lose. Therefore the function is hooked and TasUnitBonusHero bonus is given to such unit after the RestoreUnit call is finished
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.