private function RoarEnd takes nothing returns nothing local timer t = GetExpiredTimer() local Roar data = GetTimerData(t) call UnitRemoveAbility(data.caster,ARMORID) call GroupClear(data.g) call DestroyGroup(data.g) call data.destroy() call ReleaseTimer(t) set t = null endfunction
private function RoarBool takes unit u,unit e returns boolean return IsUnitEnemy(e,GetOwningPlayer(u)) and GetWidgetLife(e) > .405 endfunction
private function RoarGroupIssue takes nothing returns nothing local Roar data = GetTimerData(bj_lastStartedTimer) local unit e = GetTriggerUnit() if IsUnitInGroup(e,data.g) then call IssueTargetOrderById(e,851983,data.caster) endif set e = null endfunction
private function RoarGroupUnit takes unit e returns nothing local trigger trg = CreateTrigger() call TriggerRegisterUnitEvent(trg, e, EVENT_UNIT_ISSUED_POINT_ORDER ) call TriggerRegisterUnitEvent(trg, e, EVENT_UNIT_ISSUED_ORDER ) call TriggerAddAction(trg,function RoarGroupIssue) set trg = null endfunction
private function RoarCast takes nothing returns nothing local Roar data=Roar.create() local group eg = CreateGroup() local timer t = NewTimer() local unit e //Loacals end,dont toch this set bj_lastStartedTimer = t //This add for spell MUI O_o set data.caster = GetTriggerUnit() set data.g = CreateGroup() set data.lvl = GetUnitAbilityLevel(data.caster,ROARID) //Data end,dont toch this call UnitAddAbility(data.caster,ARMORID) //Add hero armor ability call GroupEnumUnitsInRange(eg, GetUnitX(data.caster), GetUnitY(data.caster),ROARAOE, null) loop set e = FirstOfGroup(eg) if RoarBool(data.caster,e) then call GroupAddUnit(data.g,e) call RoarGroupUnit(e) call IssueTargetOrderById(e,851983,data.caster) if GetUnitAbilityLevel(data.caster,ARMORID) < ARMORMAX*data.lvl+1 then // +1 - level 1 = 0 call SetUnitAbilityLevel(data.caster,ARMORID,GetUnitAbilityLevel(data.caster,ARMORID)+1) else call SetUnitAbilityLevel(data.caster,ARMORID,ARMORMAX*data.lvl) endif endif exitwhen(e == null) call GroupRemoveUnit(eg,e) endloop call SetTimerData(t,data) call TimerStart(t,RoarDuration(),false,function RoarEnd) call DestroyGroup(eg) call DestroyEffect(AddSpecialEffectTarget(ROAREFFECT,data.caster,ROARATTACH)) set e = null set eg = null endfunction
private function RoarInit takes nothing returns boolean if GetSpellAbilityId() == ROARID then call RoarCast() endif return false endfunction
private function Init takes nothing returns nothing local trigger trg = CreateTrigger() call TriggerRegisterAnyUnitEventBJ(trg,EVENT_PLAYER_UNIT_SPELL_EFFECT) call TriggerAddCondition(trg,Condition(function RoarInit)) set trg = null endfunction
endscope
Заставляет всех вокруг кастера в радиусе 225 атаковать себя, увеличивая защиту кастеру в зависимости от кол-ва врагов вокруг. Легко настраивается. Скачать Hive link