• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

A channel spell question

Status
Not open for further replies.
Level 15
Joined
Nov 26, 2005
Messages
1,151
Ok, so the spell I want to create is similar to the crystal field of the Crystal Maiden in dota.
Basically my hero channels and while doing that random units(dummies) spawn around him and cast thier spells.
The problem is I want to make it MPI, so I need to put everything in one trigger only.

What would the trigger use ?
Event: Unit starst channeling
Cond: Spell = Myspell
Action: (??)

I want to start spawning the dummies which will cast their spell and have a timer attached. And that's it. (Oh and does the trigger stop if the channel is interrupted by stun etc. ?)
 
Level 9
Joined
Dec 12, 2007
Messages
489
in GUI? for MPI you should use some indexing system which can be found around here...

for the interrupt part, you can check the order of the caster, if its equal with the order of the base ability of your spell then make the explosion, otherwise stop the timer etc..

can't help too much, sorry...
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
You want something like this?
JASS:
function Freezing_Field_Spell takes nothing returns boolean
	return GetSpellAbilityId()=='A03R'or GetSpellAbilityId()=='A0AV'
endfunction

function Freezing_Field_Timer takes nothing returns nothing
	local trigger ltt=GetTriggeringTrigger()
	local string lf5=H2Tx(ltt)
	local unit lfo
	local unit lJV
	local integer lmZ
	if(GetTriggerEventId()==EVENT_UNIT_SPELL_ENDCAST)then
		if(GetSpellAbilityId()=='A03R'or GetSpellAbilityId()=='A0AV')then
			call DisableTrigger(ltt)
			call PolledWait(1)
			call TriggerRemoveAction(ltt,GetTrigAction(lf5,"TriggerAction"))
			call FastFlush(lf5)
			call DestroyTriggerEx(ltt)
		endif
	else
		set lmZ=GetInteger(lf5,"Level")
		set lfo=GetUnit(lf5,"UnitVar")
		set lJV=CreateUnit(GetOwningPlayer(lfo),'e00C',GetUnitX(lfo)+GetRandomReal('}',635)*Cos(GetRandomReal(0,360)*bj_DEGTORAD),GetUnitY(lfo)+GetRandomReal('}',635)*Sin(GetRandomReal(0,360)*bj_DEGTORAD),270)
		call UnitAddAbility(lJV,'A03X')
		call SetUnitAbilityLevel(lJV,'A03X',lmZ)
		call SetUnitPathing(lJV,false)
		call IssueTargetOrderById(lJV,OrderId("frostnova"),lJV)
		call UnitApplyTimedLife(lJV,'BTLF',.25)
	endif
endfunction

function Freezing_Field_Main takes nothing returns nothing
	local unit lfo=GetTriggerUnit()
	local trigger ltt=CreateTrigger()
	local string lf5=H2Tx(ltt)
	local integer lmZ
	if(GetSpellAbilityId()=='A03R')then
		set lmZ=GetUnitAbilityLevel(lfo,'A03R')
	else
		set lmZ=GetUnitAbilityLevel(lfo,'A0AV')+1
	endif
	call TriggerRegisterTimerEvent(ltt,.1,true)
	call TriggerRegisterUnitEvent(ltt,lfo,EVENT_UNIT_SPELL_ENDCAST)
	call SetHandle(lf5,"TriggerAction",TriggerAddAction(ltt,function Freezing_Field_Timer))
	call SetHandle(lf5,"UnitVar",lfo)
	call SetInteger(lf5,"Level",lmZ)
endfunction

function Freezing_Field_Init takes nothing returns nothing
	local trigger ltt=CreateTrigger()
	call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_SPELL_EFFECT)
	call TriggerAddCondition(ltt,Condition(function Freezing_Field_Spell))
	call TriggerAddAction(ltt,function Freezing_Field_Main)
	call SpellPreload('A03X')
endfunction


function InitTrig_Freezing_Field takes nothing returns nothing
endfunction
 
Status
Not open for further replies.
Top