- Joined
- Apr 6, 2008
- Messages
- 760
i posted this spell in the "spell section" in it got "Non-approved Still in moderation queue" just want to figure out why since i havnt been doing jass for so long time(like 1 month), is it the whole code, just stupid line or something that is bad/wrong. i have gone thru this code like 10 times and i cant find something(and yes im very stuborn) :/
JASS:
//==========================SETUP STARTS========================//
constant function Missle_SpellId takes nothing returns integer
return 'A000'
endfunction
constant function Missle_DummyId takes nothing returns integer
return 'h000'
endfunction
constant function Missle_SFX takes nothing returns string
return "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl"
endfunction
constant function Missle_DmgArea takes nothing returns real
return 300.
endfunction
constant function Missle_Dmg takes nothing returns real
return 100.
endfunction
constant function MissleMaxDist takes nothing returns real
return 2000.
endfunction
constant function MissleMoveSpd takes nothing returns real
return 30.
endfunction
function Missle_dmg takes integer lvl returns real
return 100.*lvl //make your forumla here
endfunction
//==========================SETUP ENDS==========================//
function Missle_Conds takes nothing returns boolean
return GetSpellAbilityId() == Missle_SpellId()
endfunction
function MisslePreLoad takes nothing returns nothing
call Preload(Missle_SFX())
call RemoveUnit(CreateUnit(Player(15),Missle_DummyId(),0,0,0))
endfunction
function MPick_Conds takes nothing returns boolean
return GetWidgetLife(GetFilterUnit()) > .405 and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetHandleUnit(GetExpiredTimer(),"c")))
endfunction
function Missle_End takes nothing returns nothing
local trigger trig = GetTriggeringTrigger()
local timer Loop = GetHandleTimer(trig,"Loop")
call PauseTimer(Loop)
call DestroyTimer(Loop)
call DestroyTrigger(trig)
call FlushHandleLocals(Loop)
call FlushHandleLocals(trig)
set trig = null
set Loop = null
endfunction
function Missle_Move takes nothing returns nothing
local timer Mtimer = GetExpiredTimer()
local unit c = GetHandleUnit(Mtimer,"c")
local unit dum = GetHandleUnit(Mtimer,"dum")
local group g
local real dist = GetHandleReal(Mtimer,"dist")+30
local real angle = GetHandleReal(Mtimer,"angle")
local unit d
call SetHandleReal(Mtimer,"dist",dist)
call SetUnitX(dum,(GetUnitX(dum) + MissleMoveSpd() * Cos(angle * bj_DEGTORAD)))
call SetUnitY(dum,(GetUnitY(dum) + MissleMoveSpd() * Sin(angle * bj_DEGTORAD)))
if CountUnitsInGroup(GetUnitsInRangeOfLocMatching(60.,GetUnitLoc(dum),Filter(function MPick_Conds))) > 0 then
call DestroyEffect(AddSpecialEffect(Missle_SFX(),GetUnitX(dum),GetUnitY(dum)))
set g = CreateGroup()
call GroupEnumUnitsInRange(g,GetUnitX(dum),GetUnitY(dum),Missle_DmgArea(),Filter(function MPick_Conds))
loop
set d = FirstOfGroup(g)
exitwhen d == null
call GroupRemoveUnit(g,d)
call UnitDamageTarget(c,d,Missle_dmg(GetUnitAbilityLevel(c,Missle_SpellId())),false,false,null,null,null)
call RemoveUnit(dum)
call FlushHandleLocals(Mtimer)
call PauseTimer(Mtimer)
call DestroyTimer(Mtimer)
set d = null
endloop
endif
if dist >= MissleMaxDist() and not IsUnitType(dum,UNIT_TYPE_DEAD) then
call KillUnit(dum)
call FlushHandleLocals(Mtimer)
call PauseTimer(Mtimer)
call DestroyTimer(Mtimer)
endif
set c = null
set dum = null
set g = null
set Mtimer = null
endfunction
function Missle_Actions takes nothing returns nothing
local timer Loop = GetExpiredTimer()
local unit c = GetHandleUnit(Loop,"c")
local real x = GetHandleReal(Loop,"x")
local real y = GetHandleReal(Loop,"y")
local real angle = GetHandleReal(Loop,"angle")
local timer Mtimer = CreateTimer()
local unit dum = CreateUnit(GetOwningPlayer(c),Missle_DummyId(),(x + 75 * Cos(angle * bj_DEGTORAD)),(y + 75 * Sin(angle * bj_DEGTORAD)),angle)
call PauseUnit(dum,true)
call SetHandleHandle(Mtimer,"c",c)
call SetHandleHandle(Mtimer,"dum",dum)
call SetHandleReal(Mtimer,"angle",angle)
call TimerStart(Mtimer,.035,true,function Missle_Move)
set c = null
set dum = null
set Loop = null
set Mtimer = null
endfunction
function Missle_Act takes nothing returns nothing
local trigger trig = CreateTrigger()
local timer Loop = CreateTimer()
local unit c = GetTriggerUnit()
local real x = GetUnitX(c)
local real y = GetUnitY(c)
local location = GetSpellTargetLoc()
local real tx = GetLocationX(loc)
local real ty = GetLocationY(loc)
local real angle = Atan2((ty-y),(tx-x))*57.29583
call SetHandleHandle(Loop,"c",c)
call SetHandleReal(Loop,"x",x)
call SetHandleReal(Loop,"y",y)
call SetHandleReal(Loop,"angle",angle)
call SetHandleHandle(trig,"Loop",Loop)
call TriggerRegisterUnitEvent(trig,c, EVENT_UNIT_SPELL_ENDCAST)
call TriggerAddAction(trig, function Missle_End)
call TimerStart(Loop,1.,true,function Missle_Actions)
call Removelocation(loc)
set loc = null
set trig = null
set Loop = null
set c = null
endfunction
function InitTrig_Missle takes nothing returns nothing
local trigger t = CreateTrigger()
local integer a = 0
loop
call TriggerRegisterPlayerUnitEventSimple(t,Player(a),EVENT_PLAYER_UNIT_SPELL_EFFECT)
set a = a + 1
exitwhen a == 16
endloop
call TriggerAddAction(t, function Missle_Act)
call TriggerAddCondition(t, Filter(function Missle_Conds))
call MisslePreLoad()
endfunction
Attachments
Last edited: