- Joined
- Jul 13, 2005
- Messages
- 21
Alright this is the first spell I am trying to make using Jass and Vex's Caster System, bu tof course it is not functioning so I am wondering what I am missing. Also my most specific question is implementation of the ProjectileLaunchKill and how that can be used to trigger unit death. This is the script. thanks
constant function WebBomb_SpellId takes nothing returns integer
return 'A026' // Binding Web's ability rawcode
endfunction
constant function WebBomb_EffectID takes nothing returns integer
return 'A01M' // The ability ID of the actual web ability.
endfunction
constant function WebBomb_AOE takes real level returns real
return 300+100*level // Maximum range at which the effect will hit
endfunction
function Effect_MagicImmune takes unit target returns boolean
if IsUnitType( target, UNIT_TYPE_SPELL_IMMUNE ) then
return false
endif
return true
endfunction
//-------------------------------------------------------------------------------------------------------------
function WebBomb_Activate takes nothing returns nothing
local unit cast = GetTriggerUnit()
local player p = GetOwningPlayer( cast )
local real cx = GetUnitX( cast )
local real cy = GetUnitY( cast )
local real cz = GetUnitFlyHeight( GetTriggerUnit() )
local real tx = GetLocationX( GetSpellTargetLoc() )
local real ty = GetLocationY( GetSpellTargetLoc() )
local group g = CreateGroup()
local unit t
local real L = I2R( GetUnitAbilityLevel( cast, WebBomb_SpellId() ) )
call ProjectileLaunchEx( p, "Abilities\\Spells\\Undead\\Web\\Webmissile.mdl", 1.3, 522, 522, 522, 522, 522, .22, cx, cy, cz, tx, ty, 250 )
call GroupEnumUnitsInRange( g, tx, ty, WebBomb_AOE(L), null )
loop
set t = FirstOfGroup( g )
exitwhen t == null
call GroupRemoveUnit( g, t )
if Effect_MagicImmune( t ) and IsUnitEnemy( t, p ) then
call ProjectileLaunchToUnit( "Abilities\\Weapons\\CryptFiendMissile\\CryptFiendMissile.mdl", 522, 0, tx, ty, 150, t, 150 )
call CasterCastAbilityLevel( GetOwningPlayer( cast ), WebBomb_EffectId(), R2I( L ), "web", t , false )
endif
endloop
endfunction
function WebBomb_Conditions takes nothing returns boolean
return GetSpellAbilityId()==WebBomb_SpellId()
endfunction
//-------------------------------------------------------------------------------------------------------------
function InitTrig_WebBomb takes nothing returns nothing
set gg_trg_WebBomb = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( gg_trg_WebBomb, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_WebBomb , Condition( function WebBomb_Conditions ) )
call TriggerAddAction(gg_trg_WebBomb , function WebBomb_Activate)
endfunction
constant function WebBomb_SpellId takes nothing returns integer
return 'A026' // Binding Web's ability rawcode
endfunction
constant function WebBomb_EffectID takes nothing returns integer
return 'A01M' // The ability ID of the actual web ability.
endfunction
constant function WebBomb_AOE takes real level returns real
return 300+100*level // Maximum range at which the effect will hit
endfunction
function Effect_MagicImmune takes unit target returns boolean
if IsUnitType( target, UNIT_TYPE_SPELL_IMMUNE ) then
return false
endif
return true
endfunction
//-------------------------------------------------------------------------------------------------------------
function WebBomb_Activate takes nothing returns nothing
local unit cast = GetTriggerUnit()
local player p = GetOwningPlayer( cast )
local real cx = GetUnitX( cast )
local real cy = GetUnitY( cast )
local real cz = GetUnitFlyHeight( GetTriggerUnit() )
local real tx = GetLocationX( GetSpellTargetLoc() )
local real ty = GetLocationY( GetSpellTargetLoc() )
local group g = CreateGroup()
local unit t
local real L = I2R( GetUnitAbilityLevel( cast, WebBomb_SpellId() ) )
call ProjectileLaunchEx( p, "Abilities\\Spells\\Undead\\Web\\Webmissile.mdl", 1.3, 522, 522, 522, 522, 522, .22, cx, cy, cz, tx, ty, 250 )
call GroupEnumUnitsInRange( g, tx, ty, WebBomb_AOE(L), null )
loop
set t = FirstOfGroup( g )
exitwhen t == null
call GroupRemoveUnit( g, t )
if Effect_MagicImmune( t ) and IsUnitEnemy( t, p ) then
call ProjectileLaunchToUnit( "Abilities\\Weapons\\CryptFiendMissile\\CryptFiendMissile.mdl", 522, 0, tx, ty, 150, t, 150 )
call CasterCastAbilityLevel( GetOwningPlayer( cast ), WebBomb_EffectId(), R2I( L ), "web", t , false )
endif
endloop
endfunction
function WebBomb_Conditions takes nothing returns boolean
return GetSpellAbilityId()==WebBomb_SpellId()
endfunction
//-------------------------------------------------------------------------------------------------------------
function InitTrig_WebBomb takes nothing returns nothing
set gg_trg_WebBomb = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( gg_trg_WebBomb, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_WebBomb , Condition( function WebBomb_Conditions ) )
call TriggerAddAction(gg_trg_WebBomb , function WebBomb_Activate)
endfunction