- Joined
- Nov 23, 2008
- Messages
- 512
hey i tryed to create my first vJass spell but i don't know any more. i hope everybody knows BTanks and the Earth Robot. the tank has a ability called "Dustwave". i want to create this spell. here is my current code: (short)
it may have leaks!
plz help me. and if you don't know the spell i can make a gui version.
JASS:
library Dustwave initializer Init
globals
private constant integer speed = 1050
private constant integer spellID = 'A000'
private constant real refresh = 0.1
private constant real distance = 800
private integer total = 0
private timer time = CreateTimer()
endglobals
private struct information
unit u
real distancedone
endstruct
globals
information array units
endglobals
function check takes nothing returns boolean
return GetSpellAbilityId() == spellID
endfunction
function Initdustwave takes nothing returns nothing
set total = total + 1
endfunction
function Initdustwaveloop takes nothing returns nothing
local information dat
local real x1 = GetUnitX(dat.u)
local real y1 = GetUnitY(dat.u)
local real x2 //formula..
local real y2 //formula..
set dat.distancedone = dat.distancedone + speed/10
endfunction
private function getcaster takes unit u returns information
local integer i
local information dat
loop
exitwhen i > total
set dat = units[i]
if dat.u == u then
return dat
endif
set i = i+1
endloop
set u = null
return 0
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerAddAction(t, function Initdustwave)
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition(t, Condition(function check))
set t = null
endfunction
endlibrary
it may have leaks!
plz help me. and if you don't know the spell i can make a gui version.