[Spell] Counter Helix (DotA)
2 participantes
Página 1 de 1
[Spell] Counter Helix (DotA)
Descrição da Spell:
Sempre que atacado, o herói possui certa chance de girar com sua lâmina, causando danos á todos os inimigos próximos.
Plataforma da Spell:
vJass
Requisitos:
JNGP (Jass New Generation Pack)
Setup (JESP):
- Open Source: pode ser aberto no World Editor.
JNGP (Link Externo)
- Página de download da ferramenta
- Instruções de uso e instalação na página de download (inglês).
Sempre que atacado, o herói possui certa chance de girar com sua lâmina, causando danos á todos os inimigos próximos.
Plataforma da Spell:
vJass
Requisitos:
JNGP (Jass New Generation Pack)
Setup (JESP):
- Código:
module CounterHelixSetup
public static constant method SPELL_RAWCODE takes nothing returns integer
return 'A000'
endmethod
public static method COUNTER_CHANCE_FACTOR takes real level returns real
return (level * 10.00)
endmethod
public static method SPELL_DAMAGE_FACTOR takes real level returns real
return (level * 50.00)
endmethod
// AOE = Área of Effect
public static constant method SPELL_AOE_FACTOR takes nothing returns real
return 256.00
endmethod
endmodule
- Código:
module enemyAttack
private static method prepareDamageEvent takes nothing returns boolean
local unit u1 = GetTriggerUnit()
local unit u2 = GetAttacker()
local integer i = 0
if GetUnitAbilityLevel(u1,SPELL_RAWCODE()) > 0 then
set i = GetUnitAbilityLevel(u1,SPELL_RAWCODE())
call thistype.registerDamageEvent(u1,i)
endif
set u2 = null
set u1 = null
return false
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t,Player(i),ConvertPlayerUnitEvent(18),null)
set i = i + 1
exitwhen i == 12
endloop
call TriggerAddCondition(t,Condition(function thistype.prepareDamageEvent))
endmethod
endmodule
struct CounterHelix extends array
implement CounterHelixSetup
implement enemyAttack
private static hashtable hash = InitHashtable()
private static method filterEnemies takes nothing returns boolean
return GetUnitState(GetFilterUnit(),ConvertUnitState(0)) > 0 and not IsUnitType(GetFilterUnit(),ConvertUnitType(15))
endmethod
private static method doSpin takes nothing returns nothing
local trigger t = GetTriggeringTrigger()
local unit u = null
local player p = null
local real i = COUNTER_CHANCE_FACTOR(I2R(LoadInteger(hash,GetHandleId(t),StringHash("key"))))
local real r = GetRandomReal(0.,100.)
local group g = null
local unit f = null
local boolexpr b = null
local effect e = null
if r < i then
set u = GetTriggerUnit()
set p = GetOwningPlayer(u)
set g = CreateGroup()
set b = Filter(function thistype.filterEnemies)
call SetUnitAnimation(u,"spin")
call GroupEnumUnitsInRange(g,GetUnitX(u),GetUnitY(u),SPELL_AOE_FACTOR(),b)
loop
set f = FirstOfGroup(g)
if IsUnitEnemy(f,p) then
call UnitDamageTarget(u,f,SPELL_DAMAGE_FACTOR(I2R(LoadInteger(hash,GetHandleId(t),StringHash("key")))),false,false,ConvertAttackType(0),ConvertDamageType(4),ConvertWeaponType(0))
set e = AddSpecialEffect("Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodSmall0.mdl",GetUnitX(f),GetUnitY(f))
call DestroyEffect(e)
endif
call GroupRemoveUnit(g,f)
exitwhen f == null
endloop
call TriggerSleepAction(.5)
call SetUnitAnimation(u,"stand")
call DestroyBoolExpr(b)
call DestroyGroup(g)
endif
call FlushChildHashtable(hash,GetHandleId(t))
call DestroyTrigger(t)
set e = null
set b = null
set g = null
set p = null
set u = null
set t = null
endmethod
private static method registerDamageEvent takes unit un,integer in returns nothing
local trigger t = CreateTrigger()
call SaveInteger(hash,GetHandleId(t),StringHash("key"),in)
call TriggerRegisterUnitEvent(t,un,ConvertUnitEvent(52))
call TriggerAddAction(t,function thistype.doSpin)
set t = null
endmethod
private static method prepareDamageEvent takes nothing returns boolean
local unit u1 = GetTriggerUnit()
local unit u2 = GetAttacker()
local integer i = 0
if GetUnitAbilityLevel(u1,SPELL_RAWCODE()) > 0 then
set i = GetUnitAbilityLevel(u1,SPELL_RAWCODE())
call thistype.registerDamageEvent(u1,i)
endif
set u2 = null
set u1 = null
return false
endmethod
private static method prepareAttackEvent takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t,Player(i),ConvertPlayerUnitEvent(18),null)
set i = i + 1
exitwhen i == 12
endloop
call TriggerAddCondition(t,Condition(function thistype.prepareDamageEvent))
endmethod
private static method prepareSkill takes nothing returns boolean
local unit u = null
local player p = null
local integer i = 0
if GetLearnedSkill() == SPELL_RAWCODE() then
set u = GetTriggerUnit()
set p = GetOwningPlayer(u)
set i = GetUnitAbilityLevel(u,GetLearnedSkill())
endif
return false
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t,Player(i),ConvertPlayerUnitEvent(42),null)
set i = i + 1
exitwhen i == 12
endloop
call TriggerAddCondition(t,Condition(function thistype.prepareSkill))
set t = null
endmethod
endstruct
- Open Source: pode ser aberto no World Editor.
JNGP (Link Externo)
- Página de download da ferramenta
- Instruções de uso e instalação na página de download (inglês).
Re: [Spell] Counter Helix (DotA)
Ooh gostei da magia e_e
Adoro magias passives com habilidades super interessantes. Você poderia postar um Slash?
Adoro magias passives com habilidades super interessantes. Você poderia postar um Slash?
Tópicos semelhantes
» (Spell Igui)Cold Feet,a spell do ancient do dota
» (We Spell) Counter Strike Video-Aula
» [Resolvido] spell (dota)
» [Spell] Toxic Laser Spell
» Spell Pack, Rubick (Dota)
» (We Spell) Counter Strike Video-Aula
» [Resolvido] spell (dota)
» [Spell] Toxic Laser Spell
» Spell Pack, Rubick (Dota)
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|