Comando de Reset
Página 1 de 1
Comando de Reset
Escrito por Cris~ na antiga MMORPGBR.
Server~
Vá em:
Procure por:
Abaixo adicione:
Vá em:
Procure por:
Abaixo adicione:
Coloque essa Sub e essa Function no Module modTypes e no Class Module clsCommands:
Vá em:
Procure por:
Abaixo adicione:
No classModule clsCommands adicione:
Agora vamos à parte do SadScript...
Abra o seu Principal.txt (ou Main.txt se você usar a versão inglesa) e procure por:
Abaixo adicione:
Procure por:
E no fim dele adicione:
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- Novato
- Mensagens : 35
Pontos : 102
Reputação : 6
Data de inscrição : 06/11/2011
Desineria RPG Maker
Nível de atividade:
(101/1000)
Tópicos semelhantes
» Dando Reset Pelo Server
» Botão de dar Reset Pelo Server
» Botão de dar Reset Pelo Server Modificado
» Botão de dar Reset Pelo Server
» Botão de dar Reset Pelo Server Modificado
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|