• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Weapon Durability need help!

Status
Not open for further replies.

Watadrag

W

Watadrag

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.
 
Actually I think Item charges works better with this.... You could even scale the damage depending on the charge of the item..
 
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?
 
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.
 
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
 
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.
 
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.
Back
Top