TutoRPG


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

TutoRPG
TutoRPG
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Últimos assuntos
» Evil Fantasy BETA
Sistema De Vila I_icon_minitimeTer Set 10, 2013 12:30 pm por lauk

» Sistema de Guild (do Eduardo)
Sistema De Vila I_icon_minitimeTer maio 14, 2013 8:54 pm por Khaws

» Sistema de Guild
Sistema De Vila I_icon_minitimeTer maio 14, 2013 6:48 pm por Khaws

» Teco Fabrica
Sistema De Vila I_icon_minitimeSáb Mar 23, 2013 8:18 am por ~FullzDied

» Apresentaçao
Sistema De Vila I_icon_minitimeSex Mar 01, 2013 6:58 pm por Sweeps

» Editando nick
Sistema De Vila I_icon_minitimeSex Mar 01, 2013 6:35 pm por Sweeps

» Sistema De Vila
Sistema De Vila I_icon_minitimeSex Fev 01, 2013 4:59 pm por ~FullzDied

» alguns tilesets
Sistema De Vila I_icon_minitimeSáb Dez 22, 2012 8:42 pm por Diegoslstuto

» Tilesets de natureza
Sistema De Vila I_icon_minitimeSáb Dez 22, 2012 8:40 pm por Diegoslstuto

» Olá, vim para trazer sistemas e muitas outras coisas
Sistema De Vila I_icon_minitimeQui Dez 13, 2012 3:09 pm por ~FullzDied

» [Recrutando] Bleach Online Dark Saga
Sistema De Vila I_icon_minitimeSáb Nov 10, 2012 8:23 pm por Hunter™

» Dragon Ball Fox
Sistema De Vila I_icon_minitimeDom Out 28, 2012 7:55 am por NeeTo

» Tutorial Mapper - Como avaliar um mapa
Sistema De Vila I_icon_minitimeSáb Out 13, 2012 12:45 pm por NeeTo

» Life RPG Maker 2.0
Sistema De Vila I_icon_minitimeQui Out 11, 2012 4:02 pm por SynysterGates

» Fórum decaido
Sistema De Vila I_icon_minitimeQui Out 11, 2012 2:16 pm por SynysterGates

» Dragon Ball Elite
Sistema De Vila I_icon_minitimeQua Out 10, 2012 3:07 pm por KingSora

» Auto Ataque por checkbox
Sistema De Vila I_icon_minitimeTer Out 09, 2012 7:35 pm por Warrior_Maker

» Pokémon Online - Xstrond Games BETA
Sistema De Vila I_icon_minitimeTer Out 02, 2012 10:29 pm por thales12

» Auto Correr Por CheckBox
Sistema De Vila I_icon_minitimeTer Out 02, 2012 10:03 pm por thales12

» Auto Loot para Eclipse Origins
Sistema De Vila I_icon_minitimeTer Out 02, 2012 10:02 pm por thales12

»  Ganhar Item em Certo Nivel
Sistema De Vila I_icon_minitimeTer Out 02, 2012 9:58 pm por thales12

» SK - Lógica de Programação - Aula 3
Sistema De Vila I_icon_minitimeQua Set 26, 2012 7:05 pm por SameKage

» Distrito Rpg Maker 2.0 no Ar !!
Sistema De Vila I_icon_minitimeDom Set 23, 2012 7:59 pm por SameKage

» Sistemas que preciso
Sistema De Vila I_icon_minitimeSex Set 21, 2012 7:28 pm por KingSora

» [ALL] Títulos nos NPC's 1.0
Sistema De Vila I_icon_minitimeSex Set 21, 2012 5:38 pm por lucas100vzs

» Vídeo Tutorial Mapper Caverna - MMORPG 2D
Sistema De Vila I_icon_minitimeQui Set 20, 2012 8:16 pm por KingSora

» Sistema de plantar e colher
Sistema De Vila I_icon_minitimeTer Set 18, 2012 10:00 pm por SameKage

» Perfect engine
Sistema De Vila I_icon_minitimeTer Set 18, 2012 9:59 pm por SameKage

» O Seu pirata chegou !
Sistema De Vila I_icon_minitimeDom Set 16, 2012 7:58 pm por SameKage

» Novidades para tutorpg o que acha?
Sistema De Vila I_icon_minitimeSáb Set 15, 2012 7:03 pm por Guilherme Azevedo

