sacraficing health spells

refl3ction

New Member
in my game i have spells that sacrafice health before the ability is used... the percent sacraficed depends on the power of the spell for instance one spell requires a sacrafice of 50% of the caster's health to deal 300 damage... in testing these abilities the caster does not lose any health but dies so ill post my trigger up and see if ne1 can help out

heres one:
Code:
Oblivion
????Events
????????Unit - A unit Begins casting an ability
????Conditions
????Actions
????????If (All Conditions are True) then do (Then Actions) else do (Else Actions)
????????????If - Conditions
????????????????(Ability being cast) Equal to Oblivion (2)
????????????Then - Actions
????????????????Unit - Set life of (Summoning unit) to ((Life of (Summoning unit)) - 50.00)%
????????????Else - Actions
????????????????Do nothing

and heres another:
Code:
Lament
????Events
????????Unit - A unit Spawns a summoned unit
????Conditions
????Actions
????????If (All Conditions are True) then do (Then Actions) else do (Else Actions)
????????????If - Conditions
????????????????(Unit-type of (Summoned unit)) Equal to Lamenting Elemental (Level 3)
????????????Then - Actions
????????????????Unit - Set life of (Summoning unit) to ((Life of (Summoning unit)) - 20.00)%
????????????Else - Actions
????????????????Do nothing
????????If (All Conditions are True) then do (Then Actions) else do (Else Actions)
????????????If - Conditions
????????????????((Summoned unit) is dead) Equal to True
????????????Then - Actions
????????????????Unit - Set life of (Summoning unit) to ((Life of (Summoning unit)) + 20.00)%
????????????Else - Actions
????????????????Do nothing

any ideas?
 
Werbung:

Undead_Lives

New Member
My first advice would be to not use If Then Elses if they are not necessary.
For instane, in your first trigger, you don't need it. Just put the condition of If in Conditions, and the Actions of Then in Actions. If the Condition is not met, the trigger won't run at all.
Now the reason your triggers aren't working is because you're using "Summoning Unit" when the in the Events you specified that it was the start of an ability.
So, instead you need to use "Casting Unit"
Also, your first trigger only sets the unit's health to half. That's it. It needs the other actions.
Finally, your action is wrong. You need to specify the PERCENTAGE health, not the actual health value. So, change your trigger to something like this:
Code:
Untitled Trigger 001
????Events
????????Unit - A unit Begins casting an ability
????Conditions
????Actions
????????Unit - Set life of (Casting unit) to ((Percentage life of (Casting Unit)) - 50.00)%
 

refl3ction

New Member
oh......
thanks undead :)

but for the second ability, when the summoned unit dies, that 20% is returned to the caster, how would i go about doing this?
 
Werbung:
Top