- Joined
- Jul 18, 2009
- Messages
- 200
Hello. My spell doesnt do anything. And i get so angry at it.
Code:
Everything should be as it should
//Chaos_Knight
Code:
JASS:
scope WaterGodSpell initializer Init
globals
private constant integer SpellID = 'A000'
private constant integer CARRIONSWARMID = 'A001'
private constant integer DummyID = 'u000'
private constant integer DUMMYAMOUNT = 8
private constant string SFX = "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl"
private constant string SFX2 = "Abilities\\Spells\\Undead\\ReplenishMana\\ReplenishManaCasterOverhead.mdl"
private constant real DISTANCEFROMCASTER = 25.00
endglobals
private function SFXCREATE takes nothing returns nothing
local Shape sd = Shape.getData()
call DestroyEffect(AddSpecialEffect(SFX,sd.x,sd.y))
call DestroyEffect(AddSpecialEffect(SFX2,sd.x,sd.y))
endfunction
private function onTest takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real a = GetUnitFacing(u)*bj_DEGTORAD
local Shape sd = 0
set sd = Shape.createIntersectedStarPolygon(x,y,a,5,500.,1,15,0.,function SFXCREATE)
endfunction
private function CrushWaveAct takes nothing returns nothing
local integer i = 0
local unit caster = GetTriggerUnit()
local real rad = GetUnitFacing(caster) * bj_DEGTORAD
local player playcast = GetTriggerPlayer()
local unit dummy
local real radIncrease = ((bj_PI)*2) / DUMMYAMOUNT
local real DummyX = GetUnitX(caster) + (DISTANCEFROMCASTER) * Cos(rad)
local real DummyY = GetUnitY(caster) + (DISTANCEFROMCASTER) * Sin(rad)
call onTest()
loop
exitwhen i == DUMMYAMOUNT * GetUnitAbilityLevel(caster,SpellID)
set dummy = CreateUnit(playcast, DummyID, DummyX, DummyY, (rad) * bj_RADTODEG)
call UnitAddAbility(dummy, CARRIONSWARMID)
call IssuePointOrder(dummy, "carrionswarm", GetUnitX(caster) + (DISTANCEFROMCASTER+100) * Cos(rad), GetUnitY(caster) + (DISTANCEFROMCASTER+100) * Sin(rad))
call UnitApplyTimedLife(dummy, 'BTLF', 2/GetUnitAbilityLevel(caster,SpellID))
set dummy = null
set rad = rad + radIncrease
set DummyX = GetUnitX(caster) + (DISTANCEFROMCASTER) * Cos(rad)
set DummyY = GetUnitY(caster) + (DISTANCEFROMCASTER) * Sin(rad)
set i = i+1
endloop
call PauseUnit( caster , false )
call IssueImmediateOrder( caster , "stop" )
set caster = null
endfunction
private function CrushWaveCond takes nothing returns boolean
return GetSpellAbilityId() == SpellID
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 12
loop
exitwhen i == 0
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set i = i-1
endloop
call TriggerAddCondition(t, Condition(function CrushWaveCond))
call TriggerAddAction(t, function CrushWaveAct)
endfunction
endscope
Everything should be as it should
//Chaos_Knight
