Convidado Convidado
| Assunto: Andando com o Mouse Sáb 25 Jun 2011, 10:18 | |
| Bom sem muito papo galera bora começar.Client-Side
Faça um novo check lá no picOptions com essas configurações: - Código:
-
Caption = Andar Com [b]Mouse[/b] 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 vá no frmMirage e procure por: - 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 Novamente no modGamelogic procure por: - Código:
-
Public MouseX As Long Public MouseY As Long Embaixo coloque: - Código:
-
Public XToGo As Long Public YToGo As Long procure 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 Procure por: S - Código:
-
ub 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 Ufa..Acabo Nao Precisa Explicar o Nome ja diz tudo.Creditos:Lucas Lopô |
|