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


3 participantes

    Resetar Status Por Item

    Mizuki
    Mizuki
    Iniciante
    Iniciante


    Mensagens : 30
    Créditos : 4

    Ficha do personagem
    Nível: 1
    Experiência:
    Resetar Status Por Item Left_bar_bleue0/0Resetar Status Por Item Empty_bar_bleue  (0/0)
    Vida:
    Resetar Status Por Item Left_bar_bleue30/30Resetar Status Por Item Empty_bar_bleue  (30/30)

    Resetar Status Por Item Empty Resetar Status Por Item

    Mensagem por Mizuki Sáb Ago 11, 2018 1:03 am

    Ola pessoal blz então meu primeiro tuto aqui
    eu vi esse tutorial aqui porem ele estava
    meio zuado e faltando algumas coisas
    então venho aqui posta ele mais 
    arrumadinho espero que gostem

    vamos la Indignity

    Cliente side

      em modConstants Abaixo de:
    Código:
    Public Const ITEM_TYPE_SPELL As Byte = 8

    Coloque:
    Código:
    Public Const ITEM_TYPE_STAT_RESET As Byte = 9

    Em frmEditor_Item no cmbType's list adicionar na list   ResetarStatus

    Serve side:

    abaixo de :
    Código:
    Public Const ITEM_TYPE_SPELL As Byte = 8

    colocar:
    Código:
    Public Const ITEM_TYPE_STAT_RESET As Byte = 9

    Em modPlayer na sub UseItem 

    abaixo de:
    Código:
     Case ITEM_TYPE_SPELL
     
     ' stat requirements
     For i = 1 To Stats.Stat_Count - 1
     If GetPlayerRawStat(index, i) < Item(itemnum).Stat_Req(i) Then
                            PlayerMsg index, "You do not meet the stat requirements to use this item.", BrightRed
                            Exit Sub
                        End If
                    Next
                    
                    ' level requirement
                    If GetPlayerLevel(index) < Item(itemnum).LevelReq Then
                        PlayerMsg index, "You do not meet the level requirement to use this item.", BrightRed
                        Exit Sub
                    End If
                    
                    ' class requirement
                    If Item(itemnum).ClassReq > 0 Then
                        If Not GetPlayerClass(index) = Item(itemnum).ClassReq Then
                            PlayerMsg index, "You do not meet the class requirement to use this item.", BrightRed
                            Exit Sub
                        End If
                    End If
                    
                    ' access requirement
                    If Not GetPlayerAccess(index) >= Item(itemnum).AccessReq Then
                        PlayerMsg index, "You do not meet the access requirement to use this item.", BrightRed
                        Exit Sub
                    End If
                    
                    ' Get the spell num
                    n = Item(itemnum).Data1

                    If n > 0 Then

                        ' Make sure they are the right class
                        If Spell(n).ClassReq = GetPlayerClass(index) Or Spell(n).ClassReq = 0 Then
                            ' Make sure they are the right level
                            i = Spell(n).LevelReq

                            If i <= GetPlayerLevel(index) Then
                                i = FindOpenSpellSlot(index)

                                ' Make sure they have an open spell slot
                                If i > 0 Then

                                    ' Make sure they dont already have the spell
                                    If Not HasSpell(index, n) Then
                                        Call SetPlayerSpell(index, i, n)
                                        Call SendAnimation(GetPlayerMap(index),Item itemnum).Animation, 0, 0, TARGET_TYPE_PLAYER, index)
                                        Call TakeInvItem(index, itemnum, 0)
                                        Call PlayerMsg(index, "You feel the rush of knowledge fill your mind. You can now use " & Trim$(Spell(n).Name) & ".", BrightGreen)
                                    Else
                                        Call PlayerMsg(index, "You already have knowledge of this skill.", BrightRed)
                                    End If

                                Else
                                    Call PlayerMsg(index, "You cannot learn any more skills.", BrightRed)
                                End If

                            Else
                                Call PlayerMsg(index, "You must be level " & i & " to learn this skill.", BrightRed)
                            End If

                        Else
                            Call PlayerMsg(index, "This spell can only be learned by " & CheckGrammar(GetClassName(Spell(n).ClassReq)) & ".", BrightRed)
                        End If
                    End If
                    
                    ' send the sound
                    SendPlayerSound index, GetPlayerX(index), GetPlayerY(index), SoundEntity.seItem, itemnum

    antes do end select adicione:
    Código:
    Case ITEM_TYPE_STAT_RESET
                
                If GetPlayerResets(Index) >= 1 Then
                    filename = App.Path & "\data\classes.ini"
                        
                    Call SetPlayerStat(Index, Agility, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Agility")))
                    Call SetPlayerStat(Index, Strength, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Strength")))
                    Call SetPlayerStat(Index, Intelligence, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Intelligence")))
                    Call SetPlayerStat(Index, Endurance, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Endurance")))
                    Call SetPlayerStat(Index, Willpower, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Willpower")))
                    
                    If Not GetPlayerPOINTS(Index) > 0 Then
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))
                    Else
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))
                    End If
                        
                    Call TakeInvItem(Index, Player(Index).Inv(invNum).Num, 0)
                        
                    ' send the sound
                    SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, itemnum
                    
                    Call PlayerMsg(Index, "Seus Pontos foram Resetados!", BrightGreen)
            
                 Else
                       Call PlayerMsg(Index, "Você deve ter mais de 1 reset para reseta seus status!", BrightRed)
                 End If


    lembrando que esse codigo ai e pra que ja tem reset em seu projeto caso queiram
    usar so pra level e so altera ali em
    Código:
    If Not GetPlayerPOINTS(Index) > 0 Then
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))
                    Else
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))
                    End If

    dareis os creditos as pessoas que foram citadas no outro tutorial ja que não sei a origem certa dele

    Créditos:
    - Helling 
    por postar
    - mmearrccii 
    por fazer
    -a mim por arruma e corrigir ele


    _________________
    vem sempre aqui?  I love you
    Profane ~
    Profane ~
    Colaborador
    Colaborador


    Mensagens : 818
    Créditos : 130

    Resetar Status Por Item Empty Re: Resetar Status Por Item

    Mensagem por Profane ~ Sáb Ago 11, 2018 2:05 pm

    Hoje uma alma se salvou.

    Bom tuto, não testado mas espero que funfe gg UASuhs < 3


    _________________
    "Mistress of shattered hopes and forever broken dreams"
    marccvz
    marccvz
    Novato
    Novato


    Mensagens : 29
    Créditos : 1

    Resetar Status Por Item Empty Re: Resetar Status Por Item

    Mensagem por marccvz Qui Ago 16, 2018 1:13 pm

    Tenta usa uma vez e depois que uso e reseto não add pontos e usa dinovo kkkkk vc vai ver um bug kkkkkkkkk
    Mizuki
    Mizuki
    Iniciante
    Iniciante


    Mensagens : 30
    Créditos : 4

    Ficha do personagem
    Nível: 1
    Experiência:
    Resetar Status Por Item Left_bar_bleue0/0Resetar Status Por Item Empty_bar_bleue  (0/0)
    Vida:
    Resetar Status Por Item Left_bar_bleue30/30Resetar Status Por Item Empty_bar_bleue  (30/30)

    Resetar Status Por Item Empty Re: Resetar Status Por Item

    Mensagem por Mizuki Dom Ago 19, 2018 10:05 pm

    sim eu percebi esse erro que acumula os pontos caso vc use de novo estou tentando resolver isso ainda assim que arruma vou posta a correção aqui


    _________________
    vem sempre aqui?  I love you
    marccvz
    marccvz
    Novato
    Novato


    Mensagens : 29
    Créditos : 1

    Resetar Status Por Item Empty Re: Resetar Status Por Item

    Mensagem por marccvz Qua Ago 22, 2018 7:22 pm

    eu arrumei 

    Muda isso 
    Código:
    Dim n As Long, i As Long, tempItem As Long, x As Long, y As Long, itemnum As Long

    Por Isso
    Código:
    Dim n As Long, i As Long, tempItem As Long, x As Long, y As Long, itemnum As Long, filename As String

    Depois Muda isso
    Código:
    Case ITEM_TYPE_STAT_RESET[size=12][/size]
                [size=12][/size]
                If GetPlayerResets(Index) >= 1 Then[size=12][/size]
                    filename = App.Path & "\data\classes.ini"[size=12][/size]
                        [size=12][/size]
                    Call SetPlayerStat(Index, Agility, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Agility")))[size=12][/size]
                    Call SetPlayerStat(Index, Strength, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Strength")))[size=12][/size]
                    Call SetPlayerStat(Index, Intelligence, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Intelligence")))[size=12][/size]
                    Call SetPlayerStat(Index, Endurance, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Endurance")))[size=12][/size]
                    Call SetPlayerStat(Index, Willpower, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Willpower")))[size=12][/size]
                    [size=12][/size]
                    If Not GetPlayerPOINTS(Index) > 0 Then[size=12][/size]
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))[size=12][/size]
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))[size=12][/size]
                    Else[size=12][/size]
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))[size=12][/size]
                        Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))[size=12][/size]
                    End If[size=12][/size]
                        [size=12][/size]
                    Call TakeInvItem(Index, Player(Index).Inv(invNum).Num, 0)[size=12][/size]
                        [size=12][/size]
                    ' send the sound[size=12][/size]
                    SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, itemnum[size=12][/size]
                    [size=12][/size]
                    Call PlayerMsg(Index, "Seus Pontos foram Resetados!", BrightGreen)[size=12][/size]
            [size=12][/size]
                 Else[size=12][/size]
                       Call PlayerMsg(Index, "Você deve ter mais de 1 reset para reseta seus status!", BrightRed)[size=12][/size]
                 End If

    Por isso
    Código:
              Case ITEM_TYPE_STAT_RESET
                
                    filename = App.Path & "\data\classes.ini"
                        
                    Call SetPlayerStat(index, Agility, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Agility")))
                    Call SetPlayerStat(index, Strength, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Strength")))
                    Call SetPlayerStat(index, Intelligence, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Intelligence")))
                    Call SetPlayerStat(index, Endurance, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Endurance")))
                    Call SetPlayerStat(index, Willpower, Val(GetVar(filename, "CLASS" & GetPlayerClass(index), "Willpower")))
                        
                    If Not GetPlayerPOINTS(index) > 0 Then
                        Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + ((GetPlayerLevel(index) - 1) * 3))
                        Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + ((GetPlayerResets(index) * 30) * 1))
                    Else
                        Call SetPlayerPOINTS(index, 0)
                        Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + ((GetPlayerLevel(index) - 1) * 3))
                        Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + ((GetPlayerResets(index) * 30) * 1))
                    End If
                        
                    Call TakeInvItem(index, Player(index).Inv(InvNum).Num, 0)
                        
                    ' send the sound
                    SendPlayerSound index, GetPlayerX(index), GetPlayerY(index), SoundEntity.seItem, itemnum
                    
                    Call PlayerMsg(index, "Seus atributos foram resetados!", BrightRed)
                    Call SendPlayerData(index)

    Testa ai e me fala
    Mizuki
    Mizuki
    Iniciante
    Iniciante


    Mensagens : 30
    Créditos : 4

    Ficha do personagem
    Nível: 1
    Experiência:
    Resetar Status Por Item Left_bar_bleue0/0Resetar Status Por Item Empty_bar_bleue  (0/0)
    Vida:
    Resetar Status Por Item Left_bar_bleue30/30Resetar Status Por Item Empty_bar_bleue  (30/30)

    Resetar Status Por Item Empty Re: Resetar Status Por Item

    Mensagem por Mizuki Qui Ago 23, 2018 9:44 pm

    amigo funcionou sim porem tive que fazer uma alterações pq aqui e diferente o calculo de pontos mais ainda ganha 1 pontos praticamente toda vez que vc reseta ou add uma grande quantidade de pontos e reseta mas isso nao e nada de mais


    _________________
    vem sempre aqui?  I love you

    Conteúdo patrocinado


    Resetar Status Por Item Empty Re: Resetar Status Por Item

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Dom maio 19, 2024 10:36 pm