Desineria RPG Maker
Você esta conectado na Desineria RPG Maker!

Participe do fórum, é rápido e fácil

Desineria RPG Maker
Você esta conectado na Desineria RPG Maker!
Desineria RPG Maker
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Memorizador de Spells

Ir para baixo

Memorizador de Spells Empty Memorizador de Spells

Mensagem   Qua Nov 02, 2011 11:21 pm

Esse tuto faz com que você possa memorizar 3 Spells nos comandos F1, F2 e F3 de acordo com as spells que você selecionou em uma PicBox.
Vamos ao tuto...

Na frmMirage, procure por:

Código:
Option Explicit

Abaixo adicione:

Código:
Dim SpellMemorized As Long
Dim SpellMemorized2 As Long
Dim SpellMemorized3 As Long

Procure por:

Código:
If KeyCode = vbKeyF1 Then

E mude o vbKeyF1 para vbKeyF6.

Procure por:

Código:
If KeyCode = vbKeyF2 Then

E mude o vbKeyF2 para vbKeyF7.

Procure por:

Código:
If KeyCode = vbKeyF3 Then

E mude o vbKeyF3 para vbKeyF8.

Com isso acima mudamos o Painel de admin para F6, Pot de HP para F7 e Pot de MP para F8.

Procure por:

Código:
    If KeyCode = vbKeyF12 Then
        ScreenShot.Picture = CaptureArea(frmMirage, picScreen.Left, picScreen.Top, picScreen.Width, picScreen.Height)

        Do
            If FileExists("Screenshot_" & ScreenID & ".bmp") Then
                ScreenID = ScreenID  1
            Else
                Call SavePicture(ScreenShot.Picture, App.Path & "\Screenshot_" & ScreenID & ".bmp")
                Exit Do
            End If
        Loop
    End If

Abaixo adicione:

Código:
If KeyCode = vbKeyF1 Then
        If SpellMemorized > 0 Then
            If GetTickCount > Player(MyIndex).AttackTimer  1000 Then
                If Player(MyIndex).Moving = 0 Then
                    Call SendData("cast" & SEP_CHAR & SpellMemorized & SEP_CHAR & END_CHAR)
                    Player(MyIndex).Attacking = 1
                    Player(MyIndex).AttackTimer = GetTickCount
                    Player(MyIndex).CastedSpell = YES
                Else
                    Call AddText("Você não pode soltar magia enquanto anda!", BRIGHTRED)
                End If
            End If
        Else
            Call AddText("Não há magia memorizada.", BRIGHTRED)
        End If
    Else
        Call CheckInput(0, KeyCode, Shift)
    End If
 
        If KeyCode = vbKeyF2 Then
        If SpellMemorized > 0 Then
            If GetTickCount > Player(MyIndex).AttackTimer  1000 Then
                If Player(MyIndex).Moving = 0 Then
                    Call SendData("cast" & SEP_CHAR & SpellMemorized2 & SEP_CHAR & END_CHAR)
                    Player(MyIndex).Attacking = 1
                    Player(MyIndex).AttackTimer = GetTickCount
                    Player(MyIndex).CastedSpell = YES
                Else
                    Call AddText("Você não pode soltar magia enquanto anda!", BRIGHTRED)
                End If
            End If
        Else
            Call AddText("Não há magia memorizada.", BRIGHTRED)
        End If
    Else
        Call CheckInput(0, KeyCode, Shift)
    End If
 
        If KeyCode = vbKeyF3 Then
        If SpellMemorized > 0 Then
            If GetTickCount > Player(MyIndex).AttackTimer  1000 Then
                If Player(MyIndex).Moving = 0 Then
                    Call SendData("cast" & SEP_CHAR & SpellMemorized3 & SEP_CHAR & END_CHAR)
                    Player(MyIndex).Attacking = 1
                    Player(MyIndex).AttackTimer = GetTickCount
                    Player(MyIndex).CastedSpell = YES
                Else
                    Call AddText("Você não pode soltar magia enquanto anda!", BRIGHTRED)
                End If
            End If
        Else
            Call AddText("Não há magia memorizada.", BRIGHTRED)
        End If
    Else
        Call CheckInput(0, KeyCode, Shift)
    End If

