⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 draw monster.vb.svn-base

📁 MirUnleashed vb.net Module modMainServer Public WithEvents Socket As New WinsockServer Pub
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
                End If

                If DebugMode Then
                    AddChat("Mob Added, " & I, 3)
                End If
                Exit For

            End If
        Next I

    End Sub

    Public Sub RemoveMob(ByVal MobID As Integer)

        If DebugMode Then
        AddChat("Mob Removed, " & MobID, 3)
        End If

        RemoveTilePlayerCollsion(Mob(MobGameIndex(MobID)).X, Mob(MobGameIndex(MobID)).Y)

        TotalMob = TotalMob - 1

        Mob(MobGameIndex(MobID)).Exist = False


    End Sub


    Public Sub MobStand(ByVal Index As Integer)

        Mob(Index).Animation = Mob(Index).Animation + 1

        If Mob(Index).Animation >= 4 Then Mob(Index).Animation = 0

    End Sub

    Public Sub MobStun(ByVal Index As Integer)

        Mob(Index).Animation = Mob(Index).Animation + 1

        If Mob(Index).Animation >= 3 Then

            If Mob(Index).StackActionType(0) = PlayerActionType.Stun Then
                MobUseStack(Index)
            Else
                Mob(Index).ActionState = 0
                Mob(Index).Animation = 0
                Exit Sub
            End If

            Mob(Index).Animation = 0

        End If

    End Sub

    Public Sub MobDie(ByVal Index As Integer)

        Mob(Index).Animation = Mob(Index).Animation + 1

        If Mob(Index).Animation >= 10 Then

            Mob(Index).ActionState = 0
            Mob(Index).Animation = 0

        End If

    End Sub

    Public Sub MobUseStack(ByVal Index As Integer)
        If Mob(Index).StackExist(0) = True Then

            'remove tile
            If Mob(Index).StackActionType(0) = PlayerActionType.Move Then
                RemoveTilePlayerCollsion(Mob(Index).X, Mob(Index).Y)
            End If

            Mob(Index).Direction = Mob(Index).StackDirection(0)
            Mob(Index).X = Mob(Index).StackCordX(0)
            Mob(Index).Y = Mob(Index).StackCordY(0)
            Mob(Index).Animation = 0
            Mob(Index).StackExist(0) = False

            If Mob(Index).StackActionType(0) = PlayerActionType.Move Then
                Mob(Index).ActionState = 1
            ElseIf Mob(Index).StackActionType(0) = PlayerActionType.Attack Then
                Mob(Index).ActionState = 2
                'MobSound(2, Index)
            ElseIf Mob(Index).StackActionType(0) = PlayerActionType.Stun Then
                Mob(Index).ActionState = 3
                'MobSound(4, Index)
            ElseIf Mob(Index).StackActionType(0) = PlayerActionType.Die Then
                Mob(Index).ActionState = 4
                Mob(Index).IsDead = True
                'MobSound(5, Index)
            End If


            'add tile
            If Mob(Index).StackActionType(0) = PlayerActionType.Move Then
                AddTilePlayerCollsion(Mob(Index).X, Mob(Index).Y)
            End If

            Dim I As Short
            'If Not Actor.StackItems = 0 Then
            For I = 0 To 14
                Mob(Index).StackCordX(I) = Mob(Index).StackCordX(I + 1)
                Mob(Index).StackCordY(I) = Mob(Index).StackCordY(I + 1)
                Mob(Index).StackDirection(I) = Mob(Index).StackDirection(I + 1)
                Mob(Index).StackExist(I) = Mob(Index).StackExist(I + 1)
                Mob(Index).StackActionType(I) = Mob(Index).StackActionType(I + 1)
            Next I
            'End If

            Mob(Index).StackItems = Mob(Index).StackItems - 1
        End If
    End Sub

    Public Sub MobMove(ByVal Index As Integer)

        If Mob(Index).Animation >= 5 Then
            Mob(Index).CordX = Mob(Index).X
            Mob(Index).CordY = Mob(Index).Y
            Mob(Index).Animation = 0

            'check stack for any items
            If Not Mob(Index).StackItems = 0 Then

                Dim I As Integer

                'take out first item of stack and use it
                If Mob(Index).StackActionType(0) = PlayerActionType.Move Then
                    MobUseStack(Index)
                Else
                    Mob(Index).ActionState = 0
                    Mob(Index).Animation = 0
                    Exit Sub
                End If


            Else
                Mob(Index).Animation = 0
                Mob(Index).ActionState = 0
                Exit Sub
            End If

        End If

        If Mob(Index).ActionState = 1 Then
            If Mob(Index).Direction = 0 Then
                Mob(Index).CordY = Mob(Index).CordY - MobMoveAmount(Index)
                'Mob(Index).CordY = SymArith(Mob(Index).CordY, 2)
                Mob(Index).Animation = Mob(Index).Animation + 1
            ElseIf Mob(Index).Direction = 1 Then
                Mob(Index).Animation = Mob(Index).Animation + 1
                Mob(Index).CordY = Mob(Index).CordY - MobMoveAmount(Index)
                'Mob(Index).CordY = SymArith(Mob(Index).CordY, 2)
                Mob(Index).CordX = Mob(Index).CordX + MobMoveAmount(Index)
                'Mob(Index).CordX = SymArith(Mob(Index).CordX, 2)
            ElseIf Mob(Index).Direction = 2 Then
                Mob(Index).CordX = Mob(Index).CordX + MobMoveAmount(Index)
                'Mob(Index).CordX = SymArith(Mob(Index).CordX, 2)
                Mob(Index).Animation = Mob(Index).Animation + 1
            ElseIf Mob(Index).Direction = 3 Then
                Mob(Index).Animation = Mob(Index).Animation + 1
                Mob(Index).CordX = Mob(Index).CordX + MobMoveAmount(Index)
                'Mob(Index).CordX = SymArith(Mob(Index).CordX, 2)
                Mob(Index).CordY = Mob(Index).CordY + MobMoveAmount(Index)
                'Mob(Index).CordY = SymArith(Mob(Index).CordY, 2)
            ElseIf Mob(Index).Direction = 4 Then
                Mob(Index).Animation = Mob(Index).Animation + 1
                Mob(Index).CordY = Mob(Index).CordY + MobMoveAmount(Index)
                'Mob(Index).CordY = SymArith(Mob(Index).CordY, 2)
            ElseIf Mob(Index).Direction = 5 Then
                Mob(Index).Animation = Mob(Index).Animation + 1
                Mob(Index).CordX = Mob(Index).CordX - MobMoveAmount(Index)
                'Mob(Index).CordX = SymArith(Mob(Index).CordX, 2)
                Mob(Index).CordY = Mob(Index).CordY + MobMoveAmount(Index)
                ' Mob(Index).CordY = SymArith(Mob(Index).CordY, 2)
            ElseIf Mob(Index).Direction = 6 Then
                Mob(Index).Animation = Mob(Index).Animation + 1
                Mob(Index).CordX = Mob(Index).CordX - MobMoveAmount(Index)
                'Mob(Index).CordX = SymArith(Mob(Index).CordX, 2)
            ElseIf Mob(Index).Direction = 7 Then
                Mob(Index).Animation = Mob(Index).Animation + 1
                Mob(Index).CordX = Mob(Index).CordX - MobMoveAmount(Index)
                'Mob(Index).CordX = SymArith(Mob(Index).CordX, 2)
                Mob(Index).CordY = Mob(Index).CordY - MobMoveAmount(Index)
                'Mob(Index).CordY = SymArith(Mob(Index).CordY, 2)
            End If
        End If


    End Sub

    Function MobMoveAmount(ByVal Index As Integer)
        Dim Quantity As Double = 1 / 5

        If Player(Index).Animation = 0 Then
            MobMoveAmount = Quantity * 1
        ElseIf Player(Index).Animation = 1 Then
            MobMoveAmount = Quantity * 1
        ElseIf Player(Index).Animation = 2 Then
            MobMoveAmount = Quantity * 1
        ElseIf Player(Index).Animation = 3 Then
            MobMoveAmount = Quantity * 1
        ElseIf Player(Index).Animation = 4 Then
            MobMoveAmount = Quantity * 1
        ElseIf Player(Index).Animation = 5 Then
            MobMoveAmount = Quantity * 1
        ElseIf Player(Index).Animation = 6 Then
            'MobMoveAmount = 0.15 * Player(Index).MoveType
        End If

    End Function

    Public Sub ChangeMobHPMP(ByVal MobServerID As Integer, ByVal Type As Short, ByVal Value As Integer)

        If Type = 0 Then 'hp

            Mob(MobGameIndex(MobServerID)).HP = Value

        Else 'mp

            Mob(MobGameIndex(MobServerID)).MP = Value

        End If

    End Sub

End Module

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -