Conexão Maker

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

    Trocar Sprite por Item

    Thales12
    Thales12
    Administrador
    Administrador


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

    Trocar Sprite por Item Empty Trocar Sprite por Item

    Mensagem por Thales12 Qua Fev 15, 2012 1:54 am

    Client~Side

    Na frmEditor_Item crie uma label e um scrollBox com as seguintes configurações:

    Label
    Name: lblSprite
    Caption: Sprite: Não mudar

    ScrollBox
    Name: scrlSprite

    Dentro do ScrllBox adicione:

    Código:
        ' If debug mode, handle error then exit out
        If Options.Debug = 1 Then On Error GoTo errorhandler
       
        lblSprite.Caption = "Sprite: " & scrlLevelReq
        Item(EditorIndex).Sprite = scrlSprite.Value
       
        ' Error handler
        Exit Sub
    errorhandler:
        HandleError "scrlSprite_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
        Err.Clear
        Exit Sub

    Na cmbType adicione no final da list:

    Trocar Sprite

    Procure por:

    Código:
    Public Const ITEM_TYPE_SPELL As Byte = 13

    E abaixo adicione:

    Código:
    Public Const ITEM_TYPE_SPRITE As Byte = 14

    Procure por:

    Código:
            frmEditor_Item.scrlRarity.Value = .Rarity

    Abaixo adiciione:

    Código:
            frmEditor_Item.scrlSprite.Value = .Sprite

    No final da Private Type ItemRec, antes do End Type, adicione:

    Código:
        Sprite As Long

    Serve~side

    No final da Private Type ItemRec, antes do End Type, adicione:

    Código:
        Sprite As Long

    Procure por:

    Código:
    Public Const ITEM_TYPE_SPELL As Byte = 13

    E abaixo adicione:

    Código:
    Public Const ITEM_TYPE_SPRITE As Byte = 14

    Procure por:

    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, "Você não tem os status requeridos para equipar esse equipamento.", BrightRed
                            Exit Sub
                        End If
                    Next
                   
                    ' level requirement
                    If GetPlayerLevel(index) < Item(itemnum).LevelReq Then
                        PlayerMsg index, "Você não tem o level requerido para usar esse item.", BrightRed
                        Exit Sub
                    End If
                   
                    ' class requirement
                    If Item(itemnum).ClassReq > 0 Then
                        If Not GetPlayerClass(index) = Item(itemnum).ClassReq Then
                            PlayerMsg index, "Você não tem a classe necessaria para usar esse item.", BrightRed
                            Exit Sub
                        End If
                    End If
                   
                    ' access requirement
                    If Not GetPlayerAccess(index) >= Item(itemnum).AccessReq Then
                        PlayerMsg index, "Você não tem o acesso requerido para usar esse 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, "Agora você pode usar a magia " & Trim$(Spell(n).Name) & ".", BrightGreen)
                                    Else
                                        Call PlayerMsg(index, "Você ja tem essa magia.", BrightRed)
                                    End If

                                Else
                                    Call PlayerMsg(index, "Você não pode aprender mais magias.", BrightRed)
                                End If

                            Else
                                Call PlayerMsg(index, "Você precisa estar no nivel " & i & " para aprender essa magia.", BrightRed)
                            End If

                        Else
                            Call PlayerMsg(index, "Essa magia so pode ser aprendida pela classe " & CheckGrammar(GetClassName(Spell(n).ClassReq)) & ".", BrightRed)
                        End If
                    End If
                   
                    ' send the sound
                    SendPlayerSound index, GetPlayerX(index), GetPlayerY(index), SoundEntity.seItem, itemnum

    Abaixo adicione:

    Código:
                Case ITEM_TYPE_SPRITE
               
                    ' stat requirements
                    For i = 1 To Stats.Stat_Count - 1
                        If GetPlayerRawStat(index, i) < Item(itemnum).Stat_Req(i) Then
                            PlayerMsg index, "Você não tem os status requeridos para equipar esse equipamento.", BrightRed
                            Exit Sub
                        End If
                    Next
                   
                    ' level requirement
                    If GetPlayerLevel(index) < Item(itemnum).LevelReq Then
                        PlayerMsg index, "Você não tem o level requerido para usar esse item.", BrightRed
                        Exit Sub
                    End If
                   
                    ' class requirement
                    If Item(itemnum).ClassReq > 0 Then
                        If Not GetPlayerClass(index) = Item(itemnum).ClassReq Then
                            PlayerMsg index, "Você não tem a classe necessaria para usar esse item.", BrightRed
                            Exit Sub
                        End If
                    End If
                   
                    ' access requirement
                    If Not GetPlayerAccess(index) >= Item(itemnum).AccessReq Then
                        PlayerMsg index, "Você não tem o acesso requerido para usar esse item.", BrightRed
                        Exit Sub
                    End If
                   
                    ' Trocar sprite
                    Call SetPlayerSprite(index, Item(itemnum).Sprite)
                   
                    ' send the sound
                    SendPlayerSound index, GetPlayerX(index), GetPlayerY(index), SoundEntity.seItem, itemnum

                    ' atualizar player
                    Call SendPlayerData(index)

    Creditos:

    Ricardo

      Data/hora atual: Sex Abr 19, 2024 9:18 am