Name | Type | is_array | initial_value |
AV_Hash | hashtable | No |
function AV_CONSTANTS takes nothing returns nothing
set udg_AV_Hash=InitHashtable()
//CHANGE THESE CONSTANTS TO SUIT YOUR NEEDS AND MATCH YOUR MAP'S RAWCODES... DEFAULT VALUES IN PARENTHESES
call SaveInteger(udg_AV_Hash,122,0,'A000')//Ability Rawcode. ('A000')
call SaveReal(udg_AV_Hash,122,1,25)//Base Damage. (25)
call SaveReal(udg_AV_Hash,122,2,25)//Damage Per Level, Added To Base Damage. (25)
call SaveReal(udg_AV_Hash,122,3,350)//Area Of Effect. (350)
call SaveInteger(udg_AV_Hash,122,4,2)//Base Spirals. (2)
call SaveInteger(udg_AV_Hash,122,5,1)//Spirals Per Level, Added To Base Spirals. (1)
call SaveBoolean(udg_AV_Hash,122,6,false)//Same Unit Affected By Same Spiral Multiple Times. (false)
call SaveGroupHandle(udg_AV_Hash,122,7,CreateGroup())//This Is The Global Group Of Spirals, You Shouldn't Change This. (CreateGroup())
call SaveInteger(udg_AV_Hash,122,8,'h000')//Dumy Unit Rawcode. ('h000')
call SaveReal(udg_AV_Hash,122,9,10.00)//Angle To Change Per Tick. (10.00)
call SaveReal(udg_AV_Hash,122,10,1.05)//Rate Of Decay Of Orbit. (1.15)
call SaveReal(udg_AV_Hash,122,11,75)//Sub Area Of Effect To Damage Units. (75)
call SaveStr(udg_AV_Hash,122,12,"Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl")//SFX Model. ("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl")
call SaveInteger(udg_AV_Hash,122,13,0)//Group Count, Any Value Works... (0)
call SaveStr(udg_AV_Hash,122,14,"Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl")//Damage SFX. ("Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl")
call SaveUnitHandle(udg_AV_Hash,122,15,null)//Current Picked Spiral. (null)
endfunction
function Trig_Arcane_Vortex_Conditions takes nothing returns boolean
return GetSpellAbilityId()==LoadInteger(udg_AV_Hash,122,0)
endfunction
function Trig_Arcane_Vortex_Actions takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local player p=GetOwningPlayer(u)
local location l=GetSpellTargetLoc()
local real X=GetLocationX(l)
local real Y=GetLocationY(l)
local integer Level=GetUnitAbilityLevel(u,LoadInteger(udg_AV_Hash,122,0))
local integer A=0
local real Angle
local integer Spirals=LoadInteger(udg_AV_Hash,122,4)+LoadInteger(udg_AV_Hash,122,5)*Level
local real Distance=LoadReal(udg_AV_Hash,122,3)
local integer ID
call RemoveLocation(l)
set l=null
set u=null
loop
exitwhen A>Spirals
set Angle=GetRandomReal(0,360)
set u=CreateUnit(p,LoadInteger(udg_AV_Hash,122,8),X+Distance*Cos(Angle*bj_DEGTORAD),Y+Distance*Sin(Angle*bj_DEGTORAD),0)
set ID=GetHandleId(u)
call GroupAddUnit(LoadGroupHandle(udg_AV_Hash,122,7),u)
call SaveReal(udg_AV_Hash,ID,0,LoadReal(udg_AV_Hash,122,1)+LoadReal(udg_AV_Hash,122,2)*Level)//Save Spiral Damage
call SaveReal(udg_AV_Hash,ID,1,X)//Save Center X.
call SaveReal(udg_AV_Hash,ID,2,Y)//Save Center Y.
call SaveReal(udg_AV_Hash,ID,3,Distance)//Save Current Distance.
call SaveReal(udg_AV_Hash,ID,4,Angle)//Save Angle.
call SaveGroupHandle(udg_AV_Hash,ID,5,CreateGroup())//Unit Check Group.
call EnableTrigger(gg_trg_Arcane_Vortex_Loop)
call TriggerSleepAction(0.01)
set A=A+1
endloop
set u=null
set p=null
endfunction
function InitTrig_Arcane_Vortex takes nothing returns nothing
local integer a=0
call AV_CONSTANTS()
set gg_trg_Arcane_Vortex=CreateTrigger()
loop
exitwhen a>15
call TriggerRegisterPlayerUnitEvent(gg_trg_Arcane_Vortex,Player(a),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
set a=a+1
endloop
call TriggerAddCondition(gg_trg_Arcane_Vortex,Condition(function Trig_Arcane_Vortex_Conditions))
call TriggerAddAction(gg_trg_Arcane_Vortex,function Trig_Arcane_Vortex_Actions)
endfunction
function Trig_Arcane_Vortex_Loop_Loop_Sub takes nothing returns nothing
local unit u=GetEnumUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local unit U=LoadUnitHandle(udg_AV_Hash,122,15)
local integer ID=GetHandleId(U)
local player p=GetOwningPlayer(U)
if IsUnitEnemy(u,p)and GetWidgetLife(u)>0.045then
if IsUnitInGroup(u,LoadGroupHandle(udg_AV_Hash,ID,5))==false or LoadBoolean(udg_AV_Hash,122,6)then
call GroupAddUnit(LoadGroupHandle(udg_AV_Hash,ID,5),u)
call DestroyEffect(AddSpecialEffect(LoadStr(udg_AV_Hash,122,14),x,y))
call UnitDamageTarget(U,u,LoadReal(udg_AV_Hash,ID,0),true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_SONIC,WEAPON_TYPE_WHOKNOWS)
endif
endif
set u=null
set p=null
set U=null
endfunction
function Trig_Arcane_Vortex_Loop_Loop takes nothing returns nothing
local unit u=GetEnumUnit()
local integer ID=GetHandleId(u)
local real MDist=LoadReal(udg_AV_Hash,122,3)
local real Dist=(MDist-LoadReal(udg_AV_Hash,ID,3))+10
local real Angle=LoadReal(udg_AV_Hash,ID,4)+LoadReal(udg_AV_Hash,122,9)
local real X
local real Y
local group g=CreateGroup()
call SaveUnitHandle(udg_AV_Hash,122,15,u)
set Dist=Dist*LoadReal(udg_AV_Hash,122,10)
if Dist>MDist then
set Dist=MDist
endif
if Angle>360then
set Angle=Angle-360
endif
if Angle<0then
set Angle=Angle+360
endif
call SetUnitX(u,LoadReal(udg_AV_Hash,ID,1)+(MDist-Dist)*Cos(Angle*bj_DEGTORAD))
call SetUnitY(u,LoadReal(udg_AV_Hash,ID,2)+(MDist-Dist)*Sin(Angle*bj_DEGTORAD))
set X=GetUnitX(u)
set Y=GetUnitY(u)
call SaveReal(udg_AV_Hash,ID,3,MDist-Dist)
call SaveReal(udg_AV_Hash,ID,4,Angle)
call DestroyEffect(AddSpecialEffect(LoadStr(udg_AV_Hash,122,12),X,Y))
call GroupEnumUnitsInRange(g,X,Y,LoadReal(udg_AV_Hash,122,11),null)
call ForGroup(g,function Trig_Arcane_Vortex_Loop_Loop_Sub)
call DestroyGroup(g)
set g=null
if Dist>=LoadReal(udg_AV_Hash,122,3)then
call DestroyGroup(LoadGroupHandle(udg_AV_Hash,ID,5))
call SaveGroupHandle(udg_AV_Hash,ID,5,null)
call FlushChildHashtable(udg_AV_Hash,ID)
call RemoveUnit(u)
endif
set u=null
call SaveUnitHandle(udg_AV_Hash,ID,15,null)
call SaveInteger(udg_AV_Hash,122,13,LoadInteger(udg_AV_Hash,122,13)+1)
endfunction
function Trig_Arcane_Vortex_Loop_Actions takes nothing returns nothing
call SaveInteger(udg_AV_Hash,122,13,0)
call ForGroup(LoadGroupHandle(udg_AV_Hash,122,7),function Trig_Arcane_Vortex_Loop_Loop)
if LoadInteger(udg_AV_Hash,122,13)<=0 then
call DisableTrigger(gg_trg_Arcane_Vortex_Loop)
endif
endfunction
function InitTrig_Arcane_Vortex_Loop takes nothing returns nothing
set gg_trg_Arcane_Vortex_Loop=CreateTrigger()
call DisableTrigger(gg_trg_Arcane_Vortex_Loop)
call TriggerRegisterTimerEvent(gg_trg_Arcane_Vortex_Loop,0.05,true)
call TriggerAddAction(gg_trg_Arcane_Vortex_Loop,function Trig_Arcane_Vortex_Loop_Actions)
endfunction
function Trig_Visibility_Actions takes nothing returns nothing
call FogEnable(false)
call FogMaskEnable(false)
endfunction
function InitTrig_Visibility takes nothing returns nothing
set gg_trg_Visibility=CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_Visibility,0,false)
call TriggerAddAction(gg_trg_Visibility,function Trig_Visibility_Actions)
endfunction
function Trig_Hero_Revival_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
call ReviveHero(u,x,y,true)
if GetLocalPlayer()==Player(0)then
call ClearSelection()
call SelectUnit(u,true)
call PanCameraTo(x,y)
endif
set u=null
endfunction
function InitTrig_Hero_Revival takes nothing returns nothing
set gg_trg_Hero_Revival=CreateTrigger()
call TriggerRegisterUnitEvent(gg_trg_Hero_Revival,gg_unit_Hamg_0000,EVENT_UNIT_DEATH)
call TriggerAddAction(gg_trg_Hero_Revival,function Trig_Hero_Revival_Actions)
endfunction
function Trig_Unit_Revival_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer id=GetUnitTypeId(u)
local real a=GetUnitFacing(u)
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local player p=GetOwningPlayer(u)
set u=null
call TriggerSleepAction(10)
call CreateUnit(p,id,x,y,a)
set p=null
endfunction
function InitTrig_Unit_Revival takes nothing returns nothing
set gg_trg_Unit_Revival=CreateTrigger()
call TriggerRegisterPlayerUnitEvent(gg_trg_Unit_Revival,Player(1),EVENT_PLAYER_UNIT_DEATH,null)
call TriggerAddAction(gg_trg_Unit_Revival,function Trig_Unit_Revival_Actions)
endfunction