• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Need help with spell/JASS, specifically Vex caster system

Status
Not open for further replies.
Level 2
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
 
Level 7
Joined
May 6, 2005
Messages
390
Questions about the caster system should be posted at the forum Vexorian has for his systems. Read the read me of the system to find that forum.
 
Status
Not open for further replies.
Top