• 🏆 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!

[Solved] A doubt abou item stack

Status
Not open for further replies.
Level 12
Joined
Oct 28, 2019
Messages
480
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 64
Joined
Aug 10, 2018
Messages
6,583
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 12
Joined
Oct 28, 2019
Messages
480
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 39
Joined
Feb 27, 2007
Messages
5,032
  • 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