• 🏆 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!

Help destroying lightning effects

Status
Not open for further replies.
Level 7
Joined
Oct 8, 2005
Messages
298
Allright so im working on a new ability wherein it creates a siphon mana lightning effect between the hero and all nearby enemy land units that have mana. i created the effects just fine using a unit group trigger but im having one big problem: how do i destroy them? I cant set them to an integer because theres no definite number and i tried using Last created lightning effect but that didnt work either. anyways i was wondering if theres any way in jass or something like that to detect all the lightning effects in a region. Thanks for any help! :D
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
allright...i hope u understand JASS


JASS:
function Condition takes nothing returns boolean

//your condition here

endfunction

function TheUnitGroup takes unit u returns nothing

local location l = GetUnitLoc( u )

local location l2 = GetUnitLoc( udg_caster )

local lightning li

call AddLightningLoc( from l to 12 using "mdl" ) ill let u write that

set li = GetLastCreatedLightning()

// put a wait until the unit stops casting the ability or whatever stops it

call DestroyLightning( l )

endfunction

function TheOrigUnitGroup takes nothing returns nothing

call ExecuteFunc( "TheUnitGroup" ) // also give it the Picked Unit, the code is GetEnumUnit()

endfunction

function action takes nothing returns nothing

//functions

call ForGroup( group g, function TheOrigUnitGroup )

//more functions

endfunction

function InitTrig_MyTrig takes nothing returns nothing

//do stuff here

endfunction

i hope this is what youu wanted
 
Status
Not open for further replies.
Top