DotCastle BR™

[Spell] Vampiric Attack 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] Vampiric Attack 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] Vampiric Attack

2 participantes

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

1[Spell] Vampiric Attack Empty [Spell] Vampiric Attack Qua Jul 03, 2013 10:56 pm

Hisoka

Hisoka
Administrador
Administrador

Dedicado ao TwistyCool 

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
Corpo do Script:
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
Download (Demo Map)
- 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)

https://dotcastlebr.forumeiros.com

2[Spell] Vampiric Attack Empty Re: [Spell] Vampiric Attack Qui Jul 04, 2013 6:57 pm

Twisty

Twisty
Peasant, Level 1
Peasant, Level 1

Coloca ai "Dedicado a Twisty" uashua , ta mto massa teu forum mano Smile ,eu queria poder ajudar a chamar mais gente , mais a net aqui nao deixa eu nem abrir direito a pagina do Google --' , tomara que bombe seu forum ai Very Happy

3[Spell] Vampiric Attack Empty Re: [Spell] Vampiric Attack Qui Jul 04, 2013 11:39 pm

Hisoka

Hisoka
Administrador
Administrador

Agradeço de coração parceiro... dedicatória adicionada! ")

https://dotcastlebr.forumeiros.com

Conteúdo patrocinado



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

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