DotCastle BR™

[Spell] Attack Boost Lion_shield
Olá Visitante!, seja bem-vindo ao fórum oficial DotCastle BR™️.

Nosso fórum é dedicado á criadores e editores de mapas para Warcraft III através do World Editor.

Aqui você encontrará spells, systems, tutoriais e muito mais ao alcance de um clique.

Conecte-se agora mesmo para acessar livremente o nosso conteúdo.

Nossos 35 usuários já postaram um total de 92 mensagens.


Participe do fórum, é rápido e fácil

DotCastle BR™

[Spell] Attack Boost Lion_shield
Olá Visitante!, seja bem-vindo ao fórum oficial DotCastle BR™️.

Nosso fórum é dedicado á criadores e editores de mapas para Warcraft III através do World Editor.

Aqui você encontrará spells, systems, tutoriais e muito mais ao alcance de um clique.

Conecte-se agora mesmo para acessar livremente o nosso conteúdo.

Nossos 35 usuários já postaram um total de 92 mensagens.
DotCastle BR™
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
DotCastle BR™

Conecte-se e apresente-se para receber 25 pontos!
Nossos 35 usuários já postaram o total de 92 mensagens!
O DotCastle BR™ está ativo a 3969 dias.
Ei Convidado, você postou 0 de 92 mensagens!
Participe postando suas dúvidas. Compartilhe seus projetos. O DotCastle BR™ tem prazer em ajudar!
Não deixe de conferir as regras do fórum.

Você não está conectado. Conecte-se ou registre-se

[Spell] Attack Boost

Ir para baixo  Mensagem [Página 1 de 1]

1[Spell] Attack Boost Empty [Spell] Attack Boost Qua Jul 10, 2013 8:28 pm

Hisoka

Hisoka
Administrador
Administrador

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):
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
Corpo do Script:
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
Notas:
 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.
[Spell] Attack Boost 10_07_2013_18_59_49
 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).

https://dotcastlebr.forumeiros.com

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos