[Spell] Attack Boost
2 participantes
Página 1 de 1
[Spell] Attack Boost
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).
Re: [Spell] Attack Boost
vjass no Team Kings? As coisas estão evoluindo por aqui.
Mas enfim, parabens pelo seu código gilgamesh, sem leak nenhum. Só achei estranho você usar functions para retornar valores constantes, você poderia ter declarados variáveis mesmo. Mas você deve ter seus motivos e isso não atrapalha em nada, deixa pra lá.
Creio que você deve conhecer os sistemas Table e CTL, mas penso que não usou eles para deixa essa magia sem dependências. certo?
enfim... +rep
Ah boa sorte com seu projeto =)
Mas enfim, parabens pelo seu código gilgamesh, sem leak nenhum. Só achei estranho você usar functions para retornar valores constantes, você poderia ter declarados variáveis mesmo. Mas você deve ter seus motivos e isso não atrapalha em nada, deixa pra lá.
Creio que você deve conhecer os sistemas Table e CTL, mas penso que não usou eles para deixa essa magia sem dependências. certo?
enfim... +rep
Ah boa sorte com seu projeto =)
Bills- Número de Posts : 1446
Data de inscrição : 04/12/2010
Reputação : 173 Pontos : 31089
Re: [Spell] Attack Boost
Grato pelo comentário camarada Bills...
O motivo de eu utilizar funções ao invés variáveis é por que aprendi assim nas aulas do Hive á um tempinho. Acredito que facilita a utilização dos leigos e também porque já acostumei. ")
Abraço...
O motivo de eu utilizar funções ao invés variáveis é por que aprendi assim nas aulas do Hive á um tempinho. Acredito que facilita a utilização dos leigos e também porque já acostumei. ")
Abraço...
Tópicos semelhantes
» [Spell] Vampiric Attack (GUI)
» (Spell Igui)Cold Feet,a spell do ancient do dota
» [Pedido de Spell] Preciso de uma Spell para meu map.
» [Spell] Toxic Laser Spell
» [Spell] Spell by Mustredi
» (Spell Igui)Cold Feet,a spell do ancient do dota
» [Pedido de Spell] Preciso de uma Spell para meu map.
» [Spell] Toxic Laser Spell
» [Spell] Spell by Mustredi
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|