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


5 participantes

    [EO] - Silenciar adversário

    newbie123
    newbie123
    Semi-Experiente
    Semi-Experiente


    Mensagens : 128
    Créditos : 35

    [EO] - Silenciar adversário Empty [EO] - Silenciar adversário

    Mensagem por newbie123 Seg Ago 15, 2016 7:22 pm

    Temos aqui um sistema bem simples, com o objetivo de que ao player ser atingido por tal skill, o mesmo fica silenciado, por seja não poderia usar nenhum poder por determinado tempo.(O poder não silencia NPC, só fazer editar de acordo com o sistema de NPC soltar spell, para que funcione também contra NPC.

    Abra o client.vbp e na frmEditor_spell crie uma scrollbar, e uma label com as seguintes propriedades:


    ScrollBar
    Name: scrlSilence

    Label
    Name: lblSilence
    Caption: Silence: Nenhum


    Agora de 2 cliques na scrlSilence e adicione:
    Código:
    ' If debug mode, handle error then exit out
        If Options.Debug = 1 Then On Error GoTo errorhandler

        If scrlSilence.Value > 0 Then
            lblSilence.Caption = "Silence: " & scrlSilence.Value & "s"
        Else
            lblSilence.Caption = "Silence: Nenhum"
        End If
        Spell(EditorIndex).Silence = scrlSilence.Value
        
        ' Error handler
        Exit Sub
    errorhandler:
        HandleError "scrlSilence_Change", "frmEditor_Spell", Err.Number, Err.Description, Err.Source, Err.HelpContext
        Err.Clear
        Exit Sub

    Aperte ctrl+F e agora pesquise na modEnumerations procure por:

    Código:
    SPartyVitals


    Abaixo coloque:

    Código:
    SSilence

    Agora na modGameEditors encontre:

    Código:
    .scrlStun.Value = Spell(EditorIndex).StunDuration

    Adicione abaixo:

    Código:
    .scrlSilence.Value = Spell(EditorIndex).Silence

    Agora na modGameLogic dentro da sub castspell procure:
    Código:
    If spellslot < 1 Or spellslot > MAX_PLAYER_SPELLS Then
            Exit Sub
        End If

    E coloque embaixo:

    Código:
    If Silence > 0 Then Exit Sub

    na Modglobals procure por:

    Código:
    Public StunDuration As Long

    Embaixo coloque:

    Código:
    Public Silence As Long

    na modHandledata procure:

    Código:
    HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals)

    E adicione embaixo:

    Código:
    HandleDataSub(SSilence) = GetAddress(AddressOf HandleSilence)

    Ainda na modHandledata procure por:
    Código:
    Private Sub HandleStunned(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer

        ' If debug mode, handle error then exit out
        If Options.Debug = 1 Then On Error GoTo errorhandler
        
        Set Buffer = New clsBuffer
        Buffer.WriteBytes Data()
        
        StunDuration = Buffer.ReadLong
        
        Set Buffer = Nothing
        
        ' Error handler
        Exit Sub
    errorhandler:
        HandleError "HandleStunned", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext
        Err.Clear
        Exit Sub
    End Sub

    E abaixo adicione:
    Código:
    Private Sub HandleSilence(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer

        ' If debug mode, handle error then exit out
        If Options.Debug = 1 Then On Error GoTo errorhandler
        
        Set Buffer = New clsBuffer
        Buffer.WriteBytes Data()
        
        Silence = Buffer.ReadLong
        
        Set Buffer = Nothing
        
        ' Error handler
        Exit Sub
    errorhandler:
        HandleError "HandleSilence", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext
        Err.Clear
        Exit Sub
    End Sub

    Na modType, na private type spellrec procure:

    Código:
    StunDuration As Long

    E embaixo coloque:

    Código:
    Silence As Long


    Acabamos no cliente, agora vamos para o Server.vbp


    No modCombat procure:
    Código:
    If spellnum > 0 Then
                If Spell(spellnum).StunDuration > 0 Then StunPlayer victim, spellnum
                ' DoT
                If Spell(spellnum).Duration > 0 Then
                    AddDoT_Player victim, spellnum, attacker
                End If
                End If
            End If



    E SUBSTITUA por:

    Código:
    If spellnum > 0 Then
                If Spell(spellnum).StunDuration > 0 Then StunPlayer victim, spellnum
                If Spell(spellnum).Silence > 0 Then SilencePlayer victim, spellnum
                ' DoT
                If Spell(spellnum).Duration > 0 Then
                    AddDoT_Player victim, spellnum, attacker
                End If
                End If
            End If

    Ainda na modCombat procure por:
    Código:
    Public Sub StunPlayer(ByVal index As Long, ByVal spellnum As Long)
        ' check if it's a stunning spell
        If Spell(spellnum).StunDuration > 0 Then
            ' set the values on index
            TempPlayer(index).StunDuration = Spell(spellnum).StunDuration
            TempPlayer(index).StunTimer = GetTickCount
            ' send it to the index
            SendStunned index
            ' tell him he's stunned
            PlayerMsg index, "You have been stunned.", BrightRed
        End If
    End Sub

    E coloque embaixo:
    Código:
    Public Sub SilencePlayer(ByVal index As Long, ByVal spellnum As Long)

        If Spell(spellnum).Silence > 0 Then
            
            TempPlayer(index).Silence = Spell(spellnum).Silence
            TempPlayer(index).SilenceTimer = GetTickCount
            
            SendSilence index
            
            PlayerMsg index, "Você foi silenciado.", BrightRed
        End If
    End Sub

    Agora na modEnumerations procure por:

    Código:
    SPartyVitals

    E adicione abaixo:

    Código:
    SSilence

    no modServerLoop procure:
    Código:
    If TempPlayer(i).StunDuration > 0 Then
                            If GetTickCount > TempPlayer(i).StunTimer + (TempPlayer(i).StunDuration * 1000) Then
                                TempPlayer(i).StunDuration = 0
                                TempPlayer(i).StunTimer = 0
                                SendStunned i
                            End If
                        End If

    Embaixo coloque:
    Código:
    If TempPlayer(i).Silence > 0 Then
                            If GetTickCount > TempPlayer(i).SilenceTimer + (TempPlayer(i).Silence * 1000) Then
                                TempPlayer(i).Silence = 0
                                TempPlayer(i).SilenceTimer = 0
                                SendSilence i
                            End If
                        End If

    no modServerTCP procure:
    Código:
    Sub SendStunned(ByVal index As Long)
        Dim Buffer As clsBuffer
        
        Set Buffer = New clsBuffer
        Buffer.WriteLong SStunned
        Buffer.WriteLong TempPlayer(index).StunDuration
        
        SendDataTo index, Buffer.ToArray()
        
        Set Buffer = Nothing
    End Sub

    E adicione embaixo:
    Código:
    Sub SendSilence(ByVal index As Long)
        Dim Buffer As clsBuffer
        
        Set Buffer = New clsBuffer
        Buffer.WriteLong SSilence
        Buffer.WriteLong TempPlayer(index).Silence
        
        SendDataTo index, Buffer.ToArray()
        
        Set Buffer = Nothing
    End Sub

    Agora na modTypes dentro da Public Type TempPlayerRec, procure por:

    Código:
    StunDuration As Long

    E embaixo adicione:
    Código:
    SilenceTimer As Long
        Silence As Long

    Pronto, agora o sistema esta completo, qualquer duvida ou erro poste abaixo...

    Creditos ~ Newbie123
    Hashirama
    Hashirama
    Membro de Honra
    Membro de Honra


    Mensagens : 413
    Créditos : 133

    [EO] - Silenciar adversário Empty Re: [EO] - Silenciar adversário

    Mensagem por Hashirama Ter Ago 16, 2016 5:41 pm

    Não testei ainda, mas vou dar 1+crédito por ainda ajudar com sistemas pro EO
    =D


    _________________
    Apoia nosso projeto? use nossa assinatura
    Profane ~
    Profane ~
    Colaborador
    Colaborador


    Mensagens : 818
    Créditos : 130

    [EO] - Silenciar adversário Empty Re: [EO] - Silenciar adversário

    Mensagem por Profane ~ Qua Ago 17, 2016 5:06 am

    Excelente Movimentação Newbie123.

    Interessante e poderá ajudar a muitos : 3


    _________________
    "Mistress of shattered hopes and forever broken dreams"
    Kies
    Kies
    Diva
    Diva


    Mensagens : 1154
    Créditos : 124

    Ficha do personagem
    Nível: 1
    Experiência:
    [EO] - Silenciar adversário Left_bar_bleue0/0[EO] - Silenciar adversário Empty_bar_bleue  (0/0)
    Vida:
    [EO] - Silenciar adversário Left_bar_bleue30/30[EO] - Silenciar adversário Empty_bar_bleue  (30/30)

    [EO] - Silenciar adversário Empty Re: [EO] - Silenciar adversário

    Mensagem por Kies Qua Ago 17, 2016 2:47 pm

    Nossa man adorei o siatema, não testei ainda pois to sem PC mais assim que eu pegar ele de volta eu testo, esse sistema é muito bom no pvp
    Spooky
    Spooky
    Membro Ativo
    Membro Ativo


    Mensagens : 267
    Créditos : 24

    [EO] - Silenciar adversário Empty Re: [EO] - Silenciar adversário

    Mensagem por Spooky Sáb Ago 20, 2016 11:58 am

    Opa, vlw pela contribuição, Newbie, é um sistema bastante interessante e dá pra fazer diversas modificações... +1 cred


    _________________
    Sign
    [EO] - Silenciar adversário Hticjn

    Sign¹:

    Sign²:

    Conteúdo patrocinado


    [EO] - Silenciar adversário Empty Re: [EO] - Silenciar adversário

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Sex Jul 26, 2024 11:12 pm