Descrição da Spell:
O herói encanta sua arma com uma força mística, ativando algumas habilidades ocultas durante algum tempo ou durante certa quantidade de ataques.
Plataforma da Spell:
vJass
Requisitos:
JNGP (Jass New Generation Pack) v5d
USMWE v5
Setup (JESP):
O campo destacado de amarelo na imagem abaixo indica quantos e quais buffs serão usados na spell, tendo como limite o número 3. Já os campos em verde servem para definir quais buffs estarão disponíveis.
Altere o valor conforme sua necessidade. Se desejar adicionar apenas o primeiro buff, utilize 1. Se desejar adicionar o primeiro e o segundo buff, utilize 2. Se desejar adicionar os três buffs, utilize 3.
-----
Download (Demo Map)
- 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).
O herói encanta sua arma com uma força mística, ativando algumas habilidades ocultas durante algum tempo ou durante certa quantidade de ataques.
Plataforma da Spell:
vJass
Requisitos:
JNGP (Jass New Generation Pack) v5d
USMWE v5
Setup (JESP):
- Código:
module MiscBoostSetup
public static constant method SPELL_RAWCODE takes nothing returns integer
return 'A003'
endmethod
public static constant method BUFF_RAWCODE takes nothing returns integer
return 'B000'
endmethod
public static constant method AMOUNT_OF_BUFFS takes nothing returns integer
return 3
endmethod
public static constant method DUMMY_SPELL_RAWCODE_01 takes nothing returns integer
return 'A000'
endmethod
public static constant method DUMMY_SPELL_RAWCODE_02 takes nothing returns integer
return 'A001'
endmethod
public static constant method DUMMY_SPELL_RAWCODE_03 takes nothing returns integer
return 'A002'
endmethod
public static method ATTACK_AMOUNT_FACTOR takes integer level returns integer
return 3 + (level * 2)
endmethod
endmodule
- Código:
module MiscBoostAttack
private static method checkAttacks takes nothing returns boolean
local unit u = GetAttacker()
local player p = null
local integer i = 0
if GetUnitAbilityLevel(u,BUFF_RAWCODE())>0 then
set p = GetOwningPlayer(u)
set attacks[GetPlayerId(p)] = attacks[GetPlayerId(p)] - 1
if attacks[GetPlayerId(p)] == 0 then
if AMOUNT_OF_BUFFS()==1 then
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_01())
call UnitRemoveAbility(u,BUFF_RAWCODE())
elseif AMOUNT_OF_BUFFS()==2 then
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_01())
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_02())
call UnitRemoveAbility(u,BUFF_RAWCODE())
elseif AMOUNT_OF_BUFFS()==3 then
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_01())
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_02())
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_03())
call UnitRemoveAbility(u,BUFF_RAWCODE())
endif
endif
set p = null
endif
set u = 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.checkAttacks))
set t = null
endmethod
endmodule
struct MiscBoost extends array
implement MiscBoostSetup
implement MiscBoostAttack
private static integer array attacks
private static hashtable hash = InitHashtable()
private static method checkAvailable takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(hash,GetHandleId(t),StringHash("caster"))
local player p = GetOwningPlayer(u)
if GetUnitAbilityLevel(u,BUFF_RAWCODE())==0 then
if AMOUNT_OF_BUFFS()==1 then
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_01())
elseif AMOUNT_OF_BUFFS()==2 then
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_01())
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_02())
elseif AMOUNT_OF_BUFFS()==3 then
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_01())
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_02())
call UnitRemoveAbility(u,DUMMY_SPELL_RAWCODE_03())
endif
set attacks[GetPlayerId(p)] = 0
call FlushChildHashtable(hash,GetHandleId(t))
call PauseTimer(t)
call DestroyTimer(t)
endif
set u = null
set t = null
endmethod
private static method SetSpellLevel takes unit un,integer in,integer in2 returns nothing
call UnitAddAbility(un,in)
call SetUnitAbilityLevel(un,in,in2)
endmethod
private static method checkSpell takes nothing returns boolean
local unit u = null
local player p = null
local integer i = 0
local timer t = null
if GetSpellAbilityId()==SPELL_RAWCODE() then
set u = GetTriggerUnit()
set p = GetOwningPlayer(u)
set i = GetUnitAbilityLevel(u,GetSpellAbilityId())
set t = CreateTimer()
call SaveUnitHandle(hash,GetHandleId(t),StringHash("caster"),u)
if AMOUNT_OF_BUFFS()==1 then
call SetSpellLevel(u,DUMMY_SPELL_RAWCODE_01(),i)
elseif AMOUNT_OF_BUFFS()==2 then
call SetSpellLevel(u,DUMMY_SPELL_RAWCODE_01(),i)
call SetSpellLevel(u,DUMMY_SPELL_RAWCODE_02(),i)
elseif AMOUNT_OF_BUFFS()==3 then
call SetSpellLevel(u,DUMMY_SPELL_RAWCODE_01(),i)
call SetSpellLevel(u,DUMMY_SPELL_RAWCODE_02(),i)
call SetSpellLevel(u,DUMMY_SPELL_RAWCODE_03(),i)
endif
call TimerStart(t,.1,true,function thistype.checkAvailable)
set attacks[GetPlayerId(p)] = ATTACK_AMOUNT_FACTOR(i)
set t = null
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(274),null)
set i = i + 1
exitwhen i == 12
endloop
call TriggerAddCondition(t,Condition(function thistype.checkSpell))
set t = null
endmethod
endstruct
O campo destacado de amarelo na imagem abaixo indica quantos e quais buffs serão usados na spell, tendo como limite o número 3. Já os campos em verde servem para definir quais buffs estarão disponíveis.
Altere o valor conforme sua necessidade. Se desejar adicionar apenas o primeiro buff, utilize 1. Se desejar adicionar o primeiro e o segundo buff, utilize 2. Se desejar adicionar os três buffs, utilize 3.
-----
Download (Demo Map)
- 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).