- Joined
- Jul 9, 2008
- Messages
- 253
Hello everybody, so I got another problem with a spell. It allows me to turn on the trigger, but when I save it a error pops; saying that line "constant function Dummy_ID takes nothing returns integer" is wrong.
Trigger:
Any help would be appreciated, if it's the solution to the error or just a way to improve the trigger.
Thanks in advance, Quetzalcotl
Trigger:
JASS:
// Spell ID //
constant function Prismatic_ID takes nothing returns integer
return 'A00F'
endfunction
// Constant Damage //
constant function Prismatic_Constant_Damage takes nothing returns real
return 100.
endfunction
// Level Damage //
constant function Prismatic_Level_Damage takes nothing returns real
return 60.
endfunction
// Summoned Model //
constant function Summoned_Model takes nothing returns string
return "Abilities\\Spells\\NightElf\\TrueshotAura\\TrueshotAura.mdl"
endfunction
// Summoned Model Size //
constant function Summoned_Size takes nothing returns real
return 1.3
endfunction
// Damaging Model //
constant function Damaging_Model takes nothing returns string
return "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl"
endfunction
// Damaging Model Size //
constant function Damaging_Size takes nothing returns real
return 1.6
endfunction
// Dummy ID //
constant function Dummy_ID takes nothing returns integer
return 'h004'
endfunction
// Delay //
constant function Delay takes nothing returns real
return 2.
endfunction
// Area of Effect //
constant function Prismatic_Area takes nothing returns real
return 250.
endfunction
// Filter //
function EnemyFilter takes nothing returns boolean
return IsUnitType( GetFilterUnit() , UNIT_TYPE_MAGIC_IMMUNE ) == false and IsPlayerEnemy( GetOwningPlayer( GetFilterUnit() ) , GetOwningPlayer( GetTriggerUnit() ) ) == true
endfunction
function Trig_Prismatic_Impact_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local integer level = GetUnitAbilityLevelSwapped( Prismatic_ID() , caster )
local player p = GetOwningPlayer( caster )
local real facing = GetUnitFacing( caster )
local location loc = GetSpellTargetLoc()
local real x = GetLocationX( loc )
local real y = GetLocationY( loc )
local group g = CreateGroup()
local unit u
local unit dummy1
local unit dummy2
local effect model1
local effect model2
//
set dummy1 = CreateUnit( p , Dummy_ID() , x , y , facing )
call SetUnitPathing( dummy1 , false )
call SetUnitX( dummy1 , x )
call SetUnitY( dummy1 , y )
call SetUnitScale( dummy1 , Summoned_Size() , Summoned_Size() , Summoned_Size() )
call UnitApplyTimedLife( dummy1 , 'BTLF' , Delay() )
set model1 = AddSpecialEffectTarget( Summoned_Model() , dummy1 , "origin" )
//
call PolledWait( Delay() )
//
call GroupEnumUnitsInRange( g , x , y , Prismatic_Area() , Filter( function EnemyFilter ) )
loop
set u = FirstOfGroup(g)
exitwhen u == null
if GetUnitState( u , UNIT_STATE_LIFE ) > 0 then
call UnitDamageTarget( caster , u , ( Prismatic_Constant_Damage() + ( Prismatic_Level_Damage() * I2R( level ) ) ) , true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNKNOWN, WEAPON_TYPE_WHOKNOWS)
endif
call GroupRemoveUnit( g , u )
set u = null
endloop
//
set dummy2 = CreateUnit( p , Dummy_ID() , x , y , facing )
call SetUnitPathing( dummy2 , false )
call SetUnitX( dummy2 , x )
call SetUnitY( dummy2 , y )
call SetUnitScale( dummy2 , Damaging_Size() , Damaging_Size() , Damaging_Size() )
call UnitApplyTimedLife( dummy2 , 'BTLF' , Delay() )
set model2 = AddSpecialEffectTarget( Damaging_Model() , dummy2 , "origin" )
//
call RemoveLocation( loc )
call DestroyGroup( g )
set loc = null
set p = null
set dummy1 = null
set dummy2 = null
set g = null
set model1 = null
set model2 = null
endfunction
// Spell Condition //
function Trig_Prismatic_Impact_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Prismatic_ID()
endfunction
//===========================================================================
function InitTrig_Prismatic_Impact takes nothing returns nothing
local trigger t = CreateTrigger( )
local integer i = 0
loop
exitwhen i == 16
call TriggerRegisterPlayerUnitEvent( t, Player( i ) , EVENT_PLAYER_UNIT_SPELL_EFFECT , null )
set i = i + 1
endloop
call TriggerAddCondition( t , Condition( function Trig_Prismatic_Impact_Conditions ) )
call TriggerAddAction( t , function Trig_Prismatic_Impact_Actions )
set t = null
endfunction
Any help would be appreciated, if it's the solution to the error or just a way to improve the trigger.
Thanks in advance, Quetzalcotl