Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Andar com Mouse

Ir para baixo

Andar com Mouse Empty Andar com Mouse

Mensagem  Pablo Qua Set 19, 2012 5:42 pm

Client-Side

Faça um novo check lá no picOptions com essas configurações:

Citar
Caption = Andar Com Mouse

Agora clica duas vezes no Check e poe esse codigo.

Código:
Call PutVar(App.Path & "\config.ini", "CONFIG", "MouseMovement", Check1.Value)
Mas antes verifique se o nome do check está "Check1".

Agora no ModGameLogic no fim ponha essa nova função:

Código:
Public Function MouseCheck() As Boolean

If Val(GetVar(App.Path & "\config.ini", "CONFIG", "MouseMovement")) = 1 Then
MouseCheck = True
Else
MouseCheck = False
End If
End Function
Agora va na frmMirage e ache:

Código:
Private Sub picScreen_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Ai troque tudo por:

Código:
Dim I As Long

If InSpawnEditor Then
If SpawnLocator > 0 Then
TempNpcSpawn(SpawnLocator).Used = 1
TempNpcSpawn(SpawnLocator).x = Int((x + (NewPlayerX * PIC_X)) / PIC_X)
TempNpcSpawn(SpawnLocator).y = Int((y + (NewPlayerY * PIC_Y)) / PIC_Y)
frmMapProperties.Spawn(SpawnLocator - 1).Caption = "(" & TempNpcSpawn(SpawnLocator).x & ", " & TempNpcSpawn(SpawnLocator).y & ")"
SpawnLocator = 0
End If

Exit Sub
End If

If (Button = 1 Or Button = 2) And InEditor = True Then
Call EditorMouseDown(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If

If MouseCheck = True Then
If Button = 1 And InEditor = False Then
ControlDown = True
Call CheckAttack
End If
End If

If MouseCheck = False Then
If Button = 1 And InEditor = False Then
ControlDown = False
Call PlayerSearch(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If
End If

If MouseCheck = False Then
If Button = 2 Then
Call PlayerSearch(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If
End If

If (Button = 1 Or Button = 2) And InEditor = False Then
If Button = 1 And Player(MyIndex).Pet.Alive = YES Then
Call PetMove(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If
End If

If MouseCheck = True Then
If Button = 2 Then
XToGo = (x + (NewPlayerX * PIC_X)) / PIC_X
YToGo = (y + (NewPlayerY * PIC_Y)) / PIC_Y
Call CheckMapGetItem
End If
End If

If MouseCheck = True Then
If Button = 1 Then
Call PlayerSearch(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If
End If
Novamente no modGamelogic ache:

Código:
Public MouseX As Long
Public MouseY As Long
Embaixo ponha:

Código:
Public XToGo As Long
Public YToGo As Long

Ache no modGamelogic:

Código:
' Blit the backbuffer
Call DD_PrimarySurf.Blt(rec_pos, DD_BackBuffer, rec, DDBLT_WAIT)
Embaixo ponha:

Código:
If XToGo <> -1 Or YToGo <> -1 Then
Dim XDif As Long
Dim YDif As Long

XDif = Abs(GetPlayerX(MyIndex) - XToGo)
YDif = Abs(GetPlayerY(MyIndex) - YToGo)

If XToGo = GetPlayerX(MyIndex) Or XToGo = -1 Then
XToGo = -1
XDif = 0
Else
XDif = Abs(GetPlayerX(MyIndex) - XToGo)
End If

If YToGo = GetPlayerY(MyIndex) Or YToGo = -1 Then
YToGo = -1
YDif = 0
Else
YDif = Abs(GetPlayerY(MyIndex) - YToGo)
End If

Debug.Print (XDif & " " & YDif)

If XDif > YDif Then
If GetPlayerX(MyIndex) - XToGo > 0 Then
DirLeft = True
Else
DirRight = True
End If
End If

If YDif > XDif Then
If GetPlayerY(MyIndex) - YToGo > 0 Then
DirUp = True
Else
DirDown = True
End If
End If

If XDif = YDif And XDif <> 0 And YDif <> 0 Then
' I'll be nice and give you the non-directional movement code
'If Int(Rnd * 2) = 0 Then
If GetPlayerX(MyIndex) - XToGo > 0 Then
DirLeft = True
Else
DirRight = True
End If
' Else
If GetPlayerY(MyIndex) - YToGo > 0 Then
DirUp = True
Else
DirDown = True
End If
'End If
End If
End If
Ache:

Código:
Sub CheckInput(ByVal KeyState As Byte, ByVal KeyCode As Integer, ByVal Shift As Integer)
Ai troque tudo por:

Código:
If GettingMap = False Then
If KeyState = 1 Then
If KeyCode = vbKeyReturn Then
Call CheckMapGetItem
End If
If KeyCode = vbKeyControl Then
ControlDown = True
End If
If KeyCode = vbKeyUp Then
DirUp = True
DirDown = False
DirLeft = False
DirRight = False
End If
If KeyCode = vbKeyDown Then
DirUp = False
DirDown = True
DirLeft = False
DirRight = False
End If
If KeyCode = vbKeyLeft Then
DirUp = False
DirDown = False
DirLeft = True
DirRight = False
End If
If KeyCode = vbKeyRight Then
DirUp = False
DirDown = False
DirLeft = False
DirRight = True
End If
If KeyCode = vbKeyShift Then
ShiftDown = True
End If
Else
If KeyCode = vbKeyUp Then
XToGo = -1
YToGo = -1
End If
If KeyCode = vbKeyDown Then
XToGo = -1
YToGo = -1
End If
If KeyCode = vbKeyLeft Then
XToGo = -1
YToGo = -1
End If
If KeyCode = vbKeyRight Then
XToGo = -1
YToGo = -1
End If
If KeyCode = vbKeyShift Then ShiftDown = False
If KeyCode = vbKeyControl Then ControlDown = False
End If
End If
Em modClientTCP na Sub TcpInit() ali em baixo onde tem PlayerBuffer = "" em baixo ponha:

Código:
XToGo = -1
YToGo = -1
Tutorial terminado Galera!

Créditos: Lucas Lopo
Pablo
Pablo
Admin

Mensagens : 1
Agradecimentos : 1
Data de inscrição : 21/08/2012

http://worldrpgbr.ativoforum.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