Zombak2500
offline
Опыт:
1,855Активность: |
Скилл
» Code
function Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000' endfunction function Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit() local integer lua = GetUnitAbilityLevel(caster,'A000') local unit target = GetSpellTargetUnit() local string SE1 = "Abilities\\Spells\\Undead\\DarkRitual\\DarkRitualTarget.mdl" local string SE2 = "Abilities\\Spells\\Undead\\CarrionSwarm\\CarrionSwarmDamage.mdl" local integer i = 1
local location p local group g local real R = lua *100 local location ra = GetSpellTargetLoc() local real x = GetLocationX(ra) local real y = GetLocationY(ra) local unit u if lua == 1 then
if target == caster then else call SetUnitLifeBJ( target, ( GetUnitStateSwap(UNIT_STATE_LIFE, target) + lua*100 ) ) call AddSpecialEffect (SE1,GetUnitX(target),GetUnitY(target)) loop exitwhen i > 6 set p = PolarProjectionBJ(GetUnitLoc(target), 150.00, i*60) call AddSpecialEffectLoc(SE2,p) set i = i + 1 endloop endif endif if lua == 2 or lua == 3 then call SetUnitLifeBJ( target, ( GetUnitStateSwap(UNIT_STATE_LIFE, target) + lua*100 ) ) call AddSpecialEffect (SE1,GetUnitX(target),GetUnitY(target)) loop exitwhen i > 6 set p = PolarProjectionBJ(GetUnitLoc(target), 150.00, i*60) call AddSpecialEffectLoc(SE2,p) set i = i + 1 endloop endif if lua == 4 or lua == 5 or lua == 6 then call GroupEnumUnitsInRange(g,x,y,R,null) set u = FirstOfGroup(g) loop exitwhen u == null call GroupRemoveUnit(g,u) if IsPlayerAlly(GetOwningPlayer(caster), GetOwningPlayer(u)) and IsUnitType(u, UNIT_TYPE_STRUCTURE) != true and IsUnitAliveBJ(u) == true then call SetUnitLifeBJ( u, ( GetUnitStateSwap(UNIT_STATE_LIFE, target) + lua*100 ) ) call AddSpecialEffect (SE1,GetUnitX(u),GetUnitY(u)) endif set u = FirstOfGroup(g) endloop endif
if lua == 7 or lua == 8 or lua == 9 then call GroupEnumUnitsInRange(g,GetUnitX(caster),GetUnitY(caster),9000,null) set u = FirstOfGroup(g) loop exitwhen u == null call GroupRemoveUnit(g,u) if not IsPlayerAlly(GetOwningPlayer(caster), GetOwningPlayer(u)) and IsUnitType(u, UNIT_TYPE_STRUCTURE) != true and IsUnitAliveBJ(u) == true then call SetUnitLifeBJ( u, ( GetUnitStateSwap(UNIT_STATE_LIFE, target) + lua*100 ) ) call AddSpecialEffect (SE1,GetUnitX(u),GetUnitY(u)) endif set u = FirstOfGroup(g) endloop loop
exitwhen i > 6 set p = PolarProjectionBJ(GetUnitLoc(caster), 150.00, i*60) call AddSpecialEffectLoc(SE2,p) set i = i + 1 endloop endif set caster = null set lua = 0 set target = null set SE1 = null set SE2 = null set i =0 set p = null set g = null set R = 0 set ra = null set x = 0 set y = 0 set u =null endfunction =========================================================================== function InitTrig_Dark_Heal takes nothing returns nothing set gg_trg_Dark_Heal = CreateTrigger() call TriggerRegisterAnyUnitEventBJ( gg_trg_Dark_Heal, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Dark_Heal, Condition( function Conditions ) ) call TriggerAddAction( gg_trg_Dark_Heal, function Actions ) endfunction Скилл типа канал . на первом-3 уровне юнит. на 4-6 область. на 7-9 нет цели.
скилл ничего не делает на 4-9 уровне способности. |
27.03.2010, 17:59 | #1
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Elf_Stratigo
offline
Опыт:
4,699Активность: |
не вижу инициализации переменной g |
27.03.2010, 20:36 | #2
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Чебурашка
offline
Опыт:
5,460Активность: |
local group g = CreateGroup() сам на этом сгорал не раз ) |
27.03.2010, 21:29 | #3
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Zombak2500
offline
Опыт:
1,855Активность: |
спс тему офф |
27.03.2010, 21:50 | #4
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|