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.

Comando de Reset

Ir para baixo

Comando de Reset Empty Comando de Reset

Mensagem  Mapper Seg Nov 07, 2011 2:26 pm

Escrito por Cris~ na antiga MMORPGBR.

Server~

Vá em:

Código:
Sub SavePlayer(ByVal Index As Long)


Procure por:

Código:
Call PutVar(FileName, "CHAR" & i, "Guildaccess", STR(Player(Index).Char(i).Guildaccess))

Abaixo adicione:

Código:
  Call PutVar(FileName, "CHAR" & i, "Resets", STR(Player(Index).Char(i).Resets))

Vá em:

Código:
Type PlayerRec

Procure por:

Código:
  PK As Byte

Abaixo adicione:

Código:
Resets As Long

Coloque essa Sub e essa Function no Module modTypes e no Class Module clsCommands:

Código:
Function GetPlayerResets(ByVal Index As Long) As Long
    GetPlayerResets = Player(Index).Char(Player(Index).CharNum).Resets
End Function

Sub SetPlayerResets(ByVal Index As Long, _
  ByVal Resets As Long)
    Player(Index).Char(Player(Index).CharNum).Resets = Resets
End Sub

Vá em:

Código:
Sub LoadPlayer(ByVal Index As Long, _
  ByVal Name As String)

Procure por:

Código:
  Player(Index).Char(i).Guildaccess = Val(GetVar(FileName, "CHAR" & i, "Guildaccess"))

Abaixo adicione:

Código:
  Player(Index).Char(i).Resets = Val(GetVar(FileName, "CHAR" & i, "Resets"))

No classModule clsCommands adicione:

Código:
Sub SendPOINTS(ByVal Index As Long)
    Call SendDataTo(Index, "playerpoints" & SEP_CHAR & GetPlayerPOINTS(Index) & END_CHAR)
End Sub

Agora vamos à parte do SadScript...
Abra o seu Principal.txt (ou Main.txt se você usar a versão inglesa) e procure por:

Código:
Case "/bell"
        Call GlobalMsg("*ding* *ding* *ding*", 7)
        Exit Sub

Abaixo adicione:

Código:
Case "/reset"
        If GetPlayerLevel(Index) >= 100 Then ' Mude o 100 para o nível de "Reset"
            Call SetPlayerLevel(Index, 1) ' Poe o personagem no nível 1
            Call SetPlayerPOINTS(Index, GetPlayerPoints(Index) + 50) ' Mude o 50 para a quantidade pontos extras que o personagem ganha, remova essa linha se não é para ele ganhar nada
            Call SetPlayerResets(Index, GetPlayerResets(Index) + 1) ' Atualiza o número de vezes que o personagem já "resetou" no nosso banco de dados
            Call SavePlayer(Index) ' Salva as alterações feitas no personagem
            Call SendPOINTS(Index) ' Envia a quantidade de pontos extras pro cliente
            Call SendStats(Index) ' Envia o nível (e alguns outros dados) pro cliente
            Call PlayerMsg(Index, "Você resetou!", 14) ' Você deve saber...
      Else ' Se não tiver o nível suficiente para resetar
            Call PlayerMsg(Index, "Você não tem o nível suficiente para resetar!", 14)
      End If
    Exit Sub

Procure por:

Código:
Sub ClearChar

E no fim dele adicione:

Código:
 Player(Index).Char(CharNum).Resets = 0

Mapper
Mapper
Novato
Novato

Mensagens : 35
Pontos : 102
Reputação : 6
Data de inscrição : 06/11/2011

Desineria RPG Maker
Nível de atividade Nível de atividade:
Comando de Reset Left_bar_bleue101/1000Comando de Reset Empty_bar_bleue  (101/1000)

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