» [ZIG ZAG GAMES] Age of Dragons
Sistema De Vila I_icon_minitimeSáb Set 15, 2012 1:56 pm por Guilherme Azevedo

» Me ajudem Pliss
Sistema De Vila I_icon_minitimeSex Set 14, 2012 9:48 am por KingSora

» SK - HTML - Aula 1
Sistema De Vila I_icon_minitimeQui Set 13, 2012 12:35 pm por SameKage

» Forum Decaindo
Sistema De Vila I_icon_minitimeTer Set 11, 2012 1:52 pm por Tayllor

» Meus 3 mapas
Sistema De Vila I_icon_minitimeTer Set 11, 2012 11:26 am por KingSora

» [Apresentação] Okumura-Rin~
Sistema De Vila I_icon_minitimeSeg Set 10, 2012 5:43 pm por Warrior_Maker

» 3 primeiras sprites
Sistema De Vila I_icon_minitimeSex Set 07, 2012 6:19 pm por KingSora

» [EEB] Comando para Salvar Seu Game
Sistema De Vila I_icon_minitimeSex Set 07, 2012 5:06 pm por SynysterGates

» [Off] Olha Suas PM Tayllor
Sistema De Vila I_icon_minitimeSex Set 07, 2012 4:49 pm por Tayllor

» Fabrica da JCG Corp: Technology in designer [Fechada
Sistema De Vila I_icon_minitimeQui Set 06, 2012 6:15 pm por KingSora

Quem está conectado?
3 usuários online :: 0 registrados, 0 invisíveis e 3 visitantes

Nenhum

[ Ver toda a lista ]


O recorde de usuários online foi de 13 em Sex Mar 04, 2022 3:18 am
Parceiros
Templo RPG Maker - Onde a magia maker permanece viva! Sistema De Vila 4vAJr

Sistema De Vila

2 participantes

Ir para baixo

Sistema De Vila Empty Sistema De Vila

Mensagem por Hunter™ Dom Out 28, 2012 2:43 pm

Olá pessoal, venho trazer à vocês um sistema de vila. Atualmente, postarei apenas com 4 vilas, e os gráficos das vilas foram feitas para meu naruto.

Client-Side

Procure por:
Código:
Private Type PlayerRec


Abaixo de:
Código:
PK as Byte


Adicione:
Código:
Vila as Byte


Com isso, terá uma nova variavel na estrutura do player, onde será as vilas.

No frmMenu, na Private Sub Form_Load(), procure por:
Código:
For i = 0 To UBound(tmpArray)
        lblNews.Caption = lblNews.Caption & tmpArray(i) & vbNewLine
    Next


Abaixo adicione:
Código:
Vila = 1


Com isso, ao carregar a frmMenu, o valor de vila será 1, isso evitara futuros erros..

no frmMenu, crie:
Uma picture chamada:
Código:
Nome: picVila
Caption: Konoha

E deixe sua propriedade igual a forma abaixo:
[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
Em seguinda, ainda na picVila, adicione esta imagem de Konoha como sua Picture padrão.
[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
Uma Label Chamada:
Código:
Nome: lblVilaProx
Caption: >


Uma segunda label:
Código:
Nome: lblVilaAnt
Caption: <


Uma terceira label:
Código:
Nome: lblVila
Caption: Konoha

Ficará mais ou menos assim....:
[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]


Após ter feito isso, dê 2 clicks na lblVilaProx, e add:
Código:
If Vila >= 5 Then
  Vila = 1
Else
  Vila = Vila + 1
End If
picVila.Picture = LoadPicture(App.Path & "\data files\graphics\Vilas" & Vila & ".jpg")
If Vila = 1 Then
lblVila.Caption = "Konohagakure"
ElseIf Vila = 2 Then
lblVila.Caption = "Sunagakure"
ElseIf Vila = 3 Then
lblVila.Caption = "Iwagakure"
ElseIf Vila = 4 Then
lblVila.Caption = "Kirigakure"
ElseIf Vila = 5 Then
lblVila.Caption = "Kumogakure"
End If

Isso fará com que, você ao clicar na label, passara de vila, indo de 1 em 1, quando chegar na vila 5, voltará na 1.. Indo sempre pra frente ( avançando )

Na lblVilaAnt,add:
Código:
If Vila <= 1 Then
  Vila = 5
Else
  Vila = Vila - 1
End If

picVila.Picture = LoadPicture(App.Path & "\data files\graphics\Vilas" & Vila & ".jpg")

If Vila = 1 Then
lblVila.Caption = "Konohagakure"
ElseIf Vila = 2 Then
lblVila.Caption = "Sunagakure"
ElseIf Vila = 3 Then
lblVila.Caption = "Iwagakure"
ElseIf Vila = 4 Then
lblVila.Caption = "Kirigakure"
ElseIf Vila = 5 Then
lblVila.Caption = "Kumogakure"
End If

sso fará com que, você ao clicar na label, voltará de vila, voltando de 1 em 1, quando chegar na vila 1, voltará na 5.. Indo sempre pra trás ( retornando )

Em seguida, na Public Sub SendAddChar, troque ela toda por:
Código:
Public Sub SendAddChar(ByVal name As String, ByVal Sex As Long, ByVal ClassNum As Long, ByVal Sprite As Long, ByVal Vila As Byte)
Dim buffer As clsBuffer

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler
   
    Set buffer = New clsBuffer
    buffer.WriteLong CAddChar
    buffer.WriteString name
    buffer.WriteLong Sex
    buffer.WriteLong ClassNum
    buffer.WriteLong Sprite
    buffer.WriteByte Vila
    SendData buffer.ToArray()
    Set buffer = Nothing
   
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "SendAddChar", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub

Isso fará com que, ao criar char, envie a packet para armazenar vila do jogador juntamente com os dados do player, para assim amarzenar no servidor a sua vila.

Em seguida, no final da modGlobals, adicione:
Código:
Public Vila As Byte


Em seguida, em modGeneral, na Public Sub MenuState, procure por:
Código:
If frmMenu.optMale.Value Then
                    Call SendAddChar(frmMenu.txtCName, SEX_MALE, frmMenu.cmbClass.ListIndex + 1, newCharSprite)
                Else
                    Call SendAddChar(frmMenu.txtCName, SEX_FEMALE, frmMenu.cmbClass.ListIndex + 1, newCharSprite)
                End If

Mude para:
Código:
If frmMenu.optMale.Value Then
                    Call SendAddChar(frmMenu.txtCName, SEX_MALE, frmMenu.cmbClass.ListIndex + 1, newCharSprite, Vila)
                Else
                    Call SendAddChar(frmMenu.txtCName, SEX_FEMALE, frmMenu.cmbClass.ListIndex + 1, newCharSprite, Vila)
                End If


Isso fará com que envie o dado da vila ao você escolher ela no frmMenu

Depois, na modHandleDataprocure por:
Código:
Call SetPlayerPK(i, buffer.ReadLong)

Abaixo add:
Código:
Player(i).Vila = buffer.ReadByte

Caso queira que mostre a vila do jogador em uma LABEL, vá na frmMain, e crie uma label chamada:
Código:
lblVila

E procure na modHandledata, por:
Código:
For x = 1 To Stats.Stat_Count - 1
            frmMain.lblCharStat(x).Caption = GetPlayerStat(MyIndex, x)
        Next


E abaixo add:
Código:
Select Case Player(MyIndex).Vila
        Case 1
          frmMain.lblVila.Caption = "Konohagakure"
        Case 2
          frmMain.lblVila.Caption = "Sunagakure"
        Case 3
          frmMain.lblVila.Caption = "Iwagakure"
        Case 4
          frmMain.lblVila.Caption = "Kirigakure"
        Case 5
          frmMain.lblVila.Caption = "Kumogakure"
        End Select

Isso fará com que acada valor de vila, tenha um nome, seguindo assim seus respectivos nomes dados no frmMenu.
Pronto, client side completo.. Vamos para o servidor agora.

Server-Side
Procure a SubAddChar, e troque ela toda por:
Código:
Sub AddChar(ByVal index As Long, ByVal Name As String, ByVal Sex As Byte, ByVal ClassNum As Long, ByVal Sprite As Long, ByVal Vila As Byte)
    Dim f As Long
    Dim n As Long
    Dim spritecheck As Boolean

    If LenB(Trim$(Player(index).Name)) = 0 Then
       
        spritecheck = False
       
        Player(index).Name = Name
        Player(index).Sex = Sex
        Player(index).Class = ClassNum
        Player(index).Vila = Vila
       
       
        If Player(index).Sex = SEX_MALE Then
            Player(index).Sprite = Class(ClassNum).MaleSprite(Sprite)
        Else
            Player(index).Sprite = Class(ClassNum).FemaleSprite(Sprite)
        End If

        Player(index).Level = 1

        For n = 1 To Stats.Stat_Count - 1
            Player(index).stat(n) = Class(ClassNum).stat(n)
        Next n

        Player(index).Dir = DIR_DOWN
        Player(index).Map = Player(index).Vila
        Player(index).x = START_X
        Player(index).y = START_Y
        Player(index).Dir = DIR_DOWN
        Player(index).Vital(Vitals.HP) = GetPlayerMaxVital(index, Vitals.HP)
        Player(index).Vital(Vitals.MP) = GetPlayerMaxVital(index, Vitals.MP)
       
        ' set starter equipment
        If Class(ClassNum).startItemCount > 0 Then
            For n = 1 To Class(ClassNum).startItemCount
                If Class(ClassNum).StartItem(n) > 0 Then
                    ' item exist?
                    If Len(Trim$(Item(Class(ClassNum).StartItem(n)).Name)) > 0 Then
                        Player(index).Inv(n).Num = Class(ClassNum).StartItem(n)
                        Player(index).Inv(n).Value = Class(ClassNum).StartValue(n)
                    End If
                End If
            Next
        End If
       
        ' set start spells
        If Class(ClassNum).startSpellCount > 0 Then
            For n = 1 To Class(ClassNum).startSpellCount
                If Class(ClassNum).StartSpell(n) > 0 Then
                    ' spell exist?
                    If Len(Trim$(Spell(Class(ClassNum).StartSpell(n)).Name)) > 0 Then
                        Player(index).Spell(n) = Class(ClassNum).StartSpell(n)
                    End If
                End If
            Next
        End If
       
        ' Append name to file
        f = FreeFile
        Open App.path & "\data\accounts\charlist.txt" For Append As #f
        Print #f, Name
        Close #f
        Call SavePlayer(index)
        Exit Sub
    End If

End Sub


No final do modGlobals, para evitar erros, adicione:
Código:
Public Vila As Byte


Depois, na ModHandleData, procure por:
Código:
Private Sub HandleAddChar(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

Abaixo de:
Código:
Dim n as Long

Add:
Código:
Dim Vila As Byte


Ainda na mesma sub procure por:
Código:
Sprite = buffer.ReadLong

Abaixo add:
Código:
Vila = buffer.ReadByte


Ainda na MobHandleData, procure por:
Código:
' Everything went ok, add the character
        Call AddChar(index, Name, Sex, Class, Sprite)


e modifique por:
Código:
' Everything went ok, add the character
        Call AddChar(index, Name, Sex, Class, Sprite, Vila)


Depois, no mobServerTPC, procure por:
Código:
buffer.WriteLong GetPlayerPK(index)

Abaixo add:
Código:
buffer.WriteByte Player(index).Vila


Depois, em modTypes, na Private Type PlayerRec, procure por:
Código:
PK As Byte

Abaixo add:
Código:
Vila as byte

Download para as imagens das vilas: [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

Baixe a pasta: Vilas, e adicione na pasta "graphics" do seu Eclipse Origins, e pronto sistema concluído. Delete suas contas antes de testar, e crie uma nova conta.

-Créditos-

Sakuray: por fazer
Eu: por postar
Hunter™
Hunter™
Iniciante
Iniciante

Mensagens : 6
Cash : 1
Créditos : 1
Data de inscrição : 28/10/2012
Idade : 22
Localização : Rio De Janeiro - RJ

http://www.mmorpgbr.com/

Ir para o topo Ir para baixo

Sistema De Vila Empty Re: Sistema De Vila

Mensagem por ~FullzDied Sex Fev 01, 2013 4:59 pm

Ótimo sistema!... Agradeço por ter disponibilizado em nosso fórum! +1
~FullzDied
~FullzDied
Moderador Local
Moderador Local

Mensagens : 59
Cash : 2
Créditos : 2
Data de inscrição : 26/08/2012
Idade : 23
Localização : Minha Casa - RJ

https://tutorpg.forumeiro.com/

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

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