[Solved] A doubt abou item stack

Status
Not open for further replies.
Level 13
Joined
Oct 28, 2019
Messages
523
I wanna know how to put (solved) in threads.

And if is possible, item stack increases life.

for exemple, an unit picks a item with 1 stack (+100 life)or (attack speed), if pick again same item a trigger will increase stack by 2 and the current life bonus of the item would be (+200 life) this is possible?
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
You click the three ... in the top right corner, then click Edit Thread, and under Prefix select Solved.

For item stacks, you can detect when a unit acquires an Item using this Event:
  • Unit - A unit Acquires an item
From there you can figure out how many charges (stacks) the item has and add/remove any ability you'd like or increase the level of an ability based on the number of charges. I would personally use a system like this for managing stats: New Bonus [vJASS][LUA]

There's also the Ability Field actions on patch 1.31+ that allow you to modify most abilities, so you could do something like Set the life bonus of an ability to 100 * Number of charges.
 
Level 13
Joined
Oct 28, 2019
Messages
523
Then each time the unit acquires the item (a new stack) you can add the Attack Speed ability to it.
Srry but IDK how do this, the stack i got, in gameplay constats --> item stack true

this way is more easy, than do
if stack = 2
remove item1 and create item 2... etc

but i need 10 different itens

  • Warrior bounty
    • Events
      • Unit - A unit owned by Player 21 (Coal) Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Warrior
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) has an item of type Bounty Hunter 1) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Killing unit) of type Bounty Hunter 1)
          • Hero - Create Bounty Hunter 2 and give it to (Killing unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Killing unit) has an item of type Bounty Hunter 2) Equal to True
            • Then - Actions
              • Item - Remove (Item carried by (Killing unit) of type Bounty Hunter 2)
              • Hero - Create Bounty Hunter 3 and give it to (Killing unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Killing unit) has an item of type Bounty Hunter 3) Equal to True
                • Then - Actions
                  • Item - Remove (Item carried by (Killing unit) of type Bounty Hunter 3)
                  • Hero - Create Bounty Hunter 4 and give it to (Killing unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Killing unit) has an item of type Bounty Hunter 4) Equal to True
                    • Then - Actions
                      • Item - Remove (Item carried by (Killing unit) of type Bounty Hunter 4)
                      • Hero - Create Bounty Hunter 5 and give it to (Killing unit)
                    • Else - Actions
                      • Hero - Create Bounty Hunter 1 and give it to (Killing unit)
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
  • Events
    • Unit - A unit enters (Playable map area)
  • Conditions
    • (Owner of (Triggering Unit)) not equal to Neutral Hostile //if you want to filter out some players' units that can't even have this item you'd do it here
    • (Level of ATTACK_SPEED_ABILITY for (Triggering Unit)) equal to 0
  • Actions
    • Unit - Add ATTACK_SPEED_ABILITY to (Triggering Unit)
  • Events
    • Unit - A unit dies
  • Conditions
    • ((Killing unit) has an item of type YOUR_HONOR_ITEM) equal to True
      • (Level of ATTACK_SPEED_ABILITY for (Killing Unit)) less than 11 //technically this line isn't needed
  • Actions
    • Unit - Set level of ATTACK_SPEED_ABILITY for (Killing Unit) to ((Level of ATTACK_SPEED_ABILITY for (Killing Unit)) + 1)
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • Unit - Set level of ATTACK_SPEED_ABILITY for (Triggering Unit) to 1
It's that easy.
 
Status
Not open for further replies.
Top