MMORPG Brasil
Ola, visitante! Agradecemos sua visita, para ter acesso a todo nosso conteúdo recomendamos que faça um cadastro no fórum, com ele você pode participar de tópicos e ter acesso a todas áreas da comunidade!

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

MMORPG Brasil
Ola, visitante! Agradecemos sua visita, para ter acesso a todo nosso conteúdo recomendamos que faça um cadastro no fórum, com ele você pode participar de tópicos e ter acesso a todas áreas da comunidade!
MMORPG Brasil
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

[TUTO]Animação De Projeteis,Linear

3 participantes

Ir para baixo

[TUTO]Animação De Projeteis,Linear Empty [TUTO]Animação De Projeteis,Linear

Mensagem por Monotoshi Qui 28 Fev 2013, 17:28

Começando Cliente~side

Primeiramente
vá ao frmEditor_Spell e encontre a ComboBox chamada "cmbType" e,
adicione na list "Projetel".A list fica nas propriedades da Form.

Agora você clica duas vezes na "cmbType" e Adicione o seguinte code:

Código:
If cmbType.text = "Projetel" Then
scrlRange.Value = 0
chkAOE.Value = 1
End If

No modConstant procure por:

Código:
Public Const SPELL_TYPE_WARP As Byte = 4

E logo abaixo coloque:

Código:
Public Const SPELL_TYPE_PROJETEL As Byte = 5

Server Side

No modConstant procure por:

Código:
Public Const SPELL_TYPE_WARP As Byte = 4

Código:
Public Const SPELL_TYPE_PROJETEL As Byte = 5

Agora vá ao modCombat e no castspell procure por:

Código:
find out what kind of spell it is! self cast, target or AOE

E acima dessa linha adicione:

Código:
With Spell(Spellnum)
            If .Type = SPELL_TYPE_PROJETEL Then
                InUseProjetel Index, SpellNum
                Exit Sub
            End If
        End With

Ainda no modCombat você adiciona no Final dele:

Código:
Sub InUseProjetel(ByVal Index as Integer, ByVal SpellNum as Long)
        Dim I As Integer
        Dim Calculate As Long
        Dim Mapa As Long
        Mapa = GetPlayerMap(Index)

        I = 1
        Do While I < Spell(SpellNum).AoE

            Select Case GetPlayerDir(Index)

                Case Dir_Up
                    Calculate = GetPlayerY(Index) - I
                    If Calculate <= 0 Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index), GetPlayerY(Index) - I).Type = Tile_Type_Blocked Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index), GetPlayerY(Index) - I

                Case Dir_Down
                    Calculate = GetPlayerY(Index) + I
                    If Calculate >= Map(I).MaxY Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index), GetPlayerY(Index) + I).Type = Tile_Type_Blocked Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index), GetPlayerY(Index) + I

                Case Dir_Left
                    Calculate = GetPlayerX(Index) - I
                    If Calculate <= 0 Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index) - I, GetPlayerY(Index)).Type = Tile_Type_Blocked Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index) - I, GetPlayerY(Index)

                Case Dir_Right
                    Calculate = GetPlayerX(Index) + I
                    If Calculate >= Map(I).MaxX Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index) + I, GetPlayerY(Index)).Type = Tile_Type_Blocked Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index) + I, GetPlayerY(Index)
            End Select
            I = I + 1
        Loop
    End Sub

    Function IsUseProjetel(ByVal Index As Integer, ByVal SpellNum As
Integer, ByVal Mapa As Integer, ByVal X As Byte, ByVal Y As Byte)
        Dim I As Long

        SendAnimation Mapa, Spell(SpellNum).SpellAnim, X, Y

        'Loop Global Npc
        For I = 1 To MAX_MAP_NPCS
            If MapNpc(Mapa).Npc(I).Num > 0 And MapNpc(Mapa).Npc(I).X =
 X And MapNpc(Mapa).Npc(I).Y = Y And MapNpc(Mapa).Npc(I).Vital(HP) > 0
 Then PlayerAttackNpc Index, I, Spell(SpellNum).Vital, SpellNum
        Next

        'Loop Global Player
        For I = 1 To Player_HighIndex
            If GetPlayerMap(I) = Mapa And GetPlayerX(I) = X And
