waaaks!
Zinctified
- Reaction score
- 255
JASS:
globals
constant integer DemonSpellId = 039;A000039; //Demon's Sanctum Spell Id
constant integer FirstSpellId = 039;A001039; //First Santuary Spell Id
constant integer SecondSpellId = 039;A002039; //Second Sanctuary Spell Id
constant integer DummySanctuary = 039;u000039; //Dummy Sanctuary Spell Id
constant string DemonSpellOrder = "starfall" //Demon's Sanctum Order Id
constant real FirstRange = 300.0 //How far the First Sanctuary is created
constant real SecondRange = 600.0 //How far the Second Sanctuary is created
endglobals
struct Ddata
unit caster
location loc
location pol1
location pol2
integer level
unit first
unit second
integer n
endstruct
function Trig_DemonSanctum_Conditions takes nothing returns boolean
return GetSpellAbilityId() == DemonSpellId
endfunction
function Trig_DemonSanctum_Actions takes nothing returns nothing
local Ddata d = Ddata.create()
set d.caster = GetTriggerUnit()
set d.loc = GetUnitLoc(d.caster)
set d.level = GetUnitAbilityLevel(d.caster, DemonSpellId)
loop
exitwhen d.n > 36
set d.pol1 = PolarProjectionBJ(d.loc, FirstRange, 10*d.n)
set d.pol2 = PolarProjectionBJ(d.loc, SecondRange, 10*d.n)
set d.first = CreateUnitAtLoc(GetOwningPlayer(d.caster), DummySanctuary, d.pol1, 10*d.n)
set d.second = CreateUnitAtLoc(GetOwningPlayer(d.caster), DummySanctuary, d.pol2, 10*d.n)
call UnitApplyTimedLife(d.first, 039;BTLF039;, 8 + (2*d.level))
call UnitApplyTimedLife(d.second, 039;BTLF039;, 8 + (2*d.level))
call UnitAddAbility(d.first, FirstSpellId)
call UnitAddAbility(d.second, SecondSpellId)
call SetUnitAbilityLevel(d.first, FirstSpellId, d.level)
call SetUnitAbilityLevel(d.second, SecondSpellId, d.level)
set d.n = d.n + 1
endloop
call d.destroy()
endfunction
//===========================================================================
function InitTrig_DemonSanctum takes nothing returns nothing
set gg_trg_DemonSanctum = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_DemonSanctum, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_DemonSanctum, Condition( function Trig_DemonSanctum_Conditions ) )
call TriggerAddAction( gg_trg_DemonSanctum, function Trig_DemonSanctum_Actions )
endfunction
this is the spell ive made before...and it works fine, for the first cast...but for the second cast...it wont work...
any ideas?