• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Weapon Durability need help!

Status
Not open for further replies.
Level 2
Joined
May 20, 2009
Messages
7
I'm trying to set up a system where the user's hero can only attack a certain number of times with a weapon and then the weapon is destroyed and the heroes attack goes to 0. so far i've only thought of using mana as the weapon durability. But when i was looking through the triggers i couldn't find nething where a hero issues an attack it loses 1 mana.
 
Level 5
Joined
Jan 27, 2007
Messages
154
Actually I think Item charges works better with this.... You could even scale the damage depending on the charge of the item..
 
Level 2
Joined
May 20, 2009
Messages
7
So pretty much have an item set up with a number of charges and..then if the guy attacks make the item lose 1 charge?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You could set max durability to 99 charges, and then randomize if the item loses a charge.

  • Durability
    • Events
    • Conditions
    • Actions
      • Set TempInt = (Random integer number between 1 and 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Equal to 1
        • Then - Actions
          • Item - Set charges remaining in (MyItem) to ((Charges remaining in (MyItem)) - 1)
        • Else - Actions
This makes the weapon be able to do around 990 hits before it breaks. 99 hits isn't that much, the weapon would break too often. Seeing a number of 99 is a lot nicer IMO than 999 in a small icon.
 
Level 2
Joined
May 20, 2009
Messages
7
I tihnk i'm gona stay with my mana idea. but for me to start it. i have a questions. how do i get rid of the attack button and replace it with a skill that takes up 1 mana. And also i'm not really making an rpg but more like a Tribute to fire emblem sacred stones. in a Renais vs Grado Castle Battle type of idea. Pretty much kinda like how dota has Scourge vs the one other tihng i cant rembe name is
 
Level 5
Joined
Jan 27, 2007
Messages
154
I tihnk i'm gona stay with my mana idea. but for me to start it. i have a questions. how do i get rid of the attack button and replace it with a skill that takes up 1 mana. And also i'm not really making an rpg but more like a Tribute to fire emblem sacred stones. in a Renais vs Grado Castle Battle type of idea. Pretty much kinda like how dota has Scourge vs the one other tihng i cant rembe name is

But it's impossible to reduce an item's mana... And even so if it's possible, there's not much use to it.

But with the attack thing, you can make it easier to not delete the attack (Actually you can, by modifying the "Combat - Attacks Enabled" and put it to none) At it but add a trigger where every attack will spend mana but it would require a JASS attack system, GUI attack system is next to impossible.
 
Level 6
Joined
Oct 31, 2008
Messages
229
I think the best way to solve your problem is to use custom value. e.g.


  • Weapon worn trigger
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
        • Else - Actions
          • Unit - Set (Triggering unit) custom value to ((triggering unit) custom value - 1)
although it might leak if the unit auto atacks the target. But i don't think this gonna happend. Anyway check it

and don't forget to initialize the units custom value
 
Last edited:
I think the best way to solve your problem is to use custom value. e.g.


  • Weapon worn trigger
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Unit - Set (Triggering unit) custom value to ((triggering unit) custom value - 1)
        • Else - Actions
although it might leak if the unit auto atacks the target. But i don't think this gonna happend. Anyway check it

and don't forget to initialize the units custom value

No, there is no way that could ever leak.
And the event fires every time he orders his unit to attack, not every time it strikes.
 
Status
Not open for further replies.
Top