Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


2 participantes

    Spell invulnerável

    thales12
    thales12
    Membro de Honra
    Membro de Honra


    Mensagens : 322
    Créditos : 108

    Ficha do personagem
    Nível: 1
    Experiência:
    Spell invulnerável Left_bar_bleue0/0Spell invulnerável Empty_bar_bleue  (0/0)
    Vida:
    Spell invulnerável Left_bar_bleue30/30Spell invulnerável Empty_bar_bleue  (30/30)

    Spell invulnerável Empty Spell invulnerável

    Mensagem por thales12 Sáb maio 13, 2023 3:09 pm

    Bom desde setembro do ano passado que não posto nada, então vou trazer um sistema simples de magia para vocês ♥♥♥

    OBS: Duração da spell é definida pela ScrlDuration

    no Client~Side abra a frmEditor_Spell e na CmbType em List adicione "Invulnerable"

    depois no código procure por: 

    Código:
    Public Const SPELL_TYPE_WARP As Byte = 4

    abaixo adicione:

    Código:
    Public Const SPELL_TYPE_INVULNERABLE As Byte = 5

    Agora vamos para o Server~Side e procure por:

    Código:
    Public Const SPELL_TYPE_WARP As Byte = 4

    abaixo adicione:

    Código:
    Public Const SPELL_TYPE_INVULNERABLE As Byte = 5

    procure por: Public Type TempPlayerRec dentro dela antes do end type adicione: 

    Código:
    Invulnerable As Long

    depois procure na Sub ServerLoop por:

    Código:
    ' HoT and DoT logic
                        For x = 1 To MAX_DOTS
                            HandleDoT_Player i, x
                            HandleHoT_Player i, x
                        Next

    abaixo adicione:

    Código:
    If TempPlayer(i).Invulnerable > 0 Then
                            If Tick > TempPlayer(i).Invulnerable Then
                                TempPlayer(i).Invulnerable = 0
                                AcabarInvulnerable i
                            End If
                        End If

    na Sub NpcAttackPlayer abaixo de:

    Código:
    ' Check for subscript out of range
        If MapNpc(GetPlayerMap(victim)).Npc(mapNpcNum).Num <= 0 Then
            Exit Sub
        End If

    adicione:

    Código:
    If TempPlayer(victim).Invulnerable > 0 Then
           SendActionMsg GetPlayerMap(victim), "INVULNERABLE", Yellow, 1, GetPlayerX(victim) * 32, GetPlayerY(victim) * 32
           Damage = 0
           Exit Sub
        End If

    Procure por:

    Código:
    Case 1, 3 ' self-cast AOE & targetted AOE

    acima do end select adicione:

    Código:
    Case SPELL_TYPE_INVULNERABLE
                        If Not TempPlayer(index).Invulnerable > 0 Then
                            TempPlayer(index).Invulnerable = GetTickCount + Spell(index).Duration * 1000
                            SendActionMsg GetPlayerMap(index), "INVULNERABLE ATIVADO", Yellow, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32)
                            SendAnimation GetPlayerMap(index), Spell(SpellNum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, index
                        End If
                       DidCast = True

    No final da modGameLogic adicione:

    Código:
    Public Sub AcabarInvulnerable(ByVal index As Long)
    If index < 1 Or index > MAX_PLAYERS Then Exit Sub
    SendActionMsg GetPlayerMap(index), "INVULNERABLE ACABOU", Yellow, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32)
    TempPlayer(index).Invulnerable = 0
    SendPlayerData index
    End Sub

    depois só usar e ser feliz ♥

    Créditos: Thales12 Sistema & Tutorial


    _________________
    Meu fã ? Meu Amigo ? Entao Use !

    Spell invulnerável Thalesfan
    Spell invulnerável Mv0yg8

    Minha Sign:

    Spell invulnerável Zkqt5e

    Kotol, Uchiha ~ e Sonart gostam desta mensagem

    Kotol
    Kotol
    Moderador Local
    Moderador Local


    Mensagens : 74
    Créditos : 16

    Spell invulnerável Empty Re: Spell invulnerável

    Mensagem por Kotol Sáb maio 13, 2023 4:58 pm

    Muito bom o sistema! Continue assim!  Very Happy

      Data/hora atual: Qua maio 08, 2024 9:47 am