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

Crescent Arrow Spell

Status
Not open for further replies.
Hey guys. Indomitable1319 here. :)

I've got a small spell request. I've seen it before in some AoS map: a Ranger hero targets a point and an arrow fires from her right side and travels to the target point and back to the hero; in a crescent movement.

What I'm asking for is a duplicate of that spell, only this one not only deals damage to the targets hit by the arrow but it also slows the affected units.

Could someone please make this spell for me, and make the arrow speed customizable in the trigger? :)

Thank you! :D
Here's an illustration of what the spell looks like.
 

Attachments

  • szdf3r.png
    szdf3r.png
    26.9 KB · Views: 219
Kind of.
You understand the crescent part, although from what the image shows it looks like the phoenix follows the caster to find its end point.
What I am looking for is the unit targets a point, then the arrow fires from the right side and swoops to the left then returns to the caster; just like the illustration I have above. Each unit that is hit will receive damage and will be slowed for a short time.
 
Well, I don't know how good you are with triggering, but here is a snippet to produce a curving path to a target and then back to the caster:

JASS:
real t=0
real Xc = GetUnitX(caster)
real Yc = GetUnitY(caster)
real Xt = GetSpellTargetX()
real Yt = GetSpellTargetY()
unit arrow = CreateUnit(...)
//Periodic Timer:
set Xc=GetUnitX(caster)
set Yc=GetUnitY(caster)
call SetUnitX(arrow, (Xt-Xc)*Sin(t*PI)+0.25*(Yt-Yc)*Sin(2*t*PI)+Xc)
call SetUnitY(arrow, (Yt-Yc)*Sin(t*PI)+0.25*(Xc-Xt)*Sin(2*t*PI)+Yc)
call GroupEnumUnitInArea(foo, GetUnitX(Arrow),GetUnitY(arrow),AoE,Condition( function bar))
set t=t+interval

function bar takes nothing returns boolean
 local unit u = GetFilterUnit()
 if IsUnitEnemy(u,GetOwningPlayer(caster)) and not IsUnitType(u,UNIT_TYPE_DEAD) then
  call UnitDamageTarget(caster,u,....)
 endif
 return false
endfunction

The arrow comes back to the caster at t=1
 

Attachments

  • Lissajous.png
    Lissajous.png
    2.5 KB · Views: 155
Level 14
Joined
Jun 27, 2008
Messages
1,325
As far as i can see this only works if the spell gets casted to the east (blue curve), in other directions the arc looks weird.


359iku8.png


Code:
dt = [0:0.01:1];
hold all;

c = [0; 0];
t = [100; 0];
traj(1, :) = c(1) + (t(1) - c(1)) * sin(dt * pi) + 0.25 * (t(2) - c(2)) * sin(2 * dt * pi);
traj(2, :) = c(2) + (t(2) - c(2)) * sin(dt * pi) + 0.25 * (t(1) - c(1)) * sin(2 * dt * pi);
plot(traj(1, :), traj(2, :))

c = [0; 0];
t = [100; 100];
traj(1, :) = c(1) + (t(1) - c(1)) * sin(dt * pi) + 0.25 * (t(2) - c(2)) * sin(2 * dt * pi);
traj(2, :) = c(2) + (t(2) - c(2)) * sin(dt * pi) + 0.25 * (t(1) - c(1)) * sin(2 * dt * pi);
plot(traj(1, :), traj(2, :))

c = [0; 0];
t = [200; 100];
traj(1, :) = c(1) + (t(1) - c(1)) * sin(dt * pi) + 0.25 * (t(2) - c(2)) * sin(2 * dt * pi);
traj(2, :) = c(2) + (t(2) - c(2)) * sin(dt * pi) + 0.25 * (t(1) - c(1)) * sin(2 * dt * pi);
plot(traj(1, :), traj(2, :))

c = [0; 0];
t = [100; 200];
traj(1, :) = c(1) + (t(1) - c(1)) * sin(dt * pi) + 0.25 * (t(2) - c(2)) * sin(2 * dt * pi);
traj(2, :) = c(2) + (t(2) - c(2)) * sin(dt * pi) + 0.25 * (t(1) - c(1)) * sin(2 * dt * pi);
plot(traj(1, :), traj(2, :))

legend('t = [100; 0]', 't = [100; 100]', 't = [200; 100]', 't = [100; 200]')
xlabel('x');
ylabel('y');
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
Spell created. The arc is indeed erratic as muzzle pointed out. Mag is helping me find a better formula. So be patient and consider this a beta demo :D

Further details is included in my VM for you. Don't hesitate to contact me through PM or VM if you need any further assistance :D
 

Attachments

  • Crescent Shuriken.w3x
    28 KB · Views: 61
Level 14
Joined
Jun 27, 2008
Messages
1,325
Yeah, sorry guys, a sign error. The second line has to be call SetUnitY(arrow, (Yt-Yc)*Sin(t*PI)-0.25*(Xc-Xt)*Sin(2*t*PI)+Yc)

nah im sry u had it right in the first place

call SetUnitY(arrow, (Yt-Yc)*Sin(t*PI)+0.25*(Xc-Xt)*Sin(2*t*PI)+Yc)
is correct

nn5glc.png


i made a typ and used
call SetUnitY(arrow, (Yt-Yc)*Sin(t*PI)+0.25*(Xt-Xc)*Sin(2*t*PI)+Yc)
which is equal to
call SetUnitY(arrow, (Yt-Yc)*Sin(t*PI)-0.25*(Xc-Xt)*Sin(2*t*PI)+Yc)
 
Status
Not open for further replies.
Top