Na frmMirage na PictureBox onde fica as Spells, crie uma label com um nome e caption qualquer. Clique duas vezes e adicione:

Código:
Call SendData("spells" & SEP_CHAR & END_CHAR)
picSpells2.Visible = True

Agora em qualquer lugar da frmMirage cria uma picture com o nome de picSpells2, nas propriedades mude Visible, de True para False.
Na picSpells2 crie 3 labels e 3 comboBox.

Coloque na caption das labels e das comboBox oque quiser, no nome das comboBox coloque: cmbSpells , cmbSpells2 e cmbSpells3.
Na picSpells2 criei 2 commandButton, no 1º coloco o nome de cmdSalvar e a caption Salvar, de 2 clicks nele e adicione:

Código:
Private Sub cmdSalvar_Click()
If Player(MyIndex).Spell(cmbSpells.ListIndex  1) > 0 Then
        SpellMemorized = cmbSpells.ListIndex  1
    Else
        Call AddText("Se você não pós nenhuma Magia aqui o sistema memoriza sua primeira magia no F1.", BRIGHTRED)
    End If
 
    If Player(MyIndex).Spell(cmbSpells2.ListIndex  1) > 0 Then
        SpellMemorized2 = cmbSpells2.ListIndex  1
    Else
        Call AddText("Se você não pós nenhuma Magia aqui o sistema memoriza sua primeira magia no F2.", BRIGHTRED)
    End If
 
    If Player(MyIndex).Spell(cmbSpells3.ListIndex  1) > 0 Then
        SpellMemorized3 = cmbSpells3.ListIndex  1
    Else
        Call AddText("Se você não pós nenhuma Magia aqui o sistema memoriza sua primeira magia no F3.", BRIGHTRED)
    End If

picSpells2.Visible = False

No 2º commandButton coloque o nome de cmdCancels e a caption Cancel, de 2 clicks e adicione:

Código:
picSpells2.Visible = False

Agora no modHandleData procure por:

Código:
' :::::::::::::::::::
' :: Spells packet ::
' :::::::::::::::::::

Substitua todo Spells packet por:

Código:
    ' :::::::::::::::::::
    ' :: Spells packet ::
    ' :::::::::::::::::::
    If (casestring = "spells") Then
     
        frmMirage.picPlayerSpells.Visible = True
        frmMirage.lstSpells.Clear
     
' Put spells known in player record
        For I = 1 To MAX_PLAYER_SPELLS
            Player(MyIndex).Spell(I) = Val#(parse$(I))
            If Player(MyIndex).Spell(I) <> 0 Then
                frmMirage.lstSpells.addItem I & ": " & Trim$(Spell(Player(MyIndex).Spell(I)).Name)
                frmMirage.cmbSpells.addItem I & ": " & Trim$(Spell(Player(MyIndex).Spell(I)).Name)
                frmMirage.cmbSpells2.addItem I & ": " & Trim$(Spell(Player(MyIndex).Spell(I)).Name)
                frmMirage.cmbSpells3.addItem I & ": " & Trim$(Spell(Player(MyIndex).Spell(I)).Name)
            Else
                frmMirage.lstSpells.addItem "--- Slot Free ---"
                frmMirage.cmbSpells.addItem "--- Slot Free ---"
                frmMirage.cmbSpells2.addItem "--- Slot Free ---"
                frmMirage.cmbSpells3.addItem "--- Slot Free ---"
            End If
        Next I
     
        frmMirage.lstSpells.ListIndex = 0
        frmMirage.cmbSpells.ListIndex = 0
        frmMirage.cmbSpells2.ListIndex = 0
        frmMirage.cmbSpells3.ListIndex = 0
            End If

Pronto! Você ja tem um sistema de memorizar Spells.
Qualquer erro ou bug... Consulte no tópico do antigo fórum, porque eu num sei nada (porra nenhuma) de VB.

• Créditos
- Creditos inteiramente ao Heavy
avatar

Pontos : 0
Data de inscrição : 31/12/1969

Desineria RPG Maker
Nível de atividade Nível de atividade:
Memorizador de Spells Left_bar_bleue138/1000Memorizador de Spells Empty_bar_bleue  (138/1000)

Ir para o topo Ir para baixo

Ir para o topo


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