Item Ability Upgrade and Item Set

Status
Not open for further replies.
Level 3
Joined
Jan 4, 2013
Messages
22
I searched everywhere for this but it seems i cant find it/doesnt exist. I want to create an item set system for my map, but i dont know how. Also an old post gave me the idea of adding charges in items without checking "Activately Used" option and set the level of the abilities added to the item depending of the charges. The thing is i dont know how to do that either. Thanks in advance.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
What is the concept of Item Sets?
Is it something like you can only have one helmet, one shield, one sword, etc?
Or is it more of a build towards an item?

Next to that, setting item abilities (in normal JASS/vJASS) is impossible.
You can however change the item or have your abilities attached to the unit instead of the ability.

I would love to make both (All three) of these systems... Will be fun.
Just tell me what system you exacly want.
 
Level 3
Joined
Jan 4, 2013
Messages
22
The "Item Set System" is like most action games when the character collects equipment that increase the power of the character depending of the number of the items belonging in the same "Set". The set can be consist of numerous items (up to 6, in my case). So if let's say the main character named Bob aquires Khadgar's Gem of Health and Khadgar's Flute of Brilliance, in addition of the stats gained by the items he will gain bonus stats from having both of these items. I want to add this in my map but i dont have the necessary skills. The other thing i want to add is something like "Bloodstone" from DotA. More charges equals more power.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Here is the first version of the system for your item sets.

I know I could change the system triggers into GUI but I don't know why I should.
Next to that, I hate the way how hashtables are used in GUI.

  • ISS Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set ISS_Hashtable = (Last created hashtable)
      • Custom script: set udg_ISS_No_Ability = 0
      • -------- Register all item sets. --------
      • Set ISS_Index = 1
      • Set ISS_Ability_Array[0] = Attribute Bonus (Item Set 1)
      • Set ISS_Ability_Array[1] = Damage Bonus (Item Set 1)
      • Set ISS_Ability_Array[2] = Life Bonus (Item Set 1)
      • Set ISS_Ability_Number = 2
      • Trigger - Run ISS Set Abilities <gen> (ignoring conditions)
      • Set ISS_Item_Type_Array[0] = Assassin's Blade
      • Set ISS_Item_Type_Array[1] = Elven Mantle
      • Set ISS_Item_Type_Array[2] = Holy Shield
      • Set ISS_Item_Type_Array[3] = Necronomicon
      • Set ISS_Item_Type_Array[4] = Orb of Shadow
      • Set ISS_Item_Type_Number = 4
      • Trigger - Run ISS Set Items <gen> (ignoring conditions)
      • -------- Register all item sets. --------
      • Set ISS_Index = 2
      • Set ISS_Ability_Array[0] = ISS_No_Ability
      • Set ISS_Ability_Array[1] = Brilliance Aura (Item Set 2) (Spellbook)
      • Set ISS_Ability_Array[2] = ISS_No_Ability
      • Set ISS_Ability_Array[3] = Hardened Skin (Item Set 2) (Spellbook)
      • Set ISS_Ability_Number = 3
      • Trigger - Run ISS Set Abilities <gen> (ignoring conditions)
      • Set ISS_Item_Type_Array[0] = Ring of Poison
      • Set ISS_Item_Type_Array[1] = Ring of Protection
      • Set ISS_Item_Type_Array[2] = Ring of Regeneration
      • Set ISS_Item_Type_Array[3] = Ring of Superiority
      • Set ISS_Item_Type_Number = 3
      • Trigger - Run ISS Set Items <gen> (ignoring conditions)
JASS:
function Trig_ISS_Add_Stack_Actions takes nothing returns nothing
    //Requires:
    //    - ISS_Unit
    //    - ISS_Item_Type
    
    local integer unitid = GetHandleId(udg_ISS_Unit)
    local integer index = LoadInteger(udg_ISS_Hashtable, udg_ISS_Item_Type, 0)
    local integer level = LoadInteger(udg_ISS_Hashtable, unitid, index)
    local integer abilityid = LoadInteger(udg_ISS_Hashtable, index, level)
    
    if index == 0 then
        return
    endif
    
    call SaveInteger(udg_ISS_Hashtable, unitid, index, level + 1)
    
    if abilityid != 0 then
        call UnitAddAbility(udg_ISS_Unit, abilityid)
    endif
endfunction

//===========================================================================
function InitTrig_ISS_Add_Stack takes nothing returns nothing
    set gg_trg_ISS_Add_Stack = CreateTrigger()
    call TriggerAddAction(gg_trg_ISS_Add_Stack, function Trig_ISS_Add_Stack_Actions)
