PooBucket
New Member
- Reaction score
- 12
Hey. This is a spell that is from Harry Potter which I've been mucking around with but I can't get it to be MUI (seems complex..:S lol). It's an aiming spell (that is, not homing like most of Warcraft spells - Storm Bolt, etc) which when comes close to a target, stuns and deals damage to it. When two are cast after each other, one goes straight through the target but the other does damage and stuns.
Btw Spell ID is really just to identify the difference between a missile and a caster to simplify the Spell Movement Trigger. I use a dummy to cast the spell when the missile hits because it's much easier and simpler since the missile is moving too quickly to cast the spell.
Also, can I use these two variables,
Set CasterPos = (Position of (Triggering unit))
Set CastTargetPoint = (Target point of ability being cast)
for all my other spells as well (that are similar to this one)? Or do I need to make individual variables for each one? +Which condition should I use if I want the spell to be able to hit teammates as well + enemies but not myself?
Any helpers? . Thanks!
Code:
Stupefy
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Stupefy
Actions
Set CasterPos = (Position of (Triggering unit))
Set CastTargetPoint = (Target point of ability being cast)
Unit - Create 1 Stupefy for (Owner of (Triggering unit)) at CasterPos facing CastTargetPoint
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Trigger - Add to Stupefy Hit 1 Copy <gen> the event (Unit - A unit comes within 80.00 of (Last created unit))
Custom script: call RemoveLocation (udg_CasterPos)
Custom script: call RemoveLocation (udg_CastTargetPoint)
Code:
Stupefy Hit
Events
Conditions
((Triggering unit) belongs to an enemy of (Owner of (Last created unit))) Equal to True
Actions
Unit - Kill (Last created unit)
Set StupefyHitPos = (Position of (Triggering unit))
Unit - Create 1 Dummy Spellcaster for (Owner of (Last created unit)) at StupefyHitPos facing Default building facing degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Unit - Add Stupefy (Stun) to (Last created unit)
Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Triggering unit)
Custom script: call RemoveLocation (udg_StupefyHitPos)
Code:
Spell Movement
Events
Time - Every 0.04 seconds of game time
Conditions
Actions
Set SpellMovementGroup = (Units in (Playable map area) matching (((Level of Spell ID for (Matching unit)) Equal to 1) and (((Matching unit) is alive) Equal to True)))
Unit Group - Pick every unit in SpellMovementGroup and do (Actions)
Loop - Actions
Set SpellMovementPos = (Position of (Picked unit))
Unit - Move (Picked unit) instantly to (SpellMovementPos offset by 25.00 towards (Facing of (Picked unit)) degrees)
Custom script: call RemoveLocation (udg_SpellMovementPos)
Custom script: call DestroyGroup (udg_SpellMovementGroup)
Btw Spell ID is really just to identify the difference between a missile and a caster to simplify the Spell Movement Trigger. I use a dummy to cast the spell when the missile hits because it's much easier and simpler since the missile is moving too quickly to cast the spell.
Also, can I use these two variables,
Set CasterPos = (Position of (Triggering unit))
Set CastTargetPoint = (Target point of ability being cast)
for all my other spells as well (that are similar to this one)? Or do I need to make individual variables for each one? +Which condition should I use if I want the spell to be able to hit teammates as well + enemies but not myself?
Any helpers? . Thanks!