- Joined
- Jul 9, 2008
- Messages
- 253
Hey guys, I have a problem with my spell. I'm new to JASS so don't be to harsh. When I test the spell it gives a error that says "Invaled argument type (integer)" on a line. But when I delete that line then the error just goes to a other line.
Trigger:
Trigger:
JASS:
function ChillingWind_Condition takes nothing returns boolean
return GetSpellAbilityId() == 'A004'
endfunction
function ChillingWind_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local player p = GetOwningPlayer(caster)
local integer level = GetUnitAbilityLevel(caster, 'A004')
local location loc = GetSpellTargetLoc()
local location loc2
local integer level = GetUnitAbilityLevel(caster,'A01L')
local string SFXmodel = "Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl"
local real distance = 120.
local real duration = 1.
local real angle = 0.
local integer x = 0
local unit u
local group g
local effect SFX
local unit spawn
loop
exitwhen x > 6
set loc2 = PolarProjectionBJ(loc, distance, angle)
set SFX = AddSpecialEffectLoc(SFXmodel,loc)
call DestroyEffect(SFX)
set SFX = null
call RemoveLocation(loc2)
set loc2 = null
set angle = angle + 60
set x = x + 1
endloop
set g = GetUnitsInRangeOfLocAll(200, loc)
loop
set u = FirstOfGroup(g)
exitwhen u == null
if IsUnitEnemy(u, GetOwningPlayer(caster)) then
set spawn = CreateUnitAtLoc(p,'o009', GetUnitLoc(u),angle)
call SetUnitAbilityLevel(spawn, 'A029', level)
call IssueTargetOrder(spawn, 'A029', u)
call UnitApplyTimedLife(spawn, 'BTLF', duration)
set spawn = null
endif
call GroupRemoveUnit(g,u)
set u = null
endloop
call DestroyGroup(g)
set g = null
call RemoveLocation(loc)
set caster = null
set p = null
set loc = null
set SFXmodel = null
endfunction
function InitTrig_ChillingWind takes nothing returns nothing
set gg_trg_ChillingWind = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_ChillingWind, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_ChillingWind, Condition(function ChillingWind_Condition))
call TriggerAddAction(gg_trg_ChillingWind, function ChillingWind_Actions)
endfunction