Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.
Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.

Você não está conectado. Conecte-se ou registre-se

Trocar sprite por item

2 participantes

Ir para baixo  Mensagem [Página 1 de 1]

1Trocar sprite por item Empty Trocar sprite por item Sex Fev 17, 2012 12:54 pm

Ricardo

Ricardo
Moderador Local
Moderador Local

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

2Trocar sprite por item Empty Re: Trocar sprite por item Qua Fev 22, 2012 11:20 am

wyvern670

wyvern670
Iniciante
Iniciante

Vlw, aqui funfo ricardo Smile posta mais ae !

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos