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

DBZ Transformation Health Help

Status
Not open for further replies.
Level 11
Joined
Aug 6, 2009
Messages
697
Alrght so what I am asking is if you guys could help me and a friend out with a DBZ Transformation I made,I made it pretty much just like DBZ Tribute except when you revert when your damage,you have about 1 little drop of health and a small amount of mana.My question is what could I do to make it so you don't end up with 1 health point when you revert.Here is a transformation trigger. Also +rep to correct answer.

Super Saiyan

  • Events
    • Player - Player 1 (Red) types a chat message containing ss as An exact match
  • Conditions
    • (Mana of |cffa52a2aSavior of Earth|r 0190 <gen>) Greater than 100.00
    • (Real((Hero level of |cffa52a2aSavior of Earth|r 0190 <gen>))) Greater than or equal to 2.00
    • Goku Not equal to 1.00
    • Goku Not equal to 2.00
    • Goku Not equal to 3.00
  • Actions
    • Sound - Play SuperSaiyan <gen>
    • Hero - Modify Strength of |cffa52a2aSavior of Earth|r 0190 <gen>: Set to ((Strength of |cffa52a2aSavior of Earth|r 0190 <gen> (Exclude bonuses)) x 2)
    • Hero - Modify Agility of |cffa52a2aSavior of Earth|r 0190 <gen>: Set to ((Agility of |cffa52a2aSavior of Earth|r 0190 <gen> (Exclude bonuses)) x 2)
    • Hero - Modify Intelligence of |cffa52a2aSavior of Earth|r 0190 <gen>: Set to ((Intelligence of |cffa52a2aSavior of Earth|r 0190 <gen> (Exclude bonuses)) x 2)
    • Unit - Change color of |cffa52a2aSavior of Earth|r 0190 <gen> to Yellow
    • Set Goku = 1.00
Drain and Special Effects

  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
    • Goku Equal to 1.00
  • Actions
    • Special Effect - Create a special effect attached to the origin of |cffa52a2aSavior of Earth|r 0190 <gen> using Abilities\Spells\Other\HealingSpray\HealBottleMissile.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect attached to the origin of |cffa52a2aSavior of Earth|r 0190 <gen> using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect attached to the origin of |cffa52a2aSavior of Earth|r 0190 <gen> using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
    • Special Effect - Destroy (Last created special effect)
    • Unit - Set mana of |cffa52a2aSavior of Earth|r 0190 <gen> to ((Mana of |cffa52a2aSavior of Earth|r 0190 <gen>) - ((Real((Intelligence of |cffa52a2aSavior of Earth|r 0190 <gen> (Exclude bonuses)))) / 5.00))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Mana of |cffa52a2aSavior of Earth|r 0190 <gen>) Less than or equal to 100.00
      • Then - Actions
        • Unit - Change color of |cffa52a2aSavior of Earth|r 0190 <gen> to Red
        • Hero - Modify Strength of |cffa52a2aSavior of Earth|r 0190 <gen>: Set to ((Strength of |cffa52a2aSavior of Earth|r 0190 <gen> (Exclude bonuses)) / 2)
        • Hero - Modify Agility of |cffa52a2aSavior of Earth|r 0190 <gen>: Set to ((Agility of |cffa52a2aSavior of Earth|r 0190 <gen> (Exclude bonuses)) / 2)
        • Hero - Modify Intelligence of |cffa52a2aSavior of Earth|r 0190 <gen>: Set to ((Intelligence of |cffa52a2aSavior of Earth|r 0190 <gen> (Exclude bonuses)) / 2)
        • Set Goku = 0.00
      • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
...except when you revert when your damage,you have about 1 little drop of health and a small amount of mana.My question is what could I do to make it so you don't end up with 1 health point when you revert.

Do you mean the unit reverts when it is damaged?

You could just increase the health of the unit with Unit - Set life to value or Unit - Set life to percentage.
 
Level 11
Joined
Aug 6, 2009
Messages
697
No when player 1 types revert it reverts the hero to its normal form,then the unit's health would go down to 1 hp (not max health) if the hero was damaged in the super saiyan form. Also if I used the set to life thing like just gave it +500 hp,a lot of players would abuse it and just type ss then revert then ss then revert.
 
Level 11
Joined
Sep 12, 2008
Messages
657
Welll.. imagine goku has 10 agility at start,
20 after transform.
he levels up twice, 24 agility now, +2 per level
now he reverts, he got 12 agility, not 14.
that would be very buggy, i sugguest using another integer to check the amount increased, then decrease that amount..
btw, goku should really be an integer, a real is just.. stupid?
and boolean would require 1 per transformation, so i donno, up to him if its dynamic.
Anyhow, about the health part, just get the percent life, and set life after transformation to that percent,
would make him keep the exact percent he had when he was at "ss" mode.
so 100 hp, 200 max hp.
lets say he gets 1 hp per str, he got 50 str,
so he got 150 max hp without str,
now he gets ss mode, 250 max hp:

100/200 = 0.5 // regular life without ss
x/250 = 0.5 // life with ss
x = 0.5 * 250 // just continuing the equation
x = 125 hp. // heres you're answer, 125 hp is 50% of 250.
so i guess that should be satisfying.. or just get his full life, not percent right before reverting, then get him to that exact life after he reverts.

Hope that i helped..
If i didnt get the question right, tell me, since im really tired right now..
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
The problem is the lost stats is causing the hero to lose current hitpoints. Try storing the unit's hitpoints as a percentage of current over maximum. Then revert the hero. Then restore the unit hitpoint percentage to be what it was orignally.

Percentage = current/maximum
current = percentage*maximum

Note that 99% is the same as 0.99. You want to use the multiple form so do not multiply by 100.
 
Status
Not open for further replies.
Top