Dedicado ao Twisty .
Descrição da Spell:
Sempre que infligir danos á um inimigo, o herói possui certa chance de recuperar todo o seu HP.
Plataforma da Spell:
vJass
Requisitos:
JNGP (Jass New Generation Pack)
Setup (JESP):
- Open Source: pode ser aberto com o 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).
Descrição da Spell:
Sempre que infligir danos á um inimigo, o herói possui certa chance de recuperar todo o seu HP.
Plataforma da Spell:
vJass
Requisitos:
JNGP (Jass New Generation Pack)
Setup (JESP):
- Código:
module vampiricAttack_Setup
public static constant method SPELL_RAWCODE takes nothing returns integer
return 'A000'
endmethod
public static constant method SPELL_CHANCE_FACTOR takes integer level returns integer
return (level * 10)
endmethod
public static constant method EFFECT_MODEL takes nothing returns string
return "Units\\NightElf\\Wisp\\WispExplode.mdl"
endmethod
public static constant method EFFECT_SOUND takes nothing returns sound
return gg_snd_DispelMagicTarget
endmethod
public static constant method SPELL_DEBUG takes nothing returns integer
// 1 = ON, 0 = OFF
return 1
endmethod
endmodule
- Código:
module vampiricAttack
implement vampiricAttack_Setup
private static method checkSpell takes nothing returns boolean
local unit u1 = GetTriggerUnit()
local unit u2 = GetAttacker()
local player p = GetOwningPlayer(u2)
local real r = 0.
local effect e = null
if GetUnitAbilityLevel(u2,SPELL_RAWCODE())>0 then
set r = GetRandomReal(0.,100.)
if SPELL_DEBUG()>0 and SPELL_DEBUG()<2 then
call BJDebugMsg("|c00cc3300C|c00cf3600h|c00d23900a|c00d53c00n|c00d83f00c|c00db4200e |c00e24900d|c00e54c00e |c00eb5200A|c00ef5600c|c00f25900e|c00f55c00r|c00f85f00t|c00fb6200o|c00ff6600:|r "+I2S(R2I(r))+"%/"+I2S(thistype.lvl[GetPlayerId(p)])+"%")
endif
if r < thistype.lvl[GetPlayerId(p)] then
set e = AddSpecialEffect(EFFECT_MODEL(),GetUnitX(u2),GetUnitY(u2))
call AttachSoundToUnit(EFFECT_SOUND(),u2)
call SetUnitState(u2,ConvertUnitState(0),GetUnitState(u2,ConvertUnitState(1)))
call StartSound(EFFECT_SOUND())
call DestroyEffect(e)
set e = null
endif
endif
set p = null
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 == 13
endloop
call TriggerAddCondition(t,Condition(function thistype.checkSpell))
set t = null
endmethod
endmodule
struct vampiricAttack extends array
private static integer array lvl
implement vampiricAttack
private static method checkSpell takes nothing returns boolean
local unit u = null
local player p = null
if GetLearnedSkill()==SPELL_RAWCODE() then
set u = GetTriggerUnit()
set p = GetOwningPlayer(u)
set thistype.lvl[GetPlayerId(p)] = SPELL_CHANCE_FACTOR(GetUnitAbilityLevel(u,GetLearnedSkill()))
if SPELL_DEBUG()>0 and SPELL_DEBUG()<2 then
call BJDebugMsg("O |c00ff3300Debug Mode|r está ativado: Você precisa de um "+I2S(thistype.lvl[GetPlayerId(p)])+"% ou menos para ativar a spell.")
endif
set p = null
set u = null
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.checkSpell))
set t = null
endmethod
endstruct
- Open Source: pode ser aberto com o 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).
Última edição por Gilgamesh em Dom Jul 07, 2013 4:25 am, editado 22 vez(es)