📄 timers.vb.svn-base
字号:
'### Visual Basic.NET and Direct X9 Legend of MiR Project ###'
'### Mir Unleashed Client Timers Module ###'
'### http://www.lomcn.co.uk ###' '### Credits to TrueADM and DeathWish ###'
'This updates our timers so we can see images move (animations etc)
'Done for players, actor, npcs, monsters etc.
Module MirTimers
Public Sub CheckTimers()
PlayerActionTimer()
NPCActionTimer()
MonsterActionTimer()
MagicActionTimer()
End Sub
Public Sub PlayerActionTimer()
'Update all actions for actor/players
'check if actor is standing
If (LastPlayerStand + 500 * 10000) < DateTime.Now.Ticks Then
If DateTime.Now.Ticks > Actor.StanceTick + (2000 * 10000) Then
Actor.Stance = 0
End If
If Actor.ActionState = 0 And Actor.Stance = 0 Then
ActorStand()
End If
Dim I As Integer
Dim TempInt As Integer
For I = 0 To 1000
If Player(I).Exist = True And Player(I).IsDead = False Then
If DateTime.Now.Ticks > Player(I).StanceTick + (2000 * 10000) Then
Player(I).Stance = 0
End If
'check if player is standing
If Player(I).ActionState = 0 And Player(I).Stance = 0 Then
PlayerStand(I)
End If
TempInt = TempInt + 1
End If
If TempInt = TotalPlayer Then Exit For
Next I
LastPlayerStand = DateTime.Now.Ticks
ElseIf LastPlayerStun + (200 * 10000) < DateTime.Now.Ticks Then
'if player hasnt started moving then we use it now
If Actor.ActionState = 0 And Actor.StackItems > 0 And Actor.StackActionType(0) = PlayerActionType.Stun Then
ActorUseStack()
End If
If Actor.ActionState = 3 Then
ActorStun()
End If
Dim I As Integer
Dim TempInt As Integer
For I = 0 To 1000
If Player(I).Exist = True And Player(I).IsDead = False Then
'check if player is moving
If Player(I).ActionState = 0 And Player(I).StackItems > 0 And Player(I).StackActionType(0) = PlayerActionType.Stun Then
PlayerUseStack(I)
End If
If Player(I).ActionState = 3 Then
PlayerStun(I)
End If
TempInt = TempInt + 1
End If
If TempInt = TotalPlayer Then Exit For
Next I
LastPlayerStun = DateTime.Now.Ticks
ElseIf LastPlayerAttack + (100 * 10000) < DateTime.Now.Ticks Then
'if player hasnt started moving then we use it now
If Actor.ActionState = 0 And Actor.StackItems > 0 And Actor.StackActionType(0) = PlayerActionType.Attack Then
ActorUseStack()
End If
If Actor.ActionState = 2 Then
ActorAttack()
End If
Dim I As Integer
Dim TempInt As Integer
For I = 0 To 1000
If Player(I).Exist = True And Player(I).IsDead = False Then
'check if player is moving
If Player(I).ActionState = 0 And Player(I).StackItems > 0 And Player(I).StackActionType(0) = PlayerActionType.Attack Then
PlayerUseStack(I)
End If
If Player(I).ActionState = 2 Then
PlayerAttack(I)
End If
TempInt = TempInt + 1
End If
If TempInt = TotalPlayer Then Exit For
Next I
LastPlayerAttack = DateTime.Now.Ticks
ElseIf LastPlayerCast + (100 * 10000) < DateTime.Now.Ticks Then
'if player hasnt started moving then we use it now
If Actor.ActionState = 0 And Actor.StackItems > 0 And Actor.StackActionType(0) = PlayerActionType.Cast Then
ActorUseStack()
End If
If Actor.ActionState = 7 Then
ActorCast()
End If
Dim I As Integer
Dim TempInt As Integer
For I = 0 To 1000
If Player(I).Exist = True And Player(I).IsDead = False Then
'check if player is moving
If Player(I).ActionState = 0 And Player(I).StackItems > 0 And Player(I).StackActionType(0) = PlayerActionType.Cast Then
PlayerUseStack(I)
End If
If Player(I).ActionState = 7 Then
PlayerCast(I)
End If
TempInt = TempInt + 1
End If
If TempInt = TotalPlayer Then Exit For
Next I
LastPlayerCast = DateTime.Now.Ticks
ElseIf LastPlayerDie + (200 * 10000) < DateTime.Now.Ticks Then
'if player hasnt started moving then we use it now
If Actor.ActionState = 0 And Actor.StackItems > 0 And Actor.StackActionType(0) = PlayerActionType.Die Then
ActorUseStack()
End If
If Actor.ActionState = 4 Then
ActorDie()
End If
Dim I As Integer
Dim TempInt As Integer
For I = 0 To 1000
If Player(I).Exist = True Then
'check if player is moving
If Player(I).ActionState = 0 And Player(I).StackItems > 0 And Player(I).StackActionType(0) = PlayerActionType.Die Then
PlayerUseStack(I)
End If
If Player(I).ActionState = 4 Then
PlayerDie(I)
End If
TempInt = TempInt + 1
End If
If TempInt = TotalPlayer Then Exit For
Next I
LastPlayerDie = DateTime.Now.Ticks
ElseIf LastPlayerMove + (140 * 10000) < DateTime.Now.Ticks Then
'if player hasnt started moving then we use it now
If Actor.ActionState = 0 And Actor.StackItems > 0 And Actor.StackActionType(0) = PlayerActionType.Move Then
ActorUseStack()
End If
If Actor.ActionState = 1 Then
ActorMove()
End If
Dim I As Integer
Dim TempInt As Integer
For I = 0 To 1000
If Player(I).Exist = True And Player(I).IsDead = False Then
'check if player is moving
If Player(I).ActionState = 0 And Player(I).StackItems > 0 And Player(I).StackActionType(0) = PlayerActionType.Move Then
PlayerUseStack(I)
End If
If Player(I).ActionState = 1 Then
PlayerMove(I)
End If
TempInt = TempInt + 1
End If
If TempInt = TotalPlayer Then Exit For
Next I
LastPlayerMove = DateTime.Now.Ticks
End If
End Sub
Public Sub NPCActionTimer()
If (NPCActionLastTick + (600 * 10000)) < DateTime.Now.Ticks Then
'npc stand animation
Dim I As Integer
Dim TempI As Integer
For I = 0 To 1000
If NPC(I).Exist = True Then
NPC(I).Animation = NPC(I).Animation + 1
If NPC(I).Animation >= 4 Then NPC(I).Animation = 0
TempI = TempI + 1
End If
If TempI = TotalNPC Then Exit For
Next I
NPCActionLastTick = DateTime.Now.Ticks
End If
End Sub
Public Sub MonsterActionTimer()
'mob stand
If (LastMobStandTick + (600 * 10000)) < DateTime.Now.Ticks Then
Dim I As Integer
Dim TempI As Integer
For I = 0 To 1000
If Mob(I).Exist = True And Mob(I).IsDead = False Then
If Mob(I).ActionState = 0 Then
MobStand(I)
End If
TempI = TempI + 1
End If
If TempI = TotalMob Then Exit For
Next I
LastMobStandTick = DateTime.Now.Ticks
ElseIf (LastMobDieTick + (100 * 10000)) < DateTime.Now.Ticks Then
Dim I As Integer
Dim TempI As Integer
For I = 0 To 1000
If Mob(I).Exist = True Then
If Mob(I).ActionState = 0 And Mob(I).StackItems > 0 And Mob(I).StackActionType(0) = PlayerActionType.Die Then
MobUseStack(I)
End If
If Mob(I).ActionState = 4 Then
MobDie(I)
End If
TempI = TempI + 1
End If
If TempI = TotalMob Then Exit For
Next I
LastMobDieTick = DateTime.Now.Ticks
ElseIf (LastMobAttackTick + (100 * 10000)) < DateTime.Now.Ticks Then
Dim I As Integer
Dim TempI As Integer
For I = 0 To 1000
If Mob(I).Exist = True And Mob(I).IsDead = False Then
If Mob(I).ActionState = 0 And Mob(I).StackItems > 0 And Mob(I).StackActionType(0) = PlayerActionType.Attack Then
MobUseStack(I)
End If
If Mob(I).ActionState = 2 Then
MobAttack(I)
End If
TempI = TempI + 1
End If
If TempI = TotalMob Then Exit For
Next I
LastMobAttackTick = DateTime.Now.Ticks
ElseIf (LastMobStunTick + (150 * 10000)) < DateTime.Now.Ticks Then
Dim I As Integer
Dim TempI As Integer
For I = 0 To 1000
If Mob(I).Exist = True And Mob(I).IsDead = False Then
If Mob(I).ActionState = 0 And Mob(I).StackItems > 0 And Mob(I).StackActionType(0) = PlayerActionType.Stun Then
MobUseStack(I)
End If
If Mob(I).ActionState = 3 Then
MobStun(I)
End If
TempI = TempI + 1
End If
If TempI = TotalMob Then Exit For
Next I
LastMobStunTick = DateTime.Now.Ticks
ElseIf (LastMobMoveTick + (140 * 10000)) < DateTime.Now.Ticks Then
Dim I As Integer
Dim TempI As Integer
For I = 0 To 1000
If Mob(I).Exist = True And Mob(I).IsDead = False Then
If Mob(I).ActionState = 0 And Mob(I).StackItems > 0 And Mob(I).StackActionType(0) = PlayerActionType.Move Then
MobUseStack(I)
End If
If Mob(I).ActionState = 1 Then
MobMove(I)
End If
TempI = TempI + 1
End If
If TempI = TotalMob Then Exit For
Next I
LastMobMoveTick = DateTime.Now.Ticks
End If
End Sub
Public Sub MagicActionTimer()
If (MagicActionLastTick + (50 * 10000)) < DateTime.Now.Ticks Then
Dim I, S As Integer
Dim TempI As Integer
For I = 0 To 1000
If Magic(I).Exist = True Then
If Magic(I).TickMiss = Magic(I).Ticks Then
Magic(I).Animation = Magic(I).Animation + 1
If Magic(I).Animation + Magic(I).StartFrame >= Magic(I).EndFrame Then
RemoveMagic(I)
End If
Magic(I).Ticks = 0
Else
Magic(I).Ticks = Magic(I).Ticks + 1
End If
TempI = TempI + 1
End If
If TempI = TotalMagic Then Exit For
Next I
MagicActionLastTick = DateTime.Now.Ticks
End If
End Sub
End Module
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -