Bom pessoal Os Créditos são do DSHFOX por ter feito esse tutorial na antiga mmorpgbr. vamos a ele
[size=14pt]~Lado do Cliente[/size]
[size=14pt]~Lado do Server[/size]
[size=14pt]~Lado do Cliente[/size]
- Spoiler:
- Procure por:
- Código:
Select Case Command(0)
- Código:
Case "/ssj"
Trans 1
Case "/ssj2"
Trans 2
Case "/normal"
Normal
No Final do MODclientTCP
- Código:
Sub Trans(ByVal Trans As Byte)
Dim Buffer As clsBuffer
Set Buffer = New clsBuffer
Buffer.WriteLong CTrans
Buffer.WriteByte Trans
SendData Buffer.ToArray()
Set Buffer = Nothing
'dshfox
'OhYehBeibi.Blogspot.com
'OhYehBeibi.Webs.Com
End Sub
Sub Normal()
Dim Buffer As clsBuffer
Set Buffer = New clsBuffer
Buffer.WriteLong CVoltarNormal
SendData Buffer.ToArray()
Set Buffer = Nothing
'dshfox
'OhYehBeibi.Blogspot.com
'OhYehBeibi.Webs.Com
End Sub
Em, MODenumerations
- Código:
cuntradeitem
Adcione em baixo:
- Código:
CTrans
CVoltarNormal
[size=14pt]~Lado do Server[/size]
- Spoiler:
- Procure Por:
- Código:
HandleDataSub(CUntradeItem) = GetAddress(AddressOf HandleUntradeItem)
Embaixo adicione:
- Código:
HandleDataSub(CTrans) = GetAddress(AddressOf HandleTransformação)
HandleDataSub(CVoltarNormal) = GetAddress(AddressOf HandleVoltarNormal)
No Final do Handle Data Adicione
- Código:
Sub HandleTransformação(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
'DshFox
'OhYehBeibi.Webs.Com
'OhYehBeibi.Blogspot.com
Dim Buffer As clsBuffer
Dim trans As Byte
Set Buffer = New clsBuffer
Buffer.WriteBytes Data()
trans = Buffer.ReadByte
Set Buffer = Nothing
Select Case trans
Case 1 'SJJ
'===========
'Trans do Goku
'=============
If GetPlayerSprite(Index) = 1 Then 'sprite goku normal
If GetPlayerLevel(Index) >= 5 Then ' se tiver lvl 5
SetPlayerSprite Index, 2 'sprite do goku ssj
SetPlayerStat Index, Stats.strength, GetPlayerStat(Index, Stats.strength) + 30
SetPlayerStat Index, Stats.endurance, GetPlayerStat(Index, Stats.endurance) + 30
SetPlayerStat Index, Stats.intelligence, GetPlayerStat(Index, Stats.intelligence) + 30
SendPlayerData Index
SendStats Index
Else: PlayerMsg Index, "Não tem o level necessário", Red
End If
Exit Sub
End If
'=================
'Trans de Outro personagem;Vegita
'=================
If GetPlayerSprite(Index) = 3 Then ' sprite normal do vegita
If GetPlayerLevel(Index) >= 5 Then 'se for lvl 5 ou maior
SetPlayerSprite Index, 4 'sprite ssj do vegita
SetPlayerStat Index, Stats.strength, GetPlayerStat(Index, Stats.strength) + 30
SetPlayerStat Index, Stats.endurance, GetPlayerStat(Index, Stats.endurance) + 30
SetPlayerStat Index, Stats.intelligence, GetPlayerStat(Index, Stats.intelligence) + 30
SendPlayerData Index
SendStats Index
Else: PlayerMsg Index, "Não tem o level necessário", Red
End If
Exit Sub
End If
'----'
'Fim da Trans1 "ssj"
'--
Case 2 'SSJ2
'==========
'Trans SSJ2 do goku
'--------
If GetPlayerSprite(Index) = 1 Then ' se ele não tiver transformado
If GetPlayerLevel(Index) >= 10 Then ' se ele tiver lvl 10
SetPlayerSprite Index, 5 ' sprite ssj2 do goku
SetPlayerStat Index, Stats.strength, GetPlayerStat(Index, Stats.strength) + 60
SetPlayerStat Index, Stats.endurance, GetPlayerStat(Index, Stats.endurance) + 60
SetPlayerStat Index, Stats.intelligence, GetPlayerStat(Index, Stats.intelligence) + 60
SendPlayerData Index
SendStats Index
Else: PlayerMsg Index, "Não tem o level necessário", Red
End If
'Else: PlayerMsg Index, "Precisa voltar ao normal se quizer se transformar em outro nível", Red
Exit Sub
End If
If GetPlayerSprite(Index) = 3 Then ' se ele não tiver transformado
If GetPlayerLevel(Index) >= 10 Then ' se ele tiver lvl 10
SetPlayerSprite Index, 6 ' sprite ssj2 do vegita
SetPlayerStat Index, Stats.strength, GetPlayerStat(Index, Stats.strength) + 60
SetPlayerStat Index, Stats.endurance, GetPlayerStat(Index, Stats.endurance) + 60
SetPlayerStat Index, Stats.intelligence, GetPlayerStat(Index, Stats.intelligence) + 60
SendPlayerData Index
SendStats Index
Else: PlayerMsg Index, "Não tem o level necessário", Red
End If
'Else: PlayerMsg Index, "Precisa voltar ao normal se quizer se transformar em outro nível", Red
Exit Sub
End If
'==========
'Fim da trans SSJ2
'==========
Case 3 ' SSJ3
'agora,eh soh repetir pegando de exemplo os 2 casos acima
Case 4 'ssj4
Case 5 'ssj5..
'pode add qntas quizer mas tem q ser ANTES do end select
End Select
End Sub
Sub HandleVoltarNormal(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Buffer As clsBuffer
Set Buffer = New clsBuffer
Buffer.WriteBytes Data()
Set Buffer = Nothing
'DshFox
'OhYehBeibi.Webs.Com
'OhYehBeibi.Blogspot.com
Select Case GetPlayerSprite(Index)
Case 2 'sprite goku ssj
SetPlayerSprite Index, 1 'sprite do goku normal
SetPlayerStat Index, Stats.strength, GetPlayerStat(Index, Stats.strength) - 30
SetPlayerStat Index, Stats.endurance, GetPlayerStat(Index, Stats.endurance) - 30
SetPlayerStat Index, Stats.intelligence, GetPlayerStat(Index, Stats.intelligence) - 30
SendPlayerData Index
SendStats Index
Exit Sub
Case 4 'sprite vegita ssj
SetPlayerSprite Index, 3 'sprite do vegita normal
SetPlayerStat Index, Stats.strength, GetPlayerStat(Index, Stats.strength) - 30
SetPlayerStat Index, Stats.endurance, GetPlayerStat(Index, Stats.endurance) - 30
SetPlayerStat Index, Stats.intelligence, GetPlayerStat(Index, Stats.intelligence) - 30
SendPlayerData Index
SendStats Index
Exit Sub
Case 5 'sprite goku ssj2
SetPlayerSprite Index, 1 'sprite do goku normal
SetPlayerStat Index, Stats.strength, GetPlayerStat(Index, Stats.strength) - 60
SetPlayerStat Index, Stats.endurance, GetPlayerStat(Index, Stats.endurance) - 60
SetPlayerStat Index, Stats.intelligence, GetPlayerStat(Index, Stats.intelligence) - 60
SendPlayerData Index
SendStats Index
Exit Sub
Case 6 'sprite vegita ssj2
SetPlayerSprite Index, 3 'sprite do vegita normal
SetPlayerStat Index, Stats.strength, GetPlayerStat(Index, Stats.strength) - 60
SetPlayerStat Index, Stats.endurance, GetPlayerStat(Index, Stats.endurance) - 60
SetPlayerStat Index, Stats.intelligence, GetPlayerStat(Index, Stats.intelligence) - 60
SendPlayerData Index
SendStats Index
Exit Sub
End Select
End Sub
Procure por:
- Código:
CUntradeItem
Em Baixo Adcione:
- Código:
CTrans
CVoltarNormal
Já Está adicionado 2 transformações, só pra simplificar. então se você for botar mais transformações no client adicione:
- Código:
trans NumeroDaTransFormação
Créditos:
[size=12pt]DSHFOX[/size]
Por fazer tudo.
[size=12pt]Massurik[/size]
Por Postar aqui no forum
[size=12pt]DSHFOX[/size]
Por fazer tudo.
[size=12pt]Massurik[/size]
Por Postar aqui no forum