native CreateUnit takes player id, integer unitid, real x, real y, real face
one time only, right after spellcastDepending on what you're using:
native CreateUnit takes player id, integer unitid, real x, real y, real face
To damage enemies it depends how you want to do that. One time? Multiple times? DoT? Other conditions? You could use dummy units with Permanent Immolation (base on item version) to do the damage but the right unit won't get kill credit and the damage isn't very easily configured that way. Need more details.
Unit - Create 1 <whatever> for Player 1 at <location> facing Default building facing degrees
ok, thank you for the help.Do what pOke suggested.
thank you! it helped me, but does it only summon three fissurepieces? like 0= fissure: C=Caster: C 0 0 0 looks like these.it has gaps. But much appreciated, thank you againTake a look at this...
Untitled Trigger 023
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Fissure
Actions
Set TempUnit = (Triggering unit)
Set TempPoint = (Position of TempUnit)
Set TempPoint2 = (Target point of ability being cast)
Set TempReal = (Angle from TempPoint to TempPoint2)
Custom script: set udg_TempGroup = CreateGroup()
For each (Integer TempInteger) from 1 to 10, do (Actions)
Loop - Actions
Set TempPoint3 = (TempPoint offset by (someDistance x (Real(TempInteger))) towards TempReal degrees)
Unit - Create 1 FissurePiece for (Owner of TempUnit) at TempPoint3 facing Default building facing degrees
Unit - Add a X second Generic expiration timer to (Last created unit)
Set TempGroup = (Units within someRange of TempPoint3)
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Set TempUnit2 = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit2 belongs to an enemy of (Owner of TempUnit)) Equal to True
(TempUnit2 is in TempGroup) Equal to False
// Other Conditions
Then - Actions
Unit Group - Add TempUnit2 to TempGroup
Unit - Cause TempUnit to damage TempUnit2, dealing someDamage damage of attack type Spells and damage type Normal
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint3)
Custom script: call DestroyGroup(udg_TempGroup2)
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call RemoveLocation(udg_TempPoint2)
Custom script: call DestroyGroup(udg_TempGroup)
So what's happening here is:
Unit casts the spell
We save their position
We save their target position
We use these two points to find the angle to make the wall along.
We create a group so units can be added to it and not damaged by multiple "pieces"
The Loop from 1 to 10 is an example of a distance, it could be longer or shorter.
Inside the loop we create a piece of the fissure at each offset so its basically a "line" of units. The someDistance is how close together these units should be.
It then creates a piece of the fissure, you add a generic expiration to the unit so it dies when the duration of the spell should end.
Each time a piece of the fissure spawns, we want to check around the unit to deal damage to it. So we create a group and search for acceptable targets. If you want it to stun, you'd probably create a unit before this loop and have that dummy do all the stunning rather than creating one per unit.
We add the unit to the tempgroup so it is not damaged/stunned more than once.
Rest is removing leaks.
ok no thanks, i've figured it out.thank you! it helped me, but does it only summon three fissurepieces? like 0= fissure: C=Caster: C 0 0 0 looks like these.it has gaps. But much appreciated, thank you again![]()
yeah,, i'll try it. uhh how do i make a unit move to a specific distance?, also damaging anything it passesSo I've done some more testing and coding for it. Take a look at the test map and see if its to your liking.
Fissure
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Fissure
Actions
Set TempUnit = (Triggering unit)
Set TempPlayer = (Owner of TempUnit)
Set TempPoint = (Position of TempUnit)
Set TempPoint2 = (Target point of ability being cast)
Set TempReal = (Angle from TempPoint to TempPoint2)
Custom script: set udg_TempGroup = CreateGroup()
For each (Integer TempInteger) from 1 to 10, do (Actions)
Loop - Actions
Set TempPoint3 = (TempPoint offset by (100.00 x (Real(TempInteger))) towards TempReal degrees)
Unit - Create 1 Fissure Piece for TempPlayer at TempPoint3 facing (Facing of TempUnit) degrees
Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
Unit - Create 1 Path Blocker Dummy for TempPlayer at TempPoint3 facing (Facing of TempUnit) degrees
Custom script: call SetUnitX(bj_lastCreatedUnit, GetLocationX(udg_TempPoint3))
Custom script: call SetUnitY(bj_lastCreatedUnit, GetLocationY(udg_TempPoint3))
Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
Set TempGroup2 = (Units within 100.00 of TempPoint3)
Unit Group - Pick every unit in TempGroup2 and do (Actions)
Loop - Actions
Set TempUnit3 = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit3 belongs to an enemy of (Owner of TempUnit)) Equal to True
(TempUnit3 is in TempGroup) Equal to False
Then - Actions
Unit Group - Add TempUnit3 to TempGroup
Unit - Create 1 Generic Dummy for (Owner of TempUnit3) at TempPoint3 facing Default building facing degrees
Set TempUnit4 = (Last created unit)
Unit - Add Fissure Stun to TempUnit4
Unit - Set level of Fissure Stun for TempUnit4 to (Level of Fissure for TempUnit)
Unit - Add a 1.00 second Generic expiration timer to TempUnit4
Unit - Order TempUnit4 to Human Mountain King - Storm Bolt TempUnit3
Unit - Cause TempUnit to damage TempUnit3, dealing (100.00 x (Real((Level of Fissure for TempUnit)))) damage of attack type Spells and damage type Normal
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint3)
Custom script: call DestroyGroup(udg_TempGroup2)
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call RemoveLocation(udg_TempPoint2)
Custom script: call DestroyGroup(udg_TempGroup)
okUnit - move UNIT to LOCATION
Or SetUnitX() and SetUnitY()
To damage, check out what pOke did-- get a group of the units in range and use the "Unit - Cause UNIT to damage UNIT for X damage of attack type spells and damage type normal" command like he did.