RaiJin
New Member
- Reaction score
- 40
Okay was making a quick spell and was going to sumbit it :S heres the code
hes not dashing T_T help? pl0x
JASS:
scope WaveForm initializer WaveFormInit
globals
private constant string EFFECT = "Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl" //Water effect used when dashing
private constant real DISTANCE = 30.00 //Distance used
private constant real TIMERINTERVAL = 0.03 //Perodic Timer interval
private constant real DMGCOUNT = 100.00 // DAMAGE PER LEVEL
private constant real MAXDISTANCE = 1100.00 //MAXDISTANCE TRAVELED
private constant real AOE = 200.00// MAX AOE OF THE SPELL
private constant integer WAVEFORMID = 039;WAV3039; //SpellID NAM
endglobals
private struct data
unit u
location ul
location sl
integer lvl
real DAMAGE
real dis
real x
real y
real x2
real y2
timer time
group ug
method CleanUp takes nothing returns nothing
call DestroyGroup(.ug)
call RemoveLocation(.ul)
call RemoveLocation(.sl)
set .u=null
set .ul=null
set .sl=null
endmethod
endstruct
private function GroupDMGCheck takes nothing returns boolean
local data d
return IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(d.u))
endfunction
private function WConditions takes nothing returns boolean
return GetSpellAbilityId() == WAVEFORMID
endfunction
private function GroupDAMAGE takes nothing returns nothing
local data d
call UnitDamageTargetBJ(d.u, GetEnumUnit(), d.DAMAGE, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
endfunction
private function Movement takes nothing returns nothing
local data d
local effect e
local real xx
local real yy
local location wl=GetUnitLoc(d.u)
set d.x=GetUnitX(d.u) + DISTANCE
set d.y=GetUnitY(d.u) + DISTANCE
set xx=d.x - d.x2
set yy=d.y - d.y2
set d.dis=SquareRoot( xx * xx + yy * yy)
if d.dis < MAXDISTANCE then
call SetUnitX(d.u, d.x)
call SetUnitY(d.u, d.y)
set d.ug=GetUnitsInRangeOfLocMatching(AOE, wl, Condition(function GroupDMGCheck))
set e=AddSpecialEffect(EFFECT, d.x, d.y)
call DestroyEffect(e)
call ForGroup(d.ug, function GroupDAMAGE)
else
call d.CleanUp()
call SetUnitInvulnerable(d.u, false)
call SetUnitVertexColorBJ(d.u, 100.00, 100.00, 100.00, 100.00)
call PauseTimer(GetExpiredTimer())
call SetUnitPathing(d.u, true)
call d.destroy()
endif
endfunction
private function WActions takes nothing returns nothing
local data d = data.create()
set d.u=GetTriggerUnit()
set d.ul=GetUnitLoc(d.u)
set d.sl=GetSpellTargetLoc()
set d.lvl=GetUnitAbilityLevel(d.u, WAVEFORMID)
set d.DAMAGE=I2R(d.lvl)*DMGCOUNT
set d.time=CreateTimer()
set d.dis=0.00
set d.x2=GetLocationX(d.sl)
set d.y2=GetLocationY(d.sl)
call RemoveLocation(d.ul)
call RemoveLocation(d.sl)
set d.ul=null
set d.sl=null
call SetUnitInvulnerable(d.u, true)
call SetUnitPathing(d.u, false)
call SetUnitVertexColorBJ(d.u, 100.00, 100, 100, 0.00)
call TimerStart(d.time, TIMERINTERVAL, true, function Movement)
endfunction
public function WaveFormInit takes nothing returns nothing
local trigger WaveForm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( WaveForm, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( WaveForm, Condition( function WConditions ) )
call TriggerAddAction( WaveForm, function WActions )
endfunction
endscope
hes not dashing T_T help? pl0x