• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Shockwave 3 line

Status
Not open for further replies.
Level 4
Joined
Dec 16, 2013
Messages
84
sorry for my english
how to make skill like so?
shockwave that shoot to 3 line
0=caster
\ | / = shockwave


-\--|--/-
--\-|-/-
---\|/-
----0-

thanks
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
You will need to make a trigger enchanced ability for this.

First create a dummy unit. This must have 0 movement speed (no rotation), 0 cast point/back swing (instant cast) and locust (does not interact directly with other units). Also set it so it does not need to decay when dead.

You then create a dummy shockwave ability and give it to the dummy unit. This is set for the side shockwaves and will be cast exactly twice.

You then create the actual shockwave ability for your unit to cast. This is the ability that will be trigger enhanced and is responsible by itself for creating the middle shockwave.

Then create a trigger with the event any unit starts the effect of an ability (important that it starts the effect so cost and cooldown are applied while still being able to get cast specifics). A condition must test if the cast ability is equal to the actual shockwave ability.

You then create the dummy unit at the point of the caster with any facing. Give the dummy unit an expiration time of a second or so to make sure casting succeeds.

You then get the cast angle. This is the angle from the caster position to the ability target position. You then create the angles for the left and right shockwaves by adding or removing a constant angle amount. Do not worry about the number range for angles as the game will interpret them correctly (eg -15 degrees is same as 345 degrees or 705 degrees).

You use the angles from above to create polar offsets from the caster position at some reasonable distance away (enough to accurately cast the dummy shockwave, so 100 units or so should be fine).

Finally you order the dummy unit to cast the dummy shockwave for both the left and right shockwaves positions that you computed.

Do be aware that location objects are not automatically garbage collected. You need to manually remove them with the "RemoveLocation" native (not available in GUI) otherwise they will leak. Continuous leaking of objects like locations can result in degraded performance or crashes so is not something one can ignore.

An example of removing a location (Point in GUI) from the GUI global variable named "APoint".
JASS:
call RemoveLocation(udg_APoint)
This would be inserted in custom script action in your GUI trigger.
 
Level 9
Joined
Apr 23, 2011
Messages
527
create a dummy unit with no model and cast backswing and point to 0, give it locust and invulnerability
create an ability based off channel that the hero uses
create another ability based off carrion swarm that the dummy unit uses
then use this trigger:
  • Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spell
    • Actions
      • Set p[1] = (Position of (Triggering unit))
      • Set p[2] = (p[1] offset by 25.00 towards ((Facing of (Triggering unit)) + 15.00) degrees)
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at p[1] facing Default building facing degrees
      • Set dummy = (Last created unit)
      • Unit - Add Spell (Dummy Ability) to dummy
      • Unit - Set level of Spell (Dummy Ability) for dummy to (Level of Spell for (Triggering unit)) ----this line is for hero spells only----
      • Unit - Order dummy to Undead Dreadlord - Carrion Swarm p[2]
      • Custom script: call RemoveLocation(udg_p[2])
      • Set p[2] = (p[1] offset by 25.00 towards ((Facing of (Triggering unit)) - 15.00) degrees)
      • Unit - Order dummy to Undead Dreadlord - Carrion Swarm p[2]
      • Custom script: call RemoveLocation(udg_p[2])
      • Set p[2] = (p[1] offset by 25.00 towards (Facing of (Triggering unit)) degrees)
      • Unit - Order dummy to Undead Dreadlord - Carrion Swarm p[2]
      • Custom script: call RemoveLocation(udg_p[2])
      • Unit - Remove dummy from the game
      • Custom script: call RemoveLocation(udg_p[1])
using the shockwave as a base ability might also work, but i prefer carrion swarm as it doesn't deform the ground.
 
Last edited:
Status
Not open for further replies.
Top