Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- скил "Холод"
- function Trig_PL02_Conditions takes nothing returns boolean
- return GetSpellAbilityId() == 'A0DB'
- endfunction
- function Trig_PL02_G takes nothing returns boolean
- return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetSpellAbilityUnit()))
- endfunction
- function PL02_End takes nothing returns nothing
- local timer t = GetExpiredTimer()
- local integer tID = GetHandleId(t)
- local unit c = LoadUnitHandle(udg_cache,1,tID)
- call KillUnit©
- call RemoveUnit©
- call DestroyTimer(t)
- set c = null
- set t = null
- endfunction
- function DummyUnit takes player pl, location l, integer lvl returns nothing
- local timer t = CreateTimer()
- local unit c = CreateUnitAtLoc(pl,'h00P',l, 0)
- local integer tID = GetHandleId(t)
- call RemoveLocation(l)
- call UnitAddAbility(c,'A0DH')
- call SetUnitAbilityLevel(c,'A0DH',lvl)
- call IssueImmediateOrder(c,"creepthunderclap")
- call SaveUnitHandle(udg_cache, 1, tID, c)
- call TimerStart(t,.5, false, function PL02_End )
- set c = null
- set t = null
- endfunction
- function Trig_PL02_Actions takes nothing returns nothing
- local unit uA = GetSpellAbilityUnit()
- local player p = GetOwningPlayer(uA)
- local location lT = GetSpellTargetLoc()
- local integer lvl = GetUnitAbilityLevel(uA,'A0DB')
- local group g = CreateGroup()
- local group g2 = CreateGroup()
- local real osDmg = 10 + 10*lvl
- local real dopDmg = 10*lvl
- local real dmg
- local real rad = 375
- local integer sec = 8
- local unit f
- local unit c
- local integer In
- set g = GetUnitsInRangeOfLocMatching(rad,lT, Condition(function Trig_PL02_G))
- call DummyUnit(p,lT,lvl)
- set In = 1
- loop
- exitwhen In > sec or FirstOfGroup(g) == null
- set g2 = CopyGroup(g)
- loop
- set f = FirstOfGroup(g2)
- exitwhen f == null
- if GetUnitAbilityLevel(f,'B02E') > 0 then
- set dmg = osDmg + dopDmg
- else
- set dmg = osDmg
- endif
- if GetWidgetLife(f) > 0.405 then
- call UnitDamageTarget(uA,f,dmg,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
- else
- call GroupRemoveUnitSimple(f,g)
- endif
- call GroupRemoveUnitSimple(f,g2)
- endloop
- call PolledWait(1)
- set In = In + 1
- endloop
- call DestroyGroup(g2)
- set uA = null
- set p = null
- set lT = null
- set g = null
- set g2 = null
- set f = null
- set c = null
- endfunction
- function InitTrig_PL02 takes nothing returns nothing
- local integer temp = 0
- local integer max = bj_MAX_PLAYER_SLOTS
- set gg_trg_PL02 = CreateTrigger( )
- loop
- exitwhen temp == max
- call TriggerRegisterPlayerUnitEvent(gg_trg_PL02, Player(temp), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
- set temp = temp + 1
- endloop
- call TriggerAddCondition( gg_trg_PL02, Condition( function Trig_PL02_Conditions ) )
- call TriggerAddAction( gg_trg_PL02, function Trig_PL02_Actions )
- endfunction
- Скил "Заморозка":
- function Trig_PL03_Conditions takes nothing returns boolean
- return GetUnitAbilityLevel(GetTriggerUnit(),'A0D9') > 0 and GetUnitTypeId(GetTriggerUnit()) == 'U00A'
- endfunction
- function PL03_End takes nothing returns nothing
- local timer t = GetExpiredTimer()
- local integer tID = GetHandleId(t)
- local unit c = LoadUnitHandle(udg_cache,1,tID)
- local effect e = LoadEffectHandle(udg_cache,2,tID)
- call DestroyEffect(e)
- call SetUnitTimeScale( c, 1.00 )
- call PauseUnit(c, false)
- call DestroyTimer(t)
- set c = null
- set t = null
- set e = null
- endfunction
- function Trig_PL03_Actions takes nothing returns nothing
- local effect e
- local timer t = CreateTimer()
- local integer tID = GetHandleId(t)
- local unit u = GetTriggerUnit()
- local unit T = GetAttacker()
- local integer lvl = GetUnitAbilityLevel(u,'A0D9')
- local real time = 0.5*lvl
- local real dmg = 50*lvl
- local integer percent = 18
- local integer c = GetRandomInt(1,100)
- if c <= percent then
- call SetUnitTimeScale( T, 0.00 )
- call PauseUnit(T, true)
- call UnitDamageTarget(u,T,dmg,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
- if GetWidgetLife(T) <= 0.405 then
- set time = 0
- endif
- set e = AddSpecialEffectTarget("Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathTargetArt.mdl", T, "origin" )
- call SaveUnitHandle(udg_cache, 1, tID, T)
- call SaveEffectHandle(udg_cache, 2, tID, e)
- call TimerStart(t,time, false, function PL03_End )
- endif
- set e = null
- set u = null
- set T = null
- set t = null
- endfunction
- function InitTrig_PL03 takes nothing returns nothing
- local integer temp = 0
- local integer max = bj_MAX_PLAYER_SLOTS
- set gg_trg_PL03 = CreateTrigger( )
- loop
- exitwhen temp == max
- call TriggerRegisterPlayerUnitEvent(gg_trg_PL03, Player(temp), EVENT_PLAYER_UNIT_ATTACKED, null)
- set temp = temp + 1
- endloop
- call TriggerAddCondition( gg_trg_PL03, Condition( function Trig_PL03_Conditions ) )
- call TriggerAddAction( gg_trg_PL03, function Trig_PL03_Actions )
- endfunction
- Скил "Льды":
- function Trig_PL04_Conditions takes nothing returns boolean
- return GetSpellAbilityId() == 'A0DJ' or GetSpellAbilityId() == 'A0DG'
- endfunction
- function Trig_PL04_G takes nothing returns boolean
- return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetSpellAbilityUnit()))
- endfunction
- function Trig_PL04_Actions takes nothing returns nothing
- local integer idspell = GetSpellAbilityId()
- local integer idsimple = 'A0DJ'
- local integer id_dummy_spell = 'A0DI'
- local group g = CreateGroup()
- local group g2 = CreateGroup()
- local group g3 = CreateGroup()
- local unit u = GetSpellAbilityUnit()
- local player p = GetOwningPlayer(u)
- local location locT = GetSpellTargetLoc()
- local integer lvl = GetUnitAbilityLevel(u,idspell)
- local integer time = 4+lvl
- local real dmg = 150.00 * I2R(lvl)
- local real dopdmg = 100.00
- local integer doptime = 1
- local real radiusOs = 500.00
- local real radiusDop = 190.00
- local real delta = 18.00
- local string eff = "Abilities\\Spells\\Undead\\FrostArmor\\FrostArmorTarget.mdl"
- local integer In = 1
- local unit f
- local location l
- local location ll
- local effect e
- local effect array e2
- local unit c
- local unit uu
- set ll = locT
- set e2[1] = AddSpecialEffectLoc(eff,ll)
- call MoveLocation(ll, GetLocationX(ll) - delta, GetLocationY(ll) - delta)
- set e2[2] = AddSpecialEffectLoc(eff,ll)
- call MoveLocation(ll, GetLocationX(ll), GetLocationY(ll) + 2*delta)
- set e2[3] = AddSpecialEffectLoc(eff,ll)
- call MoveLocation(ll, GetLocationX(ll) + 2*delta, GetLocationY(ll))
- set e2[4] = AddSpecialEffectLoc(eff,ll)
- call MoveLocation(ll, GetLocationX(ll), GetLocationY(ll) - 2*delta)
- set e2[5] = AddSpecialEffectLoc(eff,ll)
- if idspell == idsimple then
- set time = time + doptime
- set dmg = dmg + dopdmg
- endif
- loop
- exitwhen In > time or LoadBoolean( udg_cache, 1, StringHash("pr"))
- set g = GetUnitsInRangeOfLocMatching(radiusOs, locT, Condition(function Trig_PL04_G))
- set uu = GroupPickRandomUnit(g)
- set l = GetUnitLoc(uu)
- set g2 = GetUnitsInRangeOfLocMatching(radiusDop, l, Condition(function Trig_PL04_G))
- loop
- set f = FirstOfGroup(g2)
- exitwhen f == null
- if IsUnitEnemy(f,p) == true and GetWidgetLife(f) > 0.405 then
- call UnitDamageTarget(u,f,dmg,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
- if GetWidgetLife(f)>0.405 then
- set c = CreateUnitAtLoc(p,'h00P',GetUnitLoc(f),0.00)
- call GroupAddUnit(g3,c)
- call UnitAddAbility(c,id_dummy_spell)
- call IssueTargetOrder(c,"slow",f)
- endif
- endif
- call GroupRemoveUnit(g2,f)
- endloop
- call GroupClear(g)
- if IsUnitEnemy(uu,p) == true then
- set e = AddSpecialEffectLoc("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl",l)
- endif
- call PolledWait(1)
- call DestroyEffect(e)
- loop
- set f = FirstOfGroup(g3)
- exitwhen f == null
- call KillUnit(f)
- call RemoveUnit(f)
- call GroupRemoveUnit(g3,f)
- endloop
- set In = In + 1
- endloop
- call DestroyEffect(e2[1])
- call DestroyEffect(e2[2])
- call DestroyEffect(e2[3])
- call DestroyEffect(e2[4])
- call DestroyEffect(e2[5])
- call DestroyGroup(g)
- call DestroyGroup(g2)
- call DestroyGroup(g3)
- call RemoveLocation(locT)
- call RemoveLocation(l)
- call RemoveLocation(ll)
- set g = null
- set g2 = null
- set g3 = null
- set f = null
- set u = null
- set uu = null
- set locT = null
- set l = null
- set ll = null
- set e = null
- set e2[1] = null
- set e2[2] = null
- set e2[3] = null
- set e2[4] = null
- set e2[5] = null
- set eff = null
- set c = null
- set p = null
- endfunction
- function InitTrig_PL04 takes nothing returns nothing
- local integer temp = 0
- local integer max = bj_MAX_PLAYER_SLOTS
- set gg_trg_PL04 = CreateTrigger( )
- loop
- exitwhen temp == max
- call TriggerRegisterPlayerUnitEvent(gg_trg_PL04, Player(temp), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
- set temp = temp + 1
- endloop
- call TriggerAddCondition( gg_trg_PL04, Condition( function Trig_PL04_Conditions ) )
- call TriggerAddAction( gg_trg_PL04, function Trig_PL04_Actions )
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement