- Joined
- Oct 17, 2008
- Messages
- 11
ignore bumps, i was using that to test how far my spell got, iv goten it all the way but it compleatly lags the hell out of my computer so im not sure if thats because of the amount of times it goes threw the function also im not sure if my gethandleunits/sethandlehandles are working properly because im stiff iffy on if i set up the game cache corectly
suggestions please
suggestions please
JASS:
function Wraiths_burn takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = GetHandleUnit(t, "wraithcaster")
local group wards = GetHandleGroup(t, "dwards")
local unit ward
local effect spelleff
call DisplayTextToPlayer(Player(0),0,0,"Bump1")
set spelleff = AddSpecialEffect("Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl",GetUnitX(caster),GetUnitY(caster))
call DisplayTextToPlayer(Player(0),0,0,"Bump2")
call DestroyEffect(spelleff)
call DisplayTextToPlayer(Player(0),0,0,"Bump3")
call UnitDamagePoint(caster,1.3,200,GetUnitX(caster),GetUnitY(caster),50,true, false, (ATTACK_TYPE_MAGIC), (DAMAGE_TYPE_FIRE),null)
call DisplayTextToPlayer(Player(0),0,0,"Bump4")
loop
set ward = FirstOfGroup(wards)
exitwhen wards == null
call DisplayTextToPlayer(Player(0),0,0,"Bump5")
set spelleff = AddSpecialEffect("Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl",GetUnitX(ward),GetUnitY(ward))
call DisplayTextToPlayer(Player(0),0,0,"Bump6")
call DestroyEffect(spelleff)
call DisplayTextToPlayer(Player(0),0,0,"Bump7")
call UnitDamagePoint(caster,1.3,200,GetUnitX(ward),GetUnitY(ward),50,true, false, (ATTACK_TYPE_MAGIC), (DAMAGE_TYPE_FIRE),null)
call DisplayTextToPlayer(Player(0),0,0,"Bump8")
call GroupRemoveUnit(wards,ward)
endloop
endfunction
//=============================//
function WardCheck takes nothing returns boolean
local unit ward = GetFilterUnit()
return GetUnitTypeId(ward) == 'o001'
endfunction
//=============================//
function Execute_Wraiths_Burn takes nothing returns nothing
local unit wraithcaster = GetTriggerUnit()
local ability Wraith_Burn
local group dwards
local timer t = CreateTimer()
local real i
local integer spell_level
local filterfunc WardC = Filter(function WardCheck)
set dwards = GetUnitsInRangeOfLocMatching(1000,GetUnitLoc(wraithcaster), WardC)
if ( GetSpellAbilityId()=='A013') then
call DisplayTextToPlayer(GetOwningPlayer(wraithcaster),0,0,"Bump1")
set spell_level = GetUnitAbilityLevel(wraithcaster,'A013')
call DisplayTextToPlayer(GetOwningPlayer(wraithcaster),0,0,"Bump2")
if( spell_level == 1 ) then
call DisplayTextToPlayer(GetOwningPlayer(wraithcaster),0,0,"Bump3")
call SetHandleHandle(t, "wraithcaster", wraithcaster)
call SetHandleHandle(t, "dwards", dwards)
set i = 1.6
call TimerStart(t,i,true, function Wraiths_burn)
elseif( spell_level == 2 ) then
call DisplayTextToPlayer(GetOwningPlayer(wraithcaster),0,0,"Bump4")
call SetHandleHandle(t, "wraithcaster", wraithcaster)
call SetHandleHandle(t, "dwards", dwards)
set i = 1.3
call TimerStart(t,i,true, function Wraiths_burn)
elseif( spell_level == 3 ) then
call DisplayTextToPlayer(GetOwningPlayer(wraithcaster),0,0,"Bump5")
call SetHandleHandle(t, "wraithcaster", wraithcaster)
call SetHandleHandle(t, "dwards", dwards)
call DisplayTextToPlayer(GetOwningPlayer(wraithcaster),0,0,"Bump6")
set i = 1
call TimerStart(t,i,true, function Wraiths_burn)
call DisplayTextToPlayer(GetOwningPlayer(wraithcaster),0,0,"Bump7")
endif
endif
call TriggerSleepAction(8+spell_level*2)
call FlushHandleLocals(t)
call DestroyTimer(t)
endfunction
//===========================================================================
function InitTrig_Wraiths_Burn takes nothing returns nothing
set gg_trg_Wraiths_Burn = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Wraiths_Burn, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Wraiths_Burn, function Execute_Wraiths_Burn )
endfunction