Convidado Convidado
| Assunto: [ALL]Andar Com Mouse Dom 14 Nov 2010, 18:57 | |
| Client-SideFaça um novo check lá no picOptions com essas configurações: - Citação :
- Caption = Andar Com Mouse
Agora clica duas vezes no Check e poe esse codigo. - Citação :
- Call PutVar(App.Path & "\config.ini", "CONFIG", "MouseMovement", Check1.Value)
Mais antes verifique se o nome do check está "Check1". Agora no modgamelogic no fim ponha essa nova função: - Citação :
- 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 axe: - Citação :
- Private Sub picScreen_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Ai troque tudo por: - Citação :
- 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 axe: - Citação :
- Public MouseX As Long
Public MouseY As Long Em baixo ponha: - Citação :
- Public XToGo As Long
Public YToGo As Long axe no modGamelogic: - Citação :
- ' Blit the backbuffer
Call DD_PrimarySurf.Blt(rec_pos, DD_BackBuffer, rec, DDBLT_WAIT) embaixo ponha: - Citação :
- 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: - Citação :
- Sub CheckInput(ByVal KeyState As Byte, ByVal KeyCode As Integer, ByVal Shift As Integer)
ai troque tudo por: - Citação :
- 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: - Citação :
- XToGo = -1
YToGo = -1 Créditos: Lucas Lôpo MMORPGBR |
|
Lucas Roberto Administrador
Mensagens : 711
| Assunto: Re: [ALL]Andar Com Mouse Dom 14 Nov 2010, 18:58 | |
| Fico Muito bom +1 de CRED | |
|
Convidado Convidado
| Assunto: Re: [ALL]Andar Com Mouse Sáb 26 Nov 2011, 00:34 | |
| uhuhu,vo usar valeu ae,dps quando meu jogo já tiver com bastante coisa coloca um topico ae =) |
|
Conteúdo patrocinado
| Assunto: Re: [ALL]Andar Com Mouse | |
| |
|