- Joined
- Jan 24, 2009
- Messages
- 606
JASS:
scope HolyExpl initializer Init
//-----------------Setup Start--------------------------
globals
private constant integer SPELL_ID = 'A000'
endglobals
private function Damage takes integer level returns real
return level * 50.
endfunction
private function heal takes integer level returns real
return level * 25.
endfunction
private function Loopdam takes integer level returns real
return level * 35.
endfunction
//-----------------Setup End----------------------------
globals
private boolexpr b
endglobals
private function c takes nothing returns boolean
return GetSpellAbilityId() == SPELL_ID
endfunction
private function Pick takes nothing returns boolean
return Target(GetFilterUnit())
private function a takes nothing returns nothing
local unit caster = GetTriggerUnit()
local integer loopsec = 0
local integer level = GetUnitAbilityLevel(caster, SPELL_ID)
local location one = GetUnitLoc(caster)
local location two = GetRandomLocInRect(RectFromCenterSizeBJ(one, 500.,500.))
local location effectLoc = OffsetLocation(two,-50.00, 50.00)
local location effectLoc2 = OffsetLocation(two,50.00,-50.00)
local location effectLoc3 = OffsetLocation(two,50.00,50.00)
local location effectLoc4 = OffsetLocation(two,-50.00,-50.00)
local location three
local unit target
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", two))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", effectLoc))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", effectLoc2))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", effectLoc3))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", effectLoc4))
call GroupEnumUnitsInRangeOfLoc(groups, two, 200., b)
set target = FirstOfGroup(groups)
if IsUnitEnemy(target, GetOwningPlayer(caster)) then
call UnitDamageTarget( caster, target, Damage(level), true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL)
endif
loop
set three = GetRandomLocInRect(RectFromCenterSizeBJ(one, 500., 500.))
exitwhen loopsec == 10
call PolledWait(0.15)
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl",three))
set loopsec = loopsec + 1
call RemoveLocation(three)
endloop
set loopsec = 0
call RemoveLocation(two)
call RemoveLocation(one)
call RemoveLocation(effectLoc)
call RemoveLocation(effectLoc2)
call RemoveLocation(effectLoc3)
call RemoveLocation(effectLoc4)
endfunction
private function Init takes nothing returns nothing
local trigger Holy = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Holy, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(Holy, function a)
call TriggerAddCondition(Holy, Condition(function c))
set b = Condition(function Pick)
endfunction
endscope
I get an error when trying to save this... The Takes nothing seems to be unexpected or something.... Anyone knows why this is happening?
(ohh.. and if you find a way to make the special effects with just 2 or 1 variable please tell me...)