Life RPG Maker 2.0
Bem vindo a LRM, forum de ajuda Maker
Registre-se em nosso forum e aproveite Very Happy
esperamos que você seja ajudado e esperamos que nos ajude Very Happy

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

Life RPG Maker 2.0
Bem vindo a LRM, forum de ajuda Maker
Registre-se em nosso forum e aproveite Very Happy
esperamos que você seja ajudado e esperamos que nos ajude Very Happy
Life RPG Maker 2.0
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Life RPG Maker 2.0

2ª versão do forum life rpg maker

Os membros mais ativos do mês
Nenhum usuário

Últimos assuntos
» Kingdon 1.6
[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc) EmptyTer Jun 09, 2015 3:02 pm por MasterKill

» Tempo dinâmico e Hora do Sistema
[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc) EmptySeg Dez 09, 2013 5:42 pm por jonathas

» Sistema de Natação
[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc) EmptySáb Dez 07, 2013 5:14 pm por jonathas

» Classificar Inventario
[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc) EmptySáb Dez 07, 2013 12:07 pm por Samuka_Adm

» VOLTEI ALELUIA :D
[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc) EmptySáb Dez 07, 2013 10:35 am por Samuka_Adm

» Netplay Master v4.0.7
[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc) EmptyQua Jun 26, 2013 1:32 pm por xdario

» The League Of War [Season 1]
[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc) EmptySex Jan 18, 2013 6:02 pm por Warrior

» Meu primeiro desenho que posto :D
[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc) EmptyQua Jan 09, 2013 1:37 pm por PedroMatoso

» Window Configurações
[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc) EmptyQua Jan 09, 2013 1:36 pm por PedroMatoso

Parceiros
Fórum grátis

Fórum grátis


Mundo RPG Maker
MMORPG BRASIL

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

[EO] Spell Linear Completo (Subtrair MP, CastTime, Cooldown e etc)

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

Samuka_Adm

Samuka_Adm
Admin
Admin

Fala galera!

esse é o meu primeiro tutorial, baseado no tutorial do @LythZerou.

Bem, o problema era o seguinte: Meu sistema de spells é um pouco mais complexo, com level nas spells, e a cada level que a spell aumenta, ela aumenta o dano, mas aumenta também o MP requerido para utilizá-la.
Com esse tutorial de spell Linear, além de não conseguir usar o MP, o dano permanecia o mesmo, independente do level da spell. Daí ficava meio sem sentido.

PS: Não me responsabilizo por instabilidades ou problemas no seu source após o tutorial aqui citado. A execução do código fica por sua conta e risco! (não estou dizendo que vá dar problemas, mas é para evitar reclamações infundadas).

Vamos ao código

Client Side

Primeiro, vá ao frmEditor_Spell e encontre a ComboBox chamada "cmbType", nas propriedades, vá até "list" e adicione "Linear".

Após o procedimento acima, clique 2x na cmbType e procure o seguinte código:

Código:
Spell(EditorIndex).Type = cmbType.ListIndex

abaixo, adicione

Código:

If cmbType.text = "Linear" Then
        scrlRange.Value = 0
        chkAOE.Value = 1
    End If

No modConstants procure por

Código:
Public Const SPELL_TYPE_WARP As Byte = 4

abaixo, adicione

Código:
Public Const SPELL_TYPE_LINEAR As Byte = 5

Client terminado.

Server Side

No modConstants procure por

Código:
Public Const SPELL_TYPE_WARP As Byte = 4

abaixo, adicione

Código:
Public Const SPELL_TYPE_LINEAR As Byte = 5

Agora, no sub CastSpell, procure por

Código:
Dim x As Long, y As Long

abaixo, adicione

Código:
Dim x2 As Long, y2 As Long
Dim Linha As Integer
Dim Calculate As Long

procure por

Código:
End Select
        Case 2 ' targetted

acima disso, adicione

Código:
                    Case SPELL_TYPE_LINEAR
                        DidCast = True
                        Linha = 1
                        Do While Linha < Spell(SpellNum).AoE
               
                            Select Case GetPlayerDir(Index)
               
                                Case DIR_UP
                                    Calculate = GetPlayerY(Index) - Linha
                                    If Calculate <= 0 Then Exit Sub
                                    If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - Linha).Type = TILE_TYPE_BLOCKED Then Exit Sub
                                    SendAnimation GetPlayerMap(Index), Spell(SpellNum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) - Linha
                                    IsUseLinear Index, SpellNum, vital, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index) - Linha
                                   
                                Case DIR_DOWN
                                    Calculate = GetPlayerY(Index) + Linha
                                    If Calculate >= Map(Linha).MaxY Then Exit Sub
                                    If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + Linha).Type = TILE_TYPE_BLOCKED Then Exit Sub
                                    SendAnimation GetPlayerMap(Index), Spell(SpellNum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) + Linha
                                    IsUseLinear Index, SpellNum, vital, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index) + Linha
                                Case DIR_LEFT
                                    Calculate = GetPlayerX(Index) - Linha
                                    If Calculate <= 0 Then Exit Sub
                                    If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - Linha, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub
                                    SendAnimation GetPlayerMap(Index), Spell(SpellNum).SpellAnim, GetPlayerX(Index) - Linha, GetPlayerY(Index)
                                    IsUseLinear Index, SpellNum, vital, GetPlayerMap(Index), GetPlayerX(Index) - Linha, GetPlayerY(Index)
                                Case DIR_RIGHT
                                    Calculate = GetPlayerX(Index) + Linha
                                    If Calculate <= 0 Then Exit Sub
                                    If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub
                                    SendAnimation GetPlayerMap(Index), Spell(SpellNum).SpellAnim, GetPlayerX(Index) + Linha, GetPlayerY(Index)
                                    IsUseLinear Index, SpellNum, vital, GetPlayerMap(Index), GetPlayerX(Index) + Linha, GetPlayerY(Index)
                            End Select
                          Linha = Linha + 1
                        Loop

Agora, no final do modCombat, adicione

Código:
    Function IsUseLinear(ByVal Index As Integer, ByVal SpellNum As Integer, ByVal vital As Long, ByVal Mapa As Integer, ByVal x As Byte, ByVal y As Byte)
        Dim i As Long

        '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, 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, vital, SpellNum
        Next
    End Function

ATENÇÃO: esse Sub é DIFERENTE do sub disponibilizado no outro tutorial. Não confunda as coisas, poderá ter problemas.

Bem, é isso, testem e qualquer dúvida, responder AQUI, assim que possível tentarei solucionar seu problema.

Créditos: LythZerou pelo tutorial, V-force pelo código inicial, e créditos a mim, por complementar o código,Samuka_Maker por postar na LRM

https://liferpgmakerv2.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