• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Items with more charges - [making them stackable]

Status
Not open for further replies.
Level 13
Joined
Mar 4, 2009
Messages
1,156
sorry if this is already been posted but....

when i set charges of some item like "claws of attack + 20"

to 3 my hero does not get + 60 damage

how can i make that items stackable?
3 charges = 3 x 20 = 60 ......
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Stack Systems

The 2 on the top there seems to be fine. :)
none is good....
it can only stack items like potions (witch is easy)

and i don't know why is there about 5 trigger for that systems
i just did it like this....

  • stack items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Charges remaining in (Item being manipulated)) Not equal to 0
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item being manipulated) Not equal to (Item carried by (Triggering unit) in slot (Integer A))
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
            • Then - Actions
              • Item - Set charges remaining in (Item carried by (Triggering unit) in slot (Integer A)) to ((Charges remaining in (Item carried by (Triggering unit) in slot (Integer A))) + 1)
              • Item - Remove (Item being manipulated)
            • Else - Actions
(same trigger in JASS)
JASS:
function Trig_stack_items_Copy_Conditions takes nothing returns boolean
    if ( not ( GetItemCharges(GetManipulatedItem()) != 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_stack_items_Copy_Func002Func001C takes nothing returns boolean
    if ( not ( GetManipulatedItem() != UnitItemInSlotBJ(GetTriggerUnit(), GetForLoopIndexA()) ) ) then
        return false
    endif
    if ( not ( GetItemTypeId(UnitItemInSlotBJ(GetTriggerUnit(), GetForLoopIndexA())) == GetItemTypeId(GetManipulatedItem()) ) ) then
        return false
    endif
    return true
endfunction

function Trig_stack_items_Copy_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 6
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_stack_items_Copy_Func002Func001C() ) then
            call SetItemCharges( UnitItemInSlotBJ(GetTriggerUnit(), GetForLoopIndexA()), ( GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(), GetForLoopIndexA())) + 1 ) )
            call RemoveItem( GetManipulatedItem() )
        else
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_stack_items takes nothing returns nothing
    set gg_trg_stack_items = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_stack_items, EVENT_PLAYER_UNIT_PICKUP_ITEM )
    call TriggerAddCondition( gg_trg_stack_items, Condition( function Trig_stack_items_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_stack_items, function Trig_stack_items_Copy_Actions )
endfunction






the problem is that i cannot make trigger that will stack items like claws of attack +20
 
Level 2
Joined
Aug 9, 2008
Messages
22
Unfortunately, that's not how items in wc3 work. When an item has multiple charges that means it can be used that many times to activate the active effect of the item. I recommend using this unit state system by Cohadar and update the damage on item pickup. This system will work for life, armor, damage, and evasion, but it won't work for things like mana regen and health regen, attack speed. Each of these stats would need a separate system or I suppose an integrated one in order to achieve the stacking effect you desire.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Unfortunately, that's not how items in wc3 work. When an item has multiple charges that means it can be used that many times to activate the active effect of the item. I recommend using this unit state system by Cohadar and update the damage on item pickup. This system will work for life, armor, damage, and evasion, but it won't work for things like mana regen and health regen, attack speed. Each of these stats would need a separate system or I suppose an integrated one in order to achieve the stacking effect you desire.

his system also does not work on all items ...

Just do if unit is holding 2 then remove them and create claws of atk + 40.
I just given claws of attack as an example!
i need this system for a lot more items,well i think it is not possible.....

does someone know how to detect abilities in items or just in units?
 
Status
Not open for further replies.
Top