Meowier
New Member
- Reaction score
- 6
Okay, basically this spell is called Meat Shield. Basically when the buff is placed on an ally, a % of damage they take is taken by the caster of Meat Shield instead. Basically a damage mitigator.
The spell works, it just doesn't work, and I know why, I just need help figuring a way around it. There's three triggers.
Meat Shield
Obviously the first trigger is necessary for any takes damage event.
Meat Shield Cast
This spell sets the spell's level so that the % needed is clear, and if the caster levels up the spell while it's in effect, the already in effect spell won't change. It also sets the caster.
Meat Shield Damage
And the last trigger is the one that actually does stuff. Now i'm well aware of why the spell won't work like it should in certain circumstances. Basically after each variable there's [Player number of (Owner of Triggering unit)))], and in the Meat Shield Damage trigger, that stuffs it up because the triggering unit is the unit getting hurt.
So basically, if player 2 casts this on a player 1 unit, it won't work. If Player 1 casts this on a player 2 unit, it won't work. However, if player 1 casts it on a player 1 unit, it does work.
I need to find another way to do the Index on the variables that will allow it to be usable for multiple players.
Any suggestions?
The spell works, it just doesn't work, and I know why, I just need help figuring a way around it. There's three triggers.
Meat Shield
Code:
Events
- Unit - A unit enters (Playable map area)
Conditions
Actions
- Trigger - Add to Meat Shield Damage <gen> the event (Unit - (Triggering unit) Takes damage)
Obviously the first trigger is necessary for any takes damage event.
Meat Shield Cast
Code:
Events
- Unit - A unit Starts the effect of an ability
Conditions
- (Ability being cast) Equal to Meat Shield
Actions
- Set MeatShieldCaster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
- Set MeatShieldInteger[(Player number of (Owner of (Triggering unit)))] = (Level of Meat Shield for (Triggering unit))
This spell sets the spell's level so that the % needed is clear, and if the caster levels up the spell while it's in effect, the already in effect spell won't change. It also sets the caster.
Meat Shield Damage
Code:
Events
Conditions
- ((Triggering unit) has buff Meat Shield ) Equal to True
Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MeatShieldInteger[(Player number of (Owner of (Triggering unit)))] Equal to 1
Then - Actions
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (((Real(MeatShieldInteger[(Player number of (Owner of (Triggering unit)))])) x 0.50) x (Damage taken)))
Unit - Set life of MeatShieldCaster[(Player number of (Owner of (Triggering unit)))] to ((Life of MeatShieldCaster[(Player number of (Owner of (Triggering unit)))]) - (((Real(MeatShieldInteger[(Player number of (Owner of (Triggering unit)))])) x 0.50) x (Damage taken)))
Else - Actions
And the last trigger is the one that actually does stuff. Now i'm well aware of why the spell won't work like it should in certain circumstances. Basically after each variable there's [Player number of (Owner of Triggering unit)))], and in the Meat Shield Damage trigger, that stuffs it up because the triggering unit is the unit getting hurt.
So basically, if player 2 casts this on a player 1 unit, it won't work. If Player 1 casts this on a player 2 unit, it won't work. However, if player 1 casts it on a player 1 unit, it does work.
I need to find another way to do the Index on the variables that will allow it to be usable for multiple players.
Any suggestions?