Name | Type | is_array | initial_value |
cache | gamecache | No | |
creep1 | unitcode | Yes | |
creep2 | unitcode | Yes | |
income | integer | Yes | 25 |
incometimer | timer | No | |
mode | integer | No | 0 |
modedialog | dialog | No | |
modedialogbutton | button | Yes | |
teamdefeated | boolean | Yes | |
wavelevel | integer | Yes | |
waveleveltype | unitcode | Yes | |
wavetimer | timer | Yes |
//Boomerang by OrkOfMordor aka Hanky aka MDZ-OrkOfMordor
//Constants
scope Boomerang
globals
private constant integer SpellId='A000'
private constant integer DummyId='e000'
private constant string MissileEffectMdl="Abilities\\Weapons\\ShadowHunterMissile\\ShadowHunterMissile.mdl"
private constant string DamageEffectMdl="Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
private constant string DamageAttachPoint="chest"
private constant string MissileAttachPoint="chest"
private constant real MissileSpeed=15.00
private constant real PeriodicEvent=0.03
private constant real Range=90.00
private constant string Code="Bo_Group"
private constant string RFunction="Bo_React"
endglobals
private constant function Bo_Damage takes integer lvl returns integer
return (30*lvl)+30 //damage the victim units gets
endfunction
private constant function Bo_TurnSpeed takes real ctmp returns real
return (1.1*ctmp)+2 //Turn Speed of the missiles
endfunction
//Conditions
private function Trig_Boomerang_Conditions takes nothing returns boolean
return GetSpellAbilityId() == SpellId
endfunction
//Actions
private function Bo_EnumDamage takes nothing returns nothing
local unit c =I2U(GetStoredInteger(GC(),Code,"c"))
local unit a =GetEnumUnit()
local unit u =I2U(GetStoredInteger(GC(),Code,"u"))
local group g =I2G(GetStoredInteger(GC(),Code,"g"))
if IsUnitNotImmun(u,a) and not IsUnitInGroup(a,g) then
call GroupAddUnit(g,a)
call UnitDamageTarget(c,a,I2R(Bo_Damage(GetUnitAbilityLevel(c,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget(DamageEffectMdl,a,DamageAttachPoint))
endif
set c=null
set a=null
set u=null
set g=null
endfunction
function Bo_React takes nothing returns nothing
call StoreBoolean(GC(),HS(tc),"back",true)
endfunction
private struct BoomerangDatas
real dx
real dy
real distance
real angle
unit caster
real ctmp
real dtmp
unit missile1
unit missile2
group rdyg1
group rdyg2
effect gfx1
effect gfx2
endstruct
private function BoomerangMotion takes nothing returns nothing
local timer t =GetExpiredTimer()
local BoomerangDatas datas=GetStoredInteger(GC(),HS(t),"datas")
local real x =0
local real y =0
local group g
local boolean back =GetStoredBoolean(GC(),HS(datas.caster),"back")
set g=GetUnitsInRange(Range,GetUnitX(datas.missile1),GetUnitY(datas.missile1),null,true)
call StoreInteger(GC(),Code,"c",H2I(datas.caster))
call StoreInteger(GC(),Code,"u",H2I(datas.missile1))
call StoreInteger(GC(),Code,"g",H2I(datas.rdyg1))
call ForGroup(g,function Bo_EnumDamage)
call AB_DestroyGroup(g)
call FlushStoredMission(GC(),Code)
set g=GetUnitsInRange(Range,GetUnitX(datas.missile2),GetUnitY(datas.missile2),null,true)
call StoreInteger(GC(),Code,"c",H2I(datas.caster))
call StoreInteger(GC(),Code,"u",H2I(datas.missile2))
call StoreInteger(GC(),Code,"g",H2I(datas.rdyg2))
call ForGroup(g,function Bo_EnumDamage)
call AB_DestroyGroup(g)
call FlushStoredMission(GC(),Code)
if datas.dtmp<=datas.distance and datas.ctmp<=180 then
call VUnitPolarXY(datas.missile1,MissileSpeed,datas.angle+25)
call VUnitPolarXY(datas.missile2,MissileSpeed,datas.angle-25)
set datas.dtmp=datas.dtmp+MissileSpeed
elseif datas.ctmp<=180 then
set datas.ctmp=Bo_TurnSpeed(datas.ctmp)
call VUnitPolarXY(datas.missile1,MissileSpeed,datas.angle-datas.ctmp)
call VUnitPolarXY(datas.missile2,MissileSpeed,datas.angle+datas.ctmp)
elseif datas.ctmp>180 and datas.dtmp>datas.distance then
call LaunchNormalChaseMissileAtPointEx(datas.caster,datas.missile1,GetUnitX(datas.missile1),GetUnitY(datas.missile1),0,datas.caster,MissileSpeed,RFunction)
call LaunchNormalChaseMissileAtPointEx(datas.caster,datas.missile2,GetUnitX(datas.missile2),GetUnitY(datas.missile2),0,datas.caster,MissileSpeed,RFunction)
set datas.dtmp=0
endif
if not back then
call TimerStart(t,PeriodicEvent,false,function BoomerangMotion)
elseif back then
call DestroyEffect(datas.gfx1)
call DestroyEffect(datas.gfx2)
call AB_DestroyGroup(datas.rdyg1)
call AB_DestroyGroup(datas.rdyg2)
call RemoveUnit(datas.missile1)
call RemoveUnit(datas.missile2)
call FlushStoredMission(GC(),HS(datas.caster))
call FlushStoredMission(GC(),HS(t))
call BoomerangDatas.destroy(datas)
call AB_DestroyTimer(t)
endif
endfunction
private function Trig_Boomerang_Actions takes nothing returns nothing
local location loc =GetSpellTargetLoc()
local timer t =CreateTimer()
local BoomerangDatas datas=BoomerangDatas.create()
local unit u =GetTriggerUnit()
local real x =GetUnitX(u)
local real y =GetUnitY(u)
local real angle =A2PXY(x,y,GetLocationX(loc),GetLocationY(loc))
local real distance =D2PXY(x,y,GetLocationX(loc),GetLocationY(loc))
local real dx
local real dy
local unit missile1 =CreateUnit(GetOwningPlayer(u),DummyId,x,y,angle+15)
local unit missile2 =CreateUnit(GetOwningPlayer(u),DummyId,x,y,angle-15)
local effect gfx1 =AddSpecialEffectTarget(MissileEffectMdl,missile1,MissileAttachPoint)
local effect gfx2 =AddSpecialEffectTarget(MissileEffectMdl,missile2,MissileAttachPoint)
set distance=(distance*75)/100
set dx=x+distance*Cos(angle*3.14159/180)
set dy=y+distance*Sin(angle*3.14159/180)
call TimerStart(t,0,false,function BoomerangMotion)
set datas.dx=dx
set datas.dy=dy
set datas.distance=distance
set datas.angle=angle
set datas.caster=u
set datas.missile1=missile1
set datas.missile2=missile2
set datas.rdyg1=CreateGroup()
set datas.rdyg2=CreateGroup()
set datas.gfx1=gfx1
set datas.gfx2=gfx2
set datas.ctmp=0
set datas.dtmp=0
call StoreInteger(GC(),HS(t),"datas",datas)
call RemoveLocation(loc)
set t=null
endfunction
//===========================================================================
function InitTrig_Boomerang takes nothing returns nothing
set gg_trg_Boomerang = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Boomerang, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Boomerang, Condition( function Trig_Boomerang_Conditions ) )
call TriggerAddAction( gg_trg_Boomerang, function Trig_Boomerang_Actions )
endfunction
endscope
//Crush by OrkOfMordor aka Hanky aka MDZ-OrkOfMordor
//Constants
scope Crush
globals
private constant integer SpellId='A001'
private constant integer BuffAddId='A002'
private constant string BuffOrder="berserk"
private constant real MotionSpeed=10.00
private constant real PeriodicTime=0.03
private constant real MaxPushTime=0.50
private constant string PushMdl="Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl"
private constant string PushAtt="origin"
endglobals
private constant function Cr_Percent takes real lvl returns real
return 10+(5*lvl)
endfunction
//Conditions
private function Trig_Crush_Conditions takes nothing returns boolean
return GetUnitAbilityLevelSwapped(SpellId, GetAttacker()) > 0
endfunction
//Actions
private struct CrushDatas
real tt
unit attacked
real angle
endstruct
private function CrushMotion takes nothing returns nothing
local timer t =GetExpiredTimer()
local CrushDatas datas=GetStoredInteger(GC(),HS(t),"datas")
local real x =GetUnitX(datas.attacked)
local real y =GetUnitY(datas.attacked)
call VUnitPolarXY(datas.attacked,MotionSpeed,datas.angle)
call DestroyEffect(AddSpecialEffectTarget(PushMdl,datas.attacked,PushAtt))
set datas.tt=PeriodicTime+datas.tt
if datas.tt<=MaxPushTime then
call TimerStart(t,PeriodicTime,false,function CrushMotion)
else
call CrushDatas.destroy(datas)
call FlushStoredMission(GC(),HS(t))
call AB_DestroyTimer(t)
endif
endfunction
private function CrushBegin takes nothing returns nothing
local unit attacked=GetTriggerUnit()
local timer t =CreateTimer()
local unit u =GetEventDamageSource()
local CrushDatas datas=CrushDatas.create()
local real ang =A2PXY(GetUnitX(u),GetUnitY(u),GetUnitX(attacked),GetUnitY(attacked))
call UnitAddAbility(attacked,BuffAddId)
call IssueImmediateOrder(attacked,BuffOrder)
call UnitRemoveAbility(attacked,BuffAddId)
call TimerStart(t,0,false,function CrushMotion)
set datas.tt=0.00
set datas.attacked=attacked
set datas.angle=ang
call StoreInteger(GC(),HS(t),"datas",datas)
call DestroyDamageTrig_Vars(GetTriggeringTrigger())
set t=null
endfunction
private function Trig_Crush_Actions takes nothing returns nothing
local real rndm =GetRandomReal(0,100)
if Cr_Percent(I2R(GetUnitAbilityLevelSwapped(SpellId, GetAttacker())))>=rndm then
call Add_DamageTrigger(GetTriggerUnit(),4,GetAttacker(),function CrushBegin)
endif
endfunction
//===========================================================================
function InitTrig_Crush takes nothing returns nothing
set gg_trg_Crush = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Crush, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Crush, Condition( function Trig_Crush_Conditions ) )
call TriggerAddAction( gg_trg_Crush, function Trig_Crush_Actions )
endfunction
endscope
//Electrical Field made by OrkOfMordor aka Hanky aka MDZ-OrkOfMordor
//Constants
scope ElectricFlield
globals
private constant integer SpellId='A004'
private constant integer BuffSpellId='A003'
private constant integer MaxMissiles=6
private constant real MaxSpeed=10.00
private constant real MaxRange=250.00
private constant integer DummyId='e000'
private constant string MissileMdl="Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl"
private constant string MissileAttachPoint="origin"
private constant string BuffOrder="thunderclap"
private constant real MissileDamageRange=120.00
private constant real MovementPerOfMissiles=0.03
private constant string Code="ElectroFlieldExpl"
endglobals
private function EF_MissileFlyHeight takes nothing returns real
return GetRandomReal(500,700)
endfunction
private constant function EF_Damage takes integer lvl returns integer
return (15*lvl)+30
endfunction
//Conditions
private function Trig_Electric_Field_Conditions takes nothing returns boolean
return GetSpellAbilityId() == SpellId
endfunction
private function ElectroFieldFilerConditions takes nothing returns boolean
local unit c =I2U(GetStoredInteger(GC(),Code,"c"))
return IsUnitNotImmun(c,GetFilterUnit())
endfunction
//Actions
private function ElectroFieldDamage takes nothing returns nothing
local unit c =I2U(GetStoredInteger(GC(),Code,"c"))
call UnitDamageTarget(c,GetEnumUnit(),I2R(EF_Damage(GetUnitAbilityLevel(c,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
set c=null
endfunction
private struct ElectroBombs
unit caster
unit missile
effect gfx
endstruct
private function ElectroFlieldExpl takes nothing returns nothing
local timer t =GetExpiredTimer()
local ElectroBombs datas =GetStoredInteger(GC(),HS(t),"datas")
local group g
call DestroyEffect(datas.gfx)
call StoreInteger(GC(),Code,"c",H2I(datas.caster))
set g=GetUnitsInRange(MissileDamageRange,GetUnitX(datas.missile),GetUnitY(datas.missile),Condition(function ElectroFieldFilerConditions),true)
call ForGroup(g,function ElectroFieldDamage)
call AB_DestroyGroup(g)
call FlushStoredMission(GC(),Code)
call UnitAddAbility(datas.missile,BuffSpellId)
call SetUnitAbilityLevel(datas.missile,BuffSpellId,GetUnitAbilityLevel(datas.caster,SpellId))
call IssueImmediateOrder(datas.missile,BuffOrder)
call U2Null(datas.missile,0.5)
call ElectroBombs.destroy(datas)
call FlushStoredMission(GC(),HS(t))
call AB_DestroyTimer(t)
endfunction
private function Trig_Electric_Field_Actions takes nothing returns nothing
local timer t =null
local unit tempunit =null
local real randomA =0
local real randomB =0
local real randomY =0
local real randomX =0
local integer int =1
local effect tempgfx =null
local ElectroBombs datas
local unit u =GetTriggerUnit()
local location loc =GetSpellTargetLoc()
local real x =GetUnitX(u)
local real y =GetUnitY(u)
local real Rx =GetLocationX(loc)
local real Ry =GetLocationY(loc)
loop
exitwhen int>MaxMissiles
set t =CreateTimer()
set randomA =GetRandomReal(0,360)
set randomB =GetRandomReal(0,MaxRange)
set randomX =Rx+randomB*Cos(randomA*bj_DEGTORAD)
set randomY =Ry+randomB*Sin(randomA*bj_DEGTORAD)
set tempunit =CreateUnit(GetOwningPlayer(u),DummyId,x,y,0)
set tempgfx =AddSpecialEffectTarget(MissileMdl,tempunit,MissileAttachPoint)
call LaunchMissileAtPointEx(tempunit,x,y,45,EF_MissileFlyHeight(),randomX,randomY,MaxSpeed)
call TimerStart(t,CalculateMaxMotionTime(D2PXY(x,y,randomX,randomY),MaxSpeed,MovementPerOfMissiles),false,function ElectroFlieldExpl)
set datas=ElectroBombs.create()
set datas.caster=u
set datas.missile=tempunit
set datas.gfx=tempgfx
call StoreInteger(GC(),HS(t),"datas",datas)
set t=null
set int=int+1
endloop
call RemoveLocation(loc)
endfunction
//===========================================================================
function InitTrig_Electric_Field takes nothing returns nothing
set gg_trg_Electric_Field = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Electric_Field, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Electric_Field, Condition( function Trig_Electric_Field_Conditions ) )
call TriggerAddAction( gg_trg_Electric_Field, function Trig_Electric_Field_Actions )
endfunction
endscope
//Fire Bombs by Hanky aka OrkOfMordor aka MDZ-OrkOfMordor
//Constants
scope FireBombs
globals
private constant integer SpellId='A007'
private constant integer BuffSpellId='A00A'
private constant string BuffOrder="unholyfrenzy"
private constant integer MaxMissiles=6
private constant integer DummyId='e000'
private constant real MaxRange=250.00
private constant real MissileDamageRange=120.00
private constant real MaxSpeed=10.00
private constant string ExplMdl="Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl"
private constant string MissileMdl="Abilities\\Weapons\\BatTrollMissile\\BatTrollMissile.mdl"
private constant string MissileAttachPoint="origin"
private constant string Code="FireBombsExpl"
private constant real MovementPerOfMissiles=0.03
endglobals
private function FB_MissileFlyHeight takes nothing returns real
return GetRandomReal(500,700)
endfunction
private constant function FB_Damage takes integer lvl returns integer
return 50*lvl
endfunction
//conditions
private function FireBombFilerConditions takes nothing returns boolean
local unit c =I2U(GetStoredInteger(GC(),Code,"c"))
return IsUnitNotImmun(c,GetFilterUnit())
endfunction
private function Trig_Fire_Bombs_Conditions takes nothing returns boolean
return GetSpellAbilityId() == SpellId
endfunction
//actions
private function FireBombsDamage takes nothing returns nothing
local unit c =I2U(GetStoredInteger(GC(),Code,"c"))
local unit a =GetEnumUnit()
local unit u =CreateUnit(GetOwningPlayer(c),DummyId,GetUnitX(a),GetUnitY(a),0)
call UnitDamageTarget(c,a,I2R(FB_Damage(GetUnitAbilityLevel(c,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
if IsUnitNotImmun(c,a) then
call UnitAddAbility(u,BuffSpellId)
call SetUnitAbilityLevel(u,BuffSpellId,GetUnitAbilityLevel(c,SpellId))
call IssueTargetOrder(u,BuffOrder,a)
call U2Null(u,0.5)
endif
set u=null
set c=null
set a=null
endfunction
private struct FireBombs
unit caster
unit missile
effect gfx
endstruct
private function FireBombsExpl takes nothing returns nothing
local timer t =GetExpiredTimer()
local FireBombs datas =GetStoredInteger(GC(),HS(t),"datas")
local group g
call DestroyEffect(AddSpecialEffect(ExplMdl,GetUnitX(datas.missile),GetUnitY(datas.missile)))
call DestroyEffect(datas.gfx)
call StoreInteger(GC(),Code,"c",H2I(datas.caster))
set g=GetUnitsInRange(MissileDamageRange,GetUnitX(datas.missile),GetUnitY(datas.missile),Condition(function FireBombFilerConditions),true)
call ForGroup(g,function FireBombsDamage)
call AB_DestroyGroup(g)
call FlushStoredMission(GC(),Code)
call RemoveUnit(datas.missile)
call FireBombs.destroy(datas)
call FlushStoredMission(GC(),HS(t))
call AB_DestroyTimer(t)
endfunction
private function Trig_Fire_Bombs_Actions takes nothing returns nothing
local timer t =null
local unit tempunit =null
local real randomA =0
local real randomB =0
local real randomY =0
local real randomX =0
local integer int =1
local effect tempgfx =null
local FireBombs datas
local unit u =GetTriggerUnit()
local location loc =GetSpellTargetLoc()
local real x =GetUnitX(u)
local real y =GetUnitY(u)
local real Rx =GetLocationX(loc)
local real Ry =GetLocationY(loc)
loop
exitwhen int>MaxMissiles
set t =CreateTimer()
set randomA =GetRandomReal(0,360)
set randomB =GetRandomReal(0,MaxRange)
set randomX =Rx+randomB*Cos(randomA*bj_DEGTORAD)
set randomY =Ry+randomB*Sin(randomA*bj_DEGTORAD)
set tempunit =CreateUnit(GetOwningPlayer(u),DummyId,x,y,0)
set tempgfx =AddSpecialEffectTarget(MissileMdl,tempunit,MissileAttachPoint)
call LaunchMissileAtPointEx(tempunit,x,y,45,FB_MissileFlyHeight(),randomX,randomY,MaxSpeed)
call TimerStart(t,CalculateMaxMotionTime(D2PXY(x,y,randomX,randomY),MaxSpeed,MovementPerOfMissiles),false,function FireBombsExpl)
set datas=FireBombs.create()
set datas.caster=u
set datas.missile=tempunit
set datas.gfx=tempgfx
call StoreInteger(GC(),HS(t),"datas",datas)
set t=null
set int=int+1
endloop
call RemoveLocation(loc)
endfunction
//===========================================================================
function InitTrig_Fire_Bombs takes nothing returns nothing
set gg_trg_Fire_Bombs = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fire_Bombs, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fire_Bombs, Condition( function Trig_Fire_Bombs_Conditions ) )
call TriggerAddAction( gg_trg_Fire_Bombs, function Trig_Fire_Bombs_Actions )
endfunction
endscope
//Critical Jump by Hanky aka OrkOfMordor aka MDZ-OrkOfMordor
//Constants
scope CriticalJump
globals
private constant integer SpellId='A009'
private constant string EndEffect="Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl"
private constant integer BuffSpellId='A008'
private constant string BuffOrder="berserk"
private constant real JumpSpeed=15.00
private constant real Range=250.00
private constant string Code="CriticalJumpEnd"
private constant real MovementPerOfMissiles=0.03
endglobals
private constant function CJ_Damage takes integer lvl returns integer
return 50+(75*lvl)
endfunction
private constant function CJ_MaxFlyHeight takes real distance returns real
return distance*1.1
endfunction
//conditions
private function Trig_Critical_Jump_Conditions takes nothing returns boolean
return GetSpellAbilityId()==SpellId
endfunction
//actions
private function CJ_GetDamage takes nothing returns nothing
local unit c =I2U(GetStoredInteger(GC(),Code,"c"))
local unit u =GetEnumUnit()
if IsUnitNotImmun(c,u) then
call UnitAddAbility(u,BuffSpellId)
call IssueImmediateOrder(u,BuffOrder)
call UnitRemoveAbility(u,BuffSpellId)
call UnitDamageTarget(c,u,I2R(CJ_Damage(GetUnitAbilityLevel(c,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
set c=null
set u=null
endfunction
private function CriticalJumpEnd takes nothing returns nothing
local timer t =GetExpiredTimer()
local unit caster =I2U(GetStoredInteger(GC(),HS(t),"caster"))
local real x =GetUnitX(caster)
local real y =GetUnitY(caster)
local group g =GetUnitsInRange(Range,x,y,null,true)
call DestroyEffect(AddSpecialEffect(EndEffect,x,y))
call TerrainDeformationRippleXY(1,false,x,y,0,Range,90,0.5,200)
call StoreInteger(GC(),Code,"c",H2I(caster))
call ForGroup(g,function CJ_GetDamage)
call FlushStoredMission(GC(),Code)
call BugUse_AddFlyAbility(caster)
call SetUnitFlyHeight(caster,0,0)
call SetUnitAnimation(caster,"attack")
call SetUnitPathing(caster,true)
call AB_DestroyGroup(g)
call FlushStoredMission(GC(),HS(t))
call AB_DestroyTimer(t)
endfunction
private function Trig_Critical_Jump_Actions takes nothing returns nothing
local timer t =CreateTimer()
local location loc =GetSpellTargetLoc()
local unit u =GetTriggerUnit()
local real x =GetUnitX(u)
local real y =GetUnitY(u)
local real lx =GetLocationX(loc)
local real ly =GetLocationY(loc)
call SetUnitPathing(u,false)
call LaunchMissileAtPointEx(u,x,y,0,CJ_MaxFlyHeight(D2PXY(x,y,lx,ly)),lx,ly,JumpSpeed)
call SetUnitFacing(u,A2PXY(x,y,lx,ly))
call TimerStart(t,CalculateMaxMotionTime(D2PXY(x,y,lx,ly),JumpSpeed,MovementPerOfMissiles),false,function CriticalJumpEnd)
call StoreInteger(GC(),HS(t),"caster",H2I(u))
call RemoveLocation(loc)
set t=null
endfunction
//===========================================================================
function InitTrig_Critical_Jump takes nothing returns nothing
set gg_trg_Critical_Jump = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Critical_Jump, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Critical_Jump, Condition( function Trig_Critical_Jump_Conditions ) )
call TriggerAddAction( gg_trg_Critical_Jump, function Trig_Critical_Jump_Actions )
endfunction
endscope
//Frost Sphere by Hanky aka OrkOfMordor aka MDZ-OrkOfMordor
//Constants
scope FrostSphere
globals
private constant integer SpellId='A005'
private constant integer BuffSpellId='A006'
private constant string BuffOrder="berserk"
private constant real PerSecondCreate=0.25
private constant integer DummyId='e000'
private constant real SphereSpeed=10.00
private constant real MissileSpeed=15.00
private constant real PeriodicTime=0.03
private constant real TurnSpeed=45.00
private constant real MissileDistance=1000.00
private constant real MaxSphereDistance=2000.00
private constant string MissileMdl="Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl"
private constant string MissileAttackPoint="chest"
private constant string SMissileMdl="Abilities\\Weapons\\LichMissile\\LichMissile.mdl"
private constant string ExplMissileMdl="Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl"
private constant string ExplSphereMdl="Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl"
private constant string SMissileAttackPoint="chest"
private constant string MCode="FS_MissileHit"
endglobals
private constant function FS_MissileDamage takes integer lvl returns integer
return 90*lvl+5
endfunction
//conditions
private function Trig_Frost_Sphere_Conditions takes nothing returns boolean
return GetSpellAbilityId()==SpellId
endfunction
//actions
private function FS_DamageOfMissile takes nothing returns nothing
local unit caster =I2U(GetStoredInteger(GC(),MCode,"c"))
local unit missile =I2U(GetStoredInteger(GC(),MCode,"m"))
local unit u =GetEnumUnit()
if IsUnitNotImmun(caster,u) and missile!=u then
call UnitAddAbility(u,BuffSpellId)
call IssueImmediateOrder(u,BuffOrder)
call UnitRemoveAbility(u,BuffSpellId)
call UnitDamageTarget(caster,u,I2R(FS_MissileDamage(GetUnitAbilityLevel(caster,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
set caster =null
set missile=null
set u =null
endfunction
function FS_MissileHit takes nothing returns nothing
local unit caster =tc
local unit missile =tm
local real x =GetUnitX(tm)
local real y =GetUnitY(tm)
local group g =GetUnitsInRange(120,x,y,null,true)
local effect gfx =I2E(GetStoredInteger(GC(),HS(missile),"gfx"))
if CountUnitsInGroup(g)>0 then
call StoreInteger(GC(),MCode,"c",H2I(caster))
call StoreInteger(GC(),MCode,"M",H2I(missile))
call ForGroup(g,function FS_DamageOfMissile)
call FlushStoredMission(GC(),MCode)
endif
call E2Null(AddSpecialEffect(ExplMissileMdl,x,y),1)
call DestroyEffect(gfx)
call AB_DestroyGroup(g)
call FlushStoredMission(GC(),HS(missile))
call RemoveUnit(missile)
set caster=null
endfunction
private struct FrostSphereDatas
unit sphere
unit caster
effect gfx
real circ
real angl
real tdis
real ttim
endstruct
private function FrostSphereMotion takes nothing returns nothing
local timer t =GetExpiredTimer()
local FrostSphereDatas datas=GetStoredInteger(GC(),HS(t),"datas")
local unit missile =null
local real mx =0
local real my =0
local real ux =0
local real uy =0
local effect mgfx
call VUnitPolarXY(datas.sphere,SphereSpeed,datas.angl)
set datas.tdis=SphereSpeed+datas.tdis
set ux=GetUnitX(datas.sphere)
set uy=GetUnitY(datas.sphere)
if datas.ttim>PerSecondCreate and datas.tdis<=MaxSphereDistance then
set datas.ttim=0
call DestroyEffect(datas.gfx)
set datas.gfx=AddSpecialEffectTarget(MissileMdl,datas.sphere,MissileAttackPoint)
set datas.circ=datas.circ+TurnSpeed
set mx=ux+MissileDistance*Cos(datas.circ*bj_DEGTORAD)
set my=uy+MissileDistance*Sin(datas.circ*bj_DEGTORAD)
set missile=CreateUnit(GetOwningPlayer(datas.caster),DummyId,ux,uy,A2PXY(ux,uy,mx,my))
set mgfx=AddSpecialEffectTarget(SMissileMdl,missile,SMissileAttackPoint)
call LaunchNormalCollisionMissileAtPointEx(datas.caster,missile,ux,uy,0,mx,my,MissileSpeed,90,MCode)
call StoreInteger(GC(),HS(missile),"gfx",H2I(mgfx))
elseif datas.ttim<=PerSecondCreate then
set datas.ttim=datas.ttim+PeriodicTime
endif
if datas.tdis>MaxSphereDistance then
call DestroyEffect(AddSpecialEffect(ExplSphereMdl,ux,uy))
call DestroyEffect(AddSpecialEffect(MissileMdl,ux,uy))
call DestroyEffect(datas.gfx)
call RemoveUnit(datas.sphere)
call FrostSphereDatas.destroy(datas)
call FlushStoredMission(GC(),HS(t))
call AB_DestroyTimer(t)
else
call TimerStart(t,PeriodicTime,false,function FrostSphereMotion)
set t=null
endif
endfunction
private function Trig_Frost_Sphere_Actions takes nothing returns nothing
local timer t =CreateTimer()
local location loc =GetSpellTargetLoc()
local FrostSphereDatas datas=FrostSphereDatas.create()
local unit u =GetTriggerUnit()
local real x =GetUnitX(u)
local real y =GetUnitY(u)
local real lx =GetLocationX(loc)
local real ly =GetLocationY(loc)
local real angle =A2PXY(x,y,lx,ly)
local unit sphere =CreateUnit(Player(14),DummyId,x,y,angle)
local effect gfx =AddSpecialEffectTarget(MissileMdl,sphere,MissileAttackPoint)
call TimerStart(t,0,false,function FrostSphereMotion)
set datas.gfx=gfx
set datas.sphere=sphere
set datas.caster=u
set datas.angl=angle
set datas.circ=0
set datas.tdis=0
set datas.ttim=0
call StoreInteger(GC(),HS(t),"datas",datas)
call RemoveLocation(loc)
set t=null
endfunction
//===========================================================================
function InitTrig_Frost_Sphere takes nothing returns nothing
set gg_trg_Frost_Sphere = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Sphere, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frost_Sphere, Condition( function Trig_Frost_Sphere_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Sphere, function Trig_Frost_Sphere_Actions )
endfunction
endscope
//Bloody Run by Hanky aka OrkOfMordor aka MDZ-OrkOfMordor
scope BloodyRun
globals
private constant integer SpellId='A00C'
private constant string RunOrder="move"
private constant string StopOrder="stop"
private constant string Code ="BloodyRunMotion"
private constant real Periodic =0.03
private constant real Speed =10.00
private rect MaxArea =null
private constant real Range =120.00
private constant string dmgGFX ="Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
private constant string dmgAtt ="origin"
private constant string uGFX ="Abilities\\Spells\\Items\\VampiricPotion\\VampPotionCaster.mdl"
private constant string uAtt ="origin"
endglobals
private constant function Damage takes real lvl returns real
return 25+50*lvl
endfunction
private struct BloodyRunDatas
unit caster
real distance
real angle
real Nspeed
effect gfx
group notDamage
endstruct
private function Trig_Bloody_Run_Conditions takes nothing returns boolean
return GetSpellAbilityId()==SpellId
endfunction
private function GroupDamage takes nothing returns nothing
local group AddGroup=I2G(GetStoredInteger(GC(),Code,"AddGroup"))
local unit Caster =I2U(GetStoredInteger(GC(),Code,"Caster"))
local unit u =GetEnumUnit()
if not IsUnitInGroup(u,AddGroup) and IsUnitNotImmun(Caster,u) then
call DestroyEffect(AddSpecialEffectTarget(dmgGFX,u,dmgAtt))
call GroupAddUnit(AddGroup,u)
call UnitDamageTarget(Caster,u,Damage(I2R(GetUnitAbilityLevel(Caster,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
set AddGroup=null
set Caster=null
set u=null
endfunction
private function BloodyRunMotion takes nothing returns nothing
local timer t =GetExpiredTimer()
local BloodyRunDatas datas=GetStoredInteger(GC(),HS(t),"datas")
local real x =GetUnitX(datas.caster)+Speed*Cos(datas.angle*3.14159/180)
local real y =GetUnitY(datas.caster)+Speed*Sin(datas.angle*3.14159/180)
local group g
if datas.distance>0 and GetUnitStateSwap(UNIT_STATE_LIFE,datas.caster)>0 and RectContainsCoords(MaxArea,x,y) and CountDestructableInRangeOfXY(x,y,Range)<=0 then
call SetUnitX(datas.caster,x)
call SetUnitY(datas.caster,y)
call StoreInteger(GC(),Code,"AddGroup",H2I(datas.notDamage))
call StoreInteger(GC(),Code,"Caster",H2I(datas.caster))
set g=GetUnitsInRange(Range,x,y,null,true)
call ForGroup(g,function GroupDamage)
call AB_DestroyGroup(g)
call FlushStoredMission(GC(),Code)
set datas.distance=datas.distance-Speed
call TimerStart(t,Periodic,false,function BloodyRunMotion)
else
call SetUnitMoveSpeed(datas.caster,datas.Nspeed)
call SetUnitPathing(datas.caster,true)
call IssueImmediateOrder(datas.caster,StopOrder)
call SetUnitVertexColor(datas.caster,255,255,255,255)
call DestroyEffect(datas.gfx)
call AB_DestroyGroup(datas.notDamage)
call BloodyRunDatas.destroy(datas)
call FlushStoredMission(GC(),HS(t))
call DestroyTimer(t)
endif
endfunction
private function Trig_Bloody_Run_Actions takes nothing returns nothing
local BloodyRunDatas datas=BloodyRunDatas.create()
local location OrderPoint =GetSpellTargetLoc()
local timer t =CreateTimer()
local unit u =GetTriggerUnit()
local real ux =GetUnitX(u)
local real uy =GetUnitY(u)
local real ttx =GetLocationX(OrderPoint)
local real tty =GetLocationY(OrderPoint)
set datas.caster=u
set datas.distance=D2PXY(ux,uy,ttx,tty)-(GetUnitMoveSpeed(u)/D2PXY(ux,uy,ttx,tty))
set datas.angle=A2PXY(ux,uy,ttx,tty)
set datas.gfx=AddSpecialEffectTarget(uGFX,u,uAtt)
set datas.notDamage=CreateGroup()
call SetUnitVertexColor(u,255,50,50,75)
set datas.Nspeed=GetUnitMoveSpeed(u)
call SetUnitMoveSpeed(u,1)
call SetUnitPathing(u,false)
call IssuePointOrder(u,RunOrder,ttx,tty)
call TimerStart(t,Periodic,false,function BloodyRunMotion)
call StoreInteger(GC(),HS(t),"datas",datas)
set t=null
set u=null
call RemoveLocation(OrderPoint)
endfunction
//===========================================================================
function InitTrig_Bloody_Run takes nothing returns nothing
set gg_trg_Bloody_Run = CreateTrigger( )
set MaxArea=GetWorldBounds()
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bloody_Run, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Bloody_Run, Condition( function Trig_Bloody_Run_Conditions ) )
call TriggerAddAction( gg_trg_Bloody_Run, function Trig_Bloody_Run_Actions )
endfunction
endscope