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


4 participantes

    Resetar os Pts do Stats por Item

    Motodark
    Motodark
    Ocasional
    Ocasional


    Mensagens : 169
    Créditos : 5

    Resetar os Pts do Stats por Item Empty Resetar os Pts do Stats por Item

    Mensagem por Motodark Dom Dez 21, 2014 8:40 pm

    Código:
    [size=18]Client side:[/size][size=14]

    Em [b]modConstants[/b] Abaixo de:

    [/size]
    [b][size=11]CÓDIGO:[/size][/b]
    [size=13]Public Const ITEM_TYPE_SPELL As Byte = 8[/size]
    [size=14]Add:

    [/size]
    [b][size=11]CÓDIGO:[/size][/b]
    [size=13]Public Const ITEM_TYPE_STAT_RESET As Byte = 9[/size]
    [size=14]
    Em [b]frmEditor_Item[/b] add cmbType's list: Resetador


    [/size][size=18]Server Side:[/size][size=14]

    Em [b]modConstants[/b] abaixo de:

    [/size]
    [b][size=11]CÓDIGO:[/size][/b]
    [size=13]Public Const ITEM_TYPE_SPELL As Byte = 8[/size]
    [size=14]Add:

    [/size]
    [b][size=11]CÓDIGO:[/size][/b]
    [size=13]Public Const ITEM_TYPE_STAT_RESET As Byte = 9[/size]
    [size=14]
    Em [b]modPlayer[/b], na sub UseItem add abaixo [/size][b][size=14]do[/size][/b][size=14] códico:

    [/size]
    [b][size=11]CÓDIGO:[/size][/b]
    [size=13]            Case ITEM_TYPE_SPELL
                
                    ' stat requirements
                    For i = 1 To [/size][b][size=13]Stats[/size][/b][size=13].Stat_Count - 1
                        If GetPlayerRawStat(index, i) < [/size][b][size=13]Item[/size][/b][size=13](itemnum).Stat_Req(i) Then
                            PlayerMsg index, "You [/size][b][size=13]do[/size][/b][size=13] not meet the stat requirements to use this[/size][b][size=13]item[/size][/b][size=13].", BrightRed
                            Exit Sub
                        End If
                    Next
                    
                    ' level requirement
                    If GetPlayerLevel(index) < [/size][b][size=13]Item[/size][/b][size=13](itemnum).LevelReq Then
                        PlayerMsg index, "You [/size][b][size=13]do[/size][/b][size=13] not meet the level requirement to use this [/size][b][size=13]item[/size][/b][size=13].", BrightRed
                        Exit Sub
                    End If
                    
                    ' class requirement
                    If [/size][b][size=13]Item[/size][/b][size=13](itemnum).ClassReq > 0 Then
                        If Not GetPlayerClass(index) = [/size][b][size=13]Item[/size][/b][size=13](itemnum).ClassReq Then
                            PlayerMsg index, "You [/size][b][size=13]do[/size][/b][size=13] not meet the class requirement to use this[/size][b][size=13]item[/size][/b][size=13].", BrightRed
                            Exit Sub
                        End If
                    End If
                    
                    ' access requirement
                    If Not GetPlayerAccess(index) >= [/size][b][size=13]Item[/size][/b][size=13](itemnum).AccessReq Then
                        PlayerMsg index, "You [/size][b][size=13]do[/size][/b][size=13] not meet the access requirement to use this [/size][b][size=13]item[/size][/b][size=13].", BrightRed
                        Exit Sub
                    End If
                    
                    ' Get the spell num
                    n = [/size][b][size=13]Item[/size][/b][size=13](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),[/size][b][size=13]Item[/size][/b][size=13](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[/size]
    [size=14]Adicione isso abaixo [/size][b][size=14]do[/size][/b][size=14] códico acima:

    [/size]
    [b][size=11]CÓDIGO:[/size][/b]
    [size=13]            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))
                    Else
                        Call SetPlayerPOINTS(index, 0)
                        Call SetPlayerPOINTS(index, GetPlayerPOINTS(index)  ((GetPlayerLevel(index) - 1) * 3))
                    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, "Your [/size][b][size=13]Stats[/size][/b][size=13] had been reset!", BrightRed)
                    [/size]
    [size=14]
    Agora, na mesma sub, modifique o começo [/size][b][size=14]do[/size][/b][size=14] códico onde está:

    [/size]
    [b][size=11]CÓDIGO:[/size][/b]
    [size=13]Dim n As Long, i As Long, tempItem As Long, x As Long, y As Long, itemnum As Long[/size]
    [b][size=14]Por[/size][/b][size=14]:

    [/size]
    [b][size=11]CÓDIGO:[/size][/b]
    [size=13]Dim n As Long, i As Long, tempItem As Long, x As Long, y As Long, itemnum As Long, filename As String[/size]
    [size=13]
    [/size]

    Uma Item que ao usar, você reseta seus status, podendo assim adicona-los dinovo.


    Créditos:
    - Helling 
    por postar
    - mmearrccii 
    por fazer


    Última edição por Helling em Ter Fev 03, 2015 6:24 pm, editado 1 vez(es)
    Valentine
    Valentine
    Administrador
    Administrador


    Medalhas : Resetar os Pts do Stats por Item ZgLkiRU
    Mensagens : 5336
    Créditos : 1163

    Resetar os Pts do Stats por Item Empty Re: Resetar os Pts do Stats por Item

    Mensagem por Valentine Dom Dez 21, 2014 8:47 pm

    E mais uma vez eu tenho que apagar os seus tópicos repetidos.

    Nos códigos, use:
    Código:
    [code][/code]
    Spooky
    Spooky
    Membro Ativo
    Membro Ativo


    Mensagens : 267
    Créditos : 24

    Resetar os Pts do Stats por Item Empty Re: Resetar os Pts do Stats por Item

    Mensagem por Spooky Sáb Dez 27, 2014 12:41 pm

    WTF não entendi nada :C, tente organizar seu tópico

    Poderia me passar o link de onde vc pegou esse tuto? c-c


    _________________
    Sign
    Resetar os Pts do Stats por Item Hticjn

    Sign¹:

    Sign²:
    XWlash
    XWlash
    Semi-Experiente
    Semi-Experiente


    Mensagens : 88
    Créditos : 23

    Resetar os Pts do Stats por Item Empty Re: Resetar os Pts do Stats por Item

    Mensagem por XWlash Sáb Dez 27, 2014 2:07 pm

    Helling sugiro que organize mais o tópico, ainda não testei o tutorial mas quando testar darei +1 crédito por disponibilizar, agradeço.


    _________________
    Resetar os Pts do Stats por Item Source

    Tente novamente.

    Conteúdo patrocinado


    Resetar os Pts do Stats por Item Empty Re: Resetar os Pts do Stats por Item

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Sex Abr 26, 2024 9:16 am