GetPlayerY(I) = Y Then PlayerAttackPlayer Index, I,
Spell(SpellNum).Vital, SpellNum
        Next
    End Function

Talvez se der um bug faça:

No ~Server-Side~ dê CTRL+ F ou em "Mod Constants" procure pelo código:

Código:
Case DIR_RIGHT
                    Calculate = GetPlayerX(Index) + I
                    If Calculate <= 0 Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index) +I , GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index) + I, GetPlayerY(Index)


E Após ter achado, mude toda essa 'Case' para esta:

Código:
Case DIR_RIGHT
                    Calculate = GetPlayerX(Index) + I
                    If Calculate <= 0 Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index) + I, GetPlayerY(Index)

Testar o Sistema!
Depois que terminar essa parte,teste para ver se pegou para todas as direções corretamente,se não pegar continue o tutorial:


Ainda no Server~Side.Procure por no "ModCombat":

Código:
Sub InUseProjetel(ByVal Index As Integer, ByVal SpellNum As Long)

E substitua toda a "Sub" por:

Código:
Sub InUseProjetel(ByVal Index As Integer, ByVal SpellNum As Long)
        Dim I As Integer
        Dim Calculate As Long
        Dim Mapa As Long
        Mapa = GetPlayerMap(Index)

        I = 1
        Do While I < Spell(SpellNum).AoE

            Select Case GetPlayerDir(Index)

                Case DIR_UP
                    Calculate = GetPlayerY(Index) - I
                    If Calculate <= 0 Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index), GetPlayerY(Index) - I).Type = TILE_TYPE_BLOCKED Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index), GetPlayerY(Index) - I

                Case DIR_DOWN
                    Calculate = GetPlayerY(Index) + I
                    If Calculate <= 0 Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index), GetPlayerY(Index) + I).Type = TILE_TYPE_BLOCKED Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index), GetPlayerY(Index) + I

                Case DIR_LEFT
                    Calculate = GetPlayerX(Index) - I
                    If Calculate <= 0 Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index) - I, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index) - I, GetPlayerY(Index)

                Case DIR_RIGHT
                    Calculate = GetPlayerX(Index) + I
                    If Calculate <= 0 Then Exit Sub
                    If Map(Mapa).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub
                    IsUseLinear Index, SpellNum, Mapa, GetPlayerX(Index) + I, GetPlayerY(Index)
            End Select
            I = I + 1
        Loop
    End Sub

Tente compilar agora,se não funfar prossiga o tutorial se não só testar!

Procure por:

Código:
SPELL_TYPE_WARP

E delete toda essa parte.Testado e aprovado.Qualquer dúvida só postar.

Créditos:
Blizzard.(Peguei o tuto dele e fiz umas mudanças)
Kaue.
avatar
Monotoshi
Membro Vitalicio
Membro Vitalicio

Mensagens : 591

Ir para o topo Ir para baixo

[TUTO]Animação De Projeteis,Linear Empty Re: [TUTO]Animação De Projeteis,Linear

Mensagem por afonsobr Sáb 02 Mar 2013, 13:11

o/
Obrigado por compartilhar.
Qual era o script original do Blizzard? E o que você adicionou nele? xP Só para saber mesmo u_u
avatar
afonsobr
Membro Veterano
Membro Veterano

Mensagens : 1196

http://digimongames.forumeiros.com/

Ir para o topo Ir para baixo

[TUTO]Animação De Projeteis,Linear Empty Re: [TUTO]Animação De Projeteis,Linear

Mensagem por Blizzard Sáb 02 Mar 2013, 20:18

2 coisas...
- Projetel? WTF? e.e
- Plágio...Talvez...Não de mim,mas dos que fizeram o tutorial.

Enfim,isso é mais um sistema de spell linear que você mudou o nome.
E ponha o nome dos que fizeram o tutorial,se encontra no tópico de que retirou.Os créditos não são nem meus e nem tão pouco seus.Por favor,ponha os devidos créditos.


Você tem 24 horas.
Blizzard
Blizzard
Membro Vitalicio
Membro Vitalicio

Mensagens : 603

Ir para o topo Ir para baixo

[TUTO]Animação De Projeteis,Linear Empty Re: [TUTO]Animação De Projeteis,Linear

Mensagem por Conteúdo patrocinado


Conteúdo patrocinado


Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

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