Poção que reseta os Pontos de Atributos

    Compartilhe
    avatar
    Thales12
    Administrador
    Administrador

    Mensagens : 140
    Level : 8
    Data de inscrição : 01/11/2011
    Idade : 23
    Localização : Rio de Janeiro

    default Poção que reseta os Pontos de Atributos

    Mensagem por Thales12 em Seg Fev 13, 2012 12:59 am

    Fará com que assim que o jogador usar o item,seus atributos voltem...

    No Cliente
    no frmEditor_item,procure o cmbType,e em suas propriedades,em list,adicione o seguinte: "Poção para resetar"

    em modConstants procure por:

    Código:
    Public Const ITEM_TYPE_SPELL As Byte = 8

    Código:
    Public Const ITEM_TYPE_STAT_RESET As Byte = 9

    No Servidor
    no modConstants abaixo disso:
    Código:
    Public Const ITEM_TYPE_SPELL As Byte = 8

    Adicione:

    Código:
    Public Const ITEM_TYPE_STAT_RESET As Byte = 9

    Em modPlayer
    Na sub use item,abaixo disso:

    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

    Adicione 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))
                    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, "Seus atributos foram resetados!", BrightRed)

    Na sub,mude isso:

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

    Para 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

    Créditos:
    Desconhecido-Por Criar o Sistema
    Terabin - Por Traduzir e Adaptar

      Data/hora atual: Dom Out 21, 2018 2:05 am