endfunction
JASS:
function Trig_ISS_Remove_Stack_Actions takes nothing returns nothing
    //Requires:
    //    - ISS_Unit
    //    - ISS_Item_Type
    
    local integer unitid = GetHandleId(udg_ISS_Unit)
    local integer index = LoadInteger(udg_ISS_Hashtable, udg_ISS_Item_Type, 0)
    local integer level = LoadInteger(udg_ISS_Hashtable, unitid, index)
    local integer abilityid = LoadInteger(udg_ISS_Hashtable, index, level - 1)
    
    if index == 0 then
        return
    endif
    
    call SaveInteger(udg_ISS_Hashtable, unitid, index, level - 1)
    
    if abilityid != 0 then
        call UnitRemoveAbility(udg_ISS_Unit, abilityid)
    endif
endfunction

//===========================================================================
function InitTrig_ISS_Remove_Stack takes nothing returns nothing
    set gg_trg_ISS_Remove_Stack = CreateTrigger()
    call TriggerAddAction(gg_trg_ISS_Remove_Stack, function Trig_ISS_Remove_Stack_Actions)
endfunction
JASS:
function Trig_ISS_Set_Abilities_Actions takes nothing returns nothing
    //Requires:
    //    - ISS_Index
    //    - ISS_Ability[]
    //    - ISS_Ability_Number
    
    local integer i = 0
    loop
        exitwhen i > udg_ISS_Ability_Number
        call SaveInteger(udg_ISS_Hashtable, udg_ISS_Index, i, udg_ISS_Ability_Array[i])
        set i = i + 1
    endloop
endfunction

//===========================================================================
function InitTrig_ISS_Set_Abilities takes nothing returns nothing
    set gg_trg_ISS_Set_Abilities = CreateTrigger()
    call TriggerAddAction(gg_trg_ISS_Set_Abilities, function Trig_ISS_Set_Abilities_Actions)
endfunction
JASS:
function Trig_ISS_Set_Items_Actions takes nothing returns nothing
    //Requires:
    //    - ISS_Index
    //    - ISS_Item_Type[]
    //    - ISS_Item_Type_Number
    
    local integer i = 0
    loop
        exitwhen i > udg_ISS_Item_Type_Number
        call SaveInteger(udg_ISS_Hashtable, udg_ISS_Item_Type_Array[i], 0, udg_ISS_Index)
        set i = i + 1
    endloop
endfunction

//===========================================================================
function InitTrig_ISS_Set_Items takes nothing returns nothing
    set gg_trg_ISS_Set_Items = CreateTrigger()
    call TriggerAddAction(gg_trg_ISS_Set_Items, function Trig_ISS_Set_Items_Actions)
endfunction


I have added 2 item sets as examples:

Item Set "Elite":
1: +5 to all stats.
2: +12 damage.
3: +300 health.

Item Set "Full Hand":
2: Brilliance Aura.
4: Hardened Skin.


You can see how everything works but you don't have to edit anything except the initialization trigger.
For the Brilliance Aura and Hardened Skin, you have to put the spells in a disabled spellbook to hide the icons.
Therefor I created another trigger that disables those specific spellbooks. You have to do the same for every other spellbook in there.

If you want multiple abilities in one level, just add those to a spellbook too. You can create enough inside a spellbook.

I don't know of a way to actually update/change the tooltip of the items, so you won't be able to see what bonusses you have and what not.

If you need something more, just ask. (Preferably in a PM.)
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Here is the Bloodstone Item that also was requested.
The "reduce gold lost from death by 25" and "reduce revive delay by 4 seconds" are removed... You might know why.
Gold lost from death is not inserted in WC3 but is a system used in DotA.
Reviving heroes in DotA is also different from the WC3 system.
Every other functionality is completely implemented.

All you have to do is copy the triggers, copy the item and abilities and set the Bloodstone variable to the item on map initialization and you have your Bloodstone system.

(Map in attachments.)
_______________________________________________________________________________

Here is also the newer version of the item sets which allow leveling of already existing abilities. (Be aware of some odd stuff when using spellbooks.)
And shows a buff that displays the bonusses you have and have not.
(The temporary double buff when you gain/lose a bonus can easily be removed but requires the map maker to register ALL buffs too. It works fine so...)

(Map in attachments.)
 

Attachments

  • Bloodstone.w3x
    26.2 KB · Views: 43
  • Item Set System 1.1.w3x
    24 KB · Views: 42
Status
Not open for further replies.
Top