• 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.

Potion Heal over Time based on Unit Attribute (It's Killing me!)

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hi!

I've been trying to achieve this for my map but I don't know how.

I created 15 Potions (5 Healing, 5 Mana and 5 Rejuvenation, which heals both by half). with a dummy effect that lasts 10 seconds, displaying the buff. Potions are untargetable, so I pretend to use this formula to heal.

Event: A unit uses an item

Condition: If item id = 'Hpo1' or 'Hpo2' or 'Hpo3' or 'Hpo4' or 'Hpo5' then
Set Php = Item Potion Hit Points
Set Att = Strength of - Target unit of used item -


Condition: If item id = 'Mpo1' or 'Mpo2' or 'Mpo3' or 'Mpo4' or 'Mpo5' then
Set Php = Item Potion Hit Points
Set Att = Intelligence of - Target unit of used item -


Formula: (60 * Php) + ((0.8 x Php) * Att) / 10.
-> Heal that amount every second, per 10 seconds, checking every second if the unit has the buff 'Healing Potion'.

If 'UnitHasBuff = false' then reset everything and stop the potion effect.

I use another trigger that removes the 'Healing potion' buff when the unit has 'Poison' buff, and removes 'Mana Potion' if the unit has 'Stun' buff. That's why I need to check if the unit has the buff before healing.

If the potion is a Mana Potion, then does the same, but using 'Int' attribute.

If the Potion is 'Rejuvenation potion' Is uses both formulas / 2, like this:

Set STR = GetHeroStr (Include Bonuses)
Set INT = GetHeroInt (Include Bonuses)

Formula: (((60 * Php) + ((0.8 x Php) * STR) / 2) / 10) <- For HP
Formula: (((60 * Php) + ((0.8 x Php) * INT) / 2) / 10) <- For MANA

OR

Formula: ((30 * Php) + ((0.4 x Php) * STR) / 10 <- For HP
Formula: ((30 * Php) + ((0.4 x Php) * INT) / 10 <- For MANA

This potion has its own buff and is permanent, not removeable by Poison nor Stun..

If the unit is already under the effect of a potion, and drinks another, stops the first potion effect and begins the second potion effect...



I know this is more a request than a 'Help with a trigger'... But u know... i'm desperate :goblin_cry:
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Well.. that's pretty much the idea I have. It can be JASS or vJASS, as long as it remains easy to manipulate (add other buffs that removes potion effects, or manipulate the formula values).

I don't think it's too hard to use in GUI. Since it just checks some booleans (Unit has Buff) and has one or two formulas, with 3 variables (something like that) and works with a timer and hashtable...

Maybe creating a GUI interface just to manipulate options and variables, but that works with a jass/vjass system on the background.
 
Status
Not open for further replies.
Top