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