• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Max. HP Buff

Status
Not open for further replies.
Level 15
Joined
Jan 27, 2007
Messages
948
Hello to everyone ^^

I have a question; i am trying to make a buff, casted by a hero (this skill may have levels) that increases the max. health points, just like the World of Warcraft Stamina skill, from the priest, but i don't know what skill to use as base :S
Anyone have any idea?

Many thanks in advance.
 
Level 11
Joined
May 31, 2008
Messages
698
Its hp bonus. It is an item ability. But i dont think that you can use that ability directly. Is the hero supposed to gain max hp when it casts the spell or when it learns the spell?
But either way i would just make an item for each level that increases hp by whatever you want (use manual of health for base item).
When the hero casts or learns the ability (not sure which one you want) then do Hero - Create item for hero to make the manual of health that u created.
If you dont know exactly how to do this just explain more and i can create the trigger for you.
 
Level 11
Joined
May 31, 2008
Messages
698
oh i see. You should make another item that is based on manual of health but it takes away health (not positive if you can do that). But to make the value negative hold shift when you select it. So like for Data - Health Bonus when you double click it to change the value, hold shift. That way you can make it negative if u cant normally. Make a trigger every 1 second pick all units in map matching unit doesn not have the buff and unit isnt in healthgroup. Just make healthgroup a unit group and when a unit casts the ability add it to healthgroup

Every 1 second
pick all units in map matching unit has buff HealthBonus not equal to true and matching unit is in healthgroup equal to true (both are booleans)
then create negativehealthitem for picked unit
remove picked unit from healthgroup

and that should do it.
 
Level 4
Joined
Oct 18, 2007
Messages
99
Sure i guess if that works and its easier then do it lol maybe i was making it too complicated >.<

My friend ... This time I know the answer you not... hehe


Make 2 skills
1- spell book that has the skill item permanent add hp with levels (any level is how much u want to add)
2 - dummy spell that has requirements of custom dummy unit called "fucking 2"

Make 2 dummy units
1 - called fucking 1 that is actually timer
2 - called fucking 2 that is the requirements for the spell

Make 3 Triggers:


Trigger 1 of 3:

Trigger - game instalation
Action - Disable Spell Book (addited with a skill of an item that adds permanent hp)
For each integer from 1 to max players
Create one dummy unit (type 2) for each [Integer A]

go make a spell book with skill: permanent hit point adding. make the adding with a levels of the skill you want!.

Trigger 2 of 3

Trigger - unit cast a spell
condition - ability being cast is a dummy spell that do nothing - that gives his buff (you can add effects and stuff so it has more attributes or has better visuals)
Actions -
kill one random unit from unitgroup = the random is a unit type of fucking 2
set "playernumber" = (player number of casting unit)
set shithead [player number] = target of ability been cast.
create Dummy unit that the player cant see named "FUCKING1" (no need to set it into an value)
Add (the seconds you want this to last) time to shithead[playernumber] time to its timed life
Add spell book to "shithead[player number of casting unit]"


Trigger 3/3
trigger Unit dies
condition unit type equals to shit head
remove the skills spell book from "shithead"
create 1 dummy2 unit that called "FUCKING 2" for the player that the unit was dead in his army



Notes:
1 - I made it so you cant add hit points once for each player , this 3 triggers works perfectly if you attend to use it for one hero for each player (even if u cast this skill twise on same unit the extra hit points will stay as it should and not twise hit points.
2 - work with leak checker to make it leak less.
3 - you can addit it to make it work for many units but in that case you will have big difficulty to set the target unit for the removal, you will need "unit[100]" and each time save in [number + 1 from the trigger use before] and when it reachs "number = 100" set it back to zero.
since its complecated that much I just used one hero use to save the trouble of culculating all of this.


Enjoy.
 
Level 5
Joined
Aug 27, 2008
Messages
126
Hmm.. You can do it Like This:
1. Make your ability from Inner Fire. Name it Stamina Buff (or something else).Set all bonuses to 0 and change the buff name to Stamina Buff (or something else).
2. Make a custom upgrade from Animal War Training. Name it Stamina Buff (or something else). Make the levels equal to the max level of the ability. Adjust the bonuses for every level too.
3. Add the upgrade Stamina Buff to all heroes you use in your map (techtree - upgrades used)
4. Create a unit group called "WithStaminaBuff"
5. Setting the triggers:

Trigger: Cast Ability
Event: Unit - A unit starts the effect of an ability.
Condition: Ability - Ability being cast equal to Stamina Buff.
Actions: Player - Set the current research level of Stamina Buff to (Level of Stamina Buff for (Casting unit)) for (Owner of (Target unit of ability being cast))
Unit Group - Add target unit of ability being cast to WithStaminaBuff

Trigger: Remove Bonus
Event: Time - Every 0.10 seconds
Actions: Unit Group - Pick every unit in WithStaminaBuff and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff Stamina Buff) Equal to False
Then - Actions
Unit Group - Remove (Picked unit) from (WithStaminaBuff)
Player - Set the current research level of Stamina Buff to 0 for (Owner of (Picked unit))
Else - Actions

If the trigger Remove Bonus is too laggy for you, I can make a lot less laggier, just tell me. I hope I helped you :)
 
Level 4
Joined
Oct 18, 2007
Messages
99
Player - Set the current research level of Stamina Buff to 0 for (Owner of (Picked unit))

It will not work because once you added a research level you cant make it lower UNLESS you are using World Editor Unlimited which might make your map crush and unable to be used again.

Same Goes for tomes of hit points since using value - (using Shift enter on the skill) causes the exactly same bug (a map of mine happened to have this bug a week ago and I needed to remake the last version.
since all of those...
the best unbugged way is the book.



NOTE!!!!
Using research number one that adds hit points and research 2 that lower hit points will make it bug free BUT you cant make unlimited levels for tech and u might use more that my friend makes lag. it will also work for one unit only and my way will work for unlimited

another NOTE
if you are using my way you will have to figure out what to do about units that died and brought back to life such as tauten ultimate revive altar and resurrection because when a unit is dead... I am not sure about having the dead unit removed ability while it is dead available.
 
Level 2
Joined
Aug 9, 2008
Messages
22
Channel ftw! Use a hashtable and force the effect using SetUnitState(buffedunit, UNIT_STATE_MAX_LIFE, value). The hashtable can keep track of every unit with the buff and the duration as well. Use GetUnitState(buffedunit, UNIT_STATE_MAX_LIFE) so you can add an subtract from this to give and remove the buff.

Hashtable Miniguide
 
Status
Not open for further replies.
Top