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

Ability +HP + DMG

Status
Not open for further replies.
Level 2
Joined
Jan 2, 2014
Messages
7
hello, is there any ability that gives +HP and + Dmg for certain amount of time?

the point is I want to do something like this, a hero uses an item on a unit and that unit has the aura that increases +hp and + dmg for 20 seconds
 
Level 2
Joined
Jan 2, 2014
Messages
7
sorry I don't really, I make it all in world editor :) This map contains plenty of triggers and I'm pretty good with coding so I always find a solution but couldn't for that. what do you mean hidden in a disabled spellbook?

@Edit

could u please specified the idea you have on mind?
 
Level 18
Joined
Sep 14, 2012
Messages
3,413
You can add ability to spellbook too.
For example you create an ability based on Item Attack Damage Bonus another one based Item Health Bonus (Dunno the right name) and you put them into a spellbook and you add the spellbook to the unit. Don't forget to disable the spell to the players otherwise they'll be able to open the spellbook.
 
Level 10
Joined
Apr 18, 2009
Messages
576
hello, is there any ability that gives +HP and + Dmg for certain amount of time?

the point is I want to do something like this, a hero uses an item on a unit and that unit has the aura that increases +hp and + dmg for 20 seconds

Is what you want an item that, when cast upon a unit, gives that unit an aura that increases maximum hit points and gives a damage boost to friendly units within range? The aura should last 20 seconds?
 
Level 2
Joined
Jan 2, 2014
Messages
7
no, this aura should give bonus only to that unit. I called it wrong, I should call it a buff.
 
Level 10
Joined
Apr 18, 2009
Messages
576
This is how I'd do it:

Object Editor
Make a custom buff.

Make a custom spell based on something like Unholy Frenzy and set the data fields to 0. Let's call this spell Boost. The purpose of Boost is to put the custom buff on the targeted unit and for us to detect with triggers when the ability is cast.

Make two custom abilities based on item abilities that passively grants bonus hit points and bonus damage (such as the abilities "Item Damage Bonus (+3)" and "Item Life Bonus (Least)"). Lets call these abilities Boost Damage Bonus and Boost Life Bonus. The purpose of these abilities are that we will give them to the unit affected by Boost, this we do with triggers.

Make a custom item that casts Boost, in the same way Wand of the Wind casts Cyclone for example.

Triggering
Declare (create) a variable of type Unit Group.

The concept is that we add units affected by Boost to this unit group. We then check every unit in this unit group with rapid intervals. If a unit in the group has lost its Boost buff, that means it should no longer have the boosting abilities (Boost Damage Bonus and Boost Life Bonus). We then remove those abilities from the unit and remove the unit from the unit group.

  • Boost Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Boost
      • ((Target unit of ability being cast) has buff Boost ) Equal to False
    • Actions
      • Unit - Add Boost Damage Bonus to (Target unit of ability being cast)
      • Unit - Add Boost Life Bonus to (Target unit of ability being cast)
      • Unit Group - Add (Target unit of ability being cast) to Boost_BuffedUnits
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Boost_BuffedUnits) Equal to 1
        • Then - Actions
          • Trigger - Turn on Boost Unit Group <gen>
        • Else - Actions
  • Boost Unit Group
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Boost_BuffedUnits and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Boost ) Equal to True
            • Then - Actions
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Boost_BuffedUnits
              • Unit - Remove Boost Life Bonus from (Picked unit)
              • Unit - Remove Boost Damage Bonus from (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Boost_BuffedUnits) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
Do you understand what I'm doing here? Do you want me to explain anything clearer?
 

Attachments

  • Boosting Item Ability Example Map.w3x
    10.3 KB · Views: 50
Level 2
Joined
Jan 2, 2014
Messages
7
well, thx, I understand this :) but it won't lag since it's checking a condition each 0.5 sec?

@edit

well licheus I did everything you give me and I have a problem, when I buff my unit, my unit doesn't receive + hp and + dmg, although it has the buff. Do you know what may be the problem?

@EDIT x2 - ok it works :) I had wrong condition in one trigger, it works now, thx mate :) really good idea. Now I will know how to implement buffs :) thx
 
Last edited:
Level 10
Joined
Apr 18, 2009
Messages
576
well, thx, I understand this :) but it won't lag since it's checking a condition each 0.5 sec?

Excellent!

Well, it is a little delayish compared to how most regular buffs work. What it will do at worst case scenario is delay 0.5 seconds before removing the actual boosting abilities after the buff has disappeared. Most players will probably not even notice this. For those who will that's not a big problem for us, right? I mean, they won't be able to utilize their knowledge to bug the map or whatever. That's how you have to think about these things as a map maker, and that's why people here would say that this is a reasonable delay.

When I first started triggering abilities like this I also thought that 0.5 seconds was a big deal. However, when you really stop to think about it, aura effects and fountain regeneration auras in regular Wc3 delays possibly even more than that before they go away; they are not removed from the unit immediately when it leaves the 900 range or whatever.

In the end this kind of thing comes down to what you personally feel about it. In your trigger you could change the delay down to 0.25 for instance, sacrificing performance for a bit slicker looks. It's mostly for looks because the effect this has on the gameplay is trivial. If you set the trigger to run every 0.00 seconds I guess it'll run every frame more or less (because it doesn't seem to crash the game). This kind of performance-heavy thing to do is generally considered a lunatic move amongst map makers, but you could always fiddle around with the delay yourself and see what works best for you. I think most people here would agree that 0.5 is a reasonable tradeoff between performance and delay.


EDIT:
@edit

well licheus I did everything you give me and I have a problem, when I buff my unit, my unit doesn't receive + hp and + dmg, although it has the buff. Do you know what may be the problem?

@EDIT x2 - ok it works :) I had wrong condition in one trigger, it works now, thx mate :) really good idea. Now I will know how to implement buffs :) thx

Fantastic! =)
 
Level 2
Joined
Jan 2, 2014
Messages
7
Avatar does what you want on a unit by unit basis but may also make them spell immune (not intended).

I tried avatar, but it didn't work. It gave avatar to the unit, but I had to click on avatar to activate it, I want to have it activated already when item is used, btw I made it so I think this topic may be closed, thx very much for help guys ;)
 
Status
Not open for further replies.
Top