FrmMain.frm
上传用户:pcw2004
上传日期:2022-02-02
资源大小:743k
文件大小:89k
源码类别:

DirextX编程

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Begin VB.Form FrmMain 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "VB游戏服务器"
  6.    ClientHeight    =   4470
  7.    ClientLeft      =   6195
  8.    ClientTop       =   4035
  9.    ClientWidth     =   6090
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4470
  14.    ScaleWidth      =   6090
  15.    Begin VB.CommandButton Command1 
  16.       Caption         =   "生效"
  17.       Height          =   375
  18.       Left            =   2280
  19.       TabIndex        =   4
  20.       Top             =   3720
  21.       Width           =   1095
  22.    End
  23.    Begin VB.TextBox Text1 
  24.       Height          =   375
  25.       Left            =   1080
  26.       TabIndex        =   3
  27.       Text            =   "1"
  28.       Top             =   3720
  29.       Width           =   1095
  30.    End
  31.    Begin VB.FileListBox File1 
  32.       Height          =   810
  33.       Left            =   4080
  34.       Pattern         =   "*.txt"
  35.       TabIndex        =   1
  36.       Top             =   720
  37.       Visible         =   0   'False
  38.       Width           =   735
  39.    End
  40.    Begin VB.Timer Timer1 
  41.       Enabled         =   0   'False
  42.       Interval        =   1
  43.       Left            =   120
  44.       Top             =   2520
  45.    End
  46.    Begin MSWinsockLib.Winsock LoginServer 
  47.       Index           =   0
  48.       Left            =   360
  49.       Top             =   240
  50.       _ExtentX        =   741
  51.       _ExtentY        =   741
  52.       _Version        =   393216
  53.    End
  54.    Begin MSWinsockLib.Winsock Server 
  55.       Index           =   0
  56.       Left            =   960
  57.       Top             =   240
  58.       _ExtentX        =   741
  59.       _ExtentY        =   741
  60.       _Version        =   393216
  61.    End
  62.    Begin VB.TextBox Text 
  63.       Height          =   3615
  64.       Left            =   0
  65.       MultiLine       =   -1  'True
  66.       ScrollBars      =   2  'Vertical
  67.       TabIndex        =   0
  68.       Top             =   0
  69.       Width           =   6015
  70.    End
  71.    Begin VB.Label Label1 
  72.       AutoSize        =   -1  'True
  73.       BackStyle       =   0  'Transparent
  74.       Caption         =   "经验值倍数"
  75.       Height          =   180
  76.       Left            =   0
  77.       TabIndex        =   2
  78.       Top             =   3840
  79.       Width           =   900
  80.    End
  81. End
  82. Attribute VB_Name = "FrmMain"
  83. Attribute VB_GlobalNameSpace = False
  84. Attribute VB_Creatable = False
  85. Attribute VB_PredeclaredId = True
  86. Attribute VB_Exposed = False
  87. Option Explicit
  88. Dim LoginCount As Integer
  89. Sub MonAttackData(MonID As Long)
  90.     Dim i As Integer
  91.     Dim GongVal As Long
  92.     Dim ShangHai As Long
  93.     If Mon(MonID).Pic = 3 And Mon(MonID).PicSpeed = 0 Then
  94.         Select Case Mon(MonID).Face
  95.             Case FaceInfo.UpFace
  96.                 If Abs(Player(Mon(MonID).追击目标).X - Mon(MonID).X) = 1 Or Abs(Player(Mon(MonID).追击目标).Y - Mon(MonID).Y) = 1 Then
  97.                     GongVal = Abs(Rnd * (Mon(MonID).DBInfo.DC_攻击力 - Mon(MonID).DBInfo.DCMax_最大攻击力) + IIf(Mon(MonID).DBInfo.DCMax_最大攻击力 > Mon(MonID).DBInfo.DC_攻击力, Mon(MonID).DBInfo.DCMax_最大攻击力, Mon(MonID).DBInfo.DC_攻击力))
  98.                     ShangHai = GongVal - (Abs(Rnd * (Player(Mon(MonID).追击目标).AC1 - Player(Mon(MonID).追击目标).Ac2) + IIf(Player(Mon(MonID).追击目标).Ac2 - Player(Mon(MonID).追击目标).AC1, Player(Mon(MonID).追击目标).Ac2, Player(Mon(MonID).追击目标).AC1)))
  99.                     If ShangHai > 0 And Player(Mon(MonID).追击目标).HP > 0 Then
  100.                         Player(Mon(MonID).追击目标).HP = Player(Mon(MonID).追击目标).HP - ShangHai
  101.                         If Player(Mon(MonID).追击目标).HP > 0 Then
  102.                             Player(Mon(MonID).追击目标).Act = Bruise_受伤
  103.                             Player(Mon(MonID).追击目标).Pic = 0
  104.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  105.                         Else
  106.                             Player(Mon(MonID).追击目标).Act = Dead_死亡
  107.                             Player(Mon(MonID).追击目标).Pic = 0
  108.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  109.                         End If
  110.                         
  111.                         For i = 1 To playercount
  112.                             If Player(i).Connected = True Then
  113.                                 If Server(i).State = sckConnected Then
  114.                                     Server(i).SendData PLAYERHP & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).HP & KONGDATA & Player(Mon(MonID).追击目标).MaxHP & NETKONGDATA
  115.                                     Server(i).SendData PLAYERACTDATA & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).Act & KONGDATA & Player(Mon(MonID).追击目标).Pic & NETKONGDATA
  116.                                 End If
  117.                             End If
  118.                         Next
  119.                     End If
  120.                 End If
  121.             Case FaceInfo.RightUpFace
  122.                 If Player(Mon(MonID).追击目标).X = Mon(MonID).X + 1 And Player(Mon(MonID).追击目标).Y = Mon(MonID).Y - 1 Then
  123.                     GongVal = Abs(Rnd * (Mon(MonID).DBInfo.DC_攻击力 - Mon(MonID).DBInfo.DCMax_最大攻击力) + IIf(Mon(MonID).DBInfo.DCMax_最大攻击力 > Mon(MonID).DBInfo.DC_攻击力, Mon(MonID).DBInfo.DCMax_最大攻击力, Mon(MonID).DBInfo.DC_攻击力))
  124.                     ShangHai = GongVal - (Abs(Rnd * (Player(Mon(MonID).追击目标).AC1 - Player(Mon(MonID).追击目标).Ac2) + IIf(Player(Mon(MonID).追击目标).Ac2 - Player(Mon(MonID).追击目标).AC1, Player(Mon(MonID).追击目标).Ac2, Player(Mon(MonID).追击目标).AC1)))
  125.                     If ShangHai > 0 And Player(Mon(MonID).追击目标).HP > 0 Then
  126.                         Player(Mon(MonID).追击目标).HP = Player(Mon(MonID).追击目标).HP - ShangHai
  127.                         If Player(Mon(MonID).追击目标).HP > 0 Then
  128.                             Player(Mon(MonID).追击目标).Act = Bruise_受伤
  129.                             Player(Mon(MonID).追击目标).Pic = 0
  130.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  131.                         Else
  132.                             Player(Mon(MonID).追击目标).Act = Dead_死亡
  133.                             Player(Mon(MonID).追击目标).Pic = 0
  134.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  135.                         End If
  136.                         
  137.                         For i = 1 To playercount
  138.                             If Player(i).Connected = True Then
  139.                                 If Server(i).State = sckConnected Then
  140.                                     Server(i).SendData PLAYERHP & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).HP & KONGDATA & Player(Mon(MonID).追击目标).MaxHP & NETKONGDATA
  141.                                     Server(i).SendData PLAYERACTDATA & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).Act & KONGDATA & Player(Mon(MonID).追击目标).Pic & NETKONGDATA
  142.                                 End If
  143.                             End If
  144.                         Next
  145.                     End If
  146.                 End If
  147.             Case FaceInfo.RightFace
  148.                 If Player(Mon(MonID).追击目标).X = Mon(MonID).X + 1 And Player(Mon(MonID).追击目标).Y = Mon(MonID).Y Then
  149.                     GongVal = Abs(Rnd * (Mon(MonID).DBInfo.DC_攻击力 - Mon(MonID).DBInfo.DCMax_最大攻击力) + IIf(Mon(MonID).DBInfo.DCMax_最大攻击力 > Mon(MonID).DBInfo.DC_攻击力, Mon(MonID).DBInfo.DCMax_最大攻击力, Mon(MonID).DBInfo.DC_攻击力))
  150.                     ShangHai = GongVal - (Abs(Rnd * (Player(Mon(MonID).追击目标).AC1 - Player(Mon(MonID).追击目标).Ac2) + IIf(Player(Mon(MonID).追击目标).Ac2 - Player(Mon(MonID).追击目标).AC1, Player(Mon(MonID).追击目标).Ac2, Player(Mon(MonID).追击目标).AC1)))
  151.                     If ShangHai > 0 And Player(Mon(MonID).追击目标).HP > 0 Then
  152.                         Player(Mon(MonID).追击目标).HP = Player(Mon(MonID).追击目标).HP - ShangHai
  153.                         If Player(Mon(MonID).追击目标).HP > 0 Then
  154.                             Player(Mon(MonID).追击目标).Act = Bruise_受伤
  155.                             Player(Mon(MonID).追击目标).Pic = 0
  156.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  157.                         Else
  158.                             Player(Mon(MonID).追击目标).Act = Dead_死亡
  159.                             Player(Mon(MonID).追击目标).Pic = 0
  160.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  161.                         End If
  162.                         
  163.                         For i = 1 To playercount
  164.                             If Player(i).Connected = True Then
  165.                                 If Server(i).State = sckConnected Then
  166.                                     Server(i).SendData PLAYERHP & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).HP & KONGDATA & Player(Mon(MonID).追击目标).MaxHP & NETKONGDATA
  167.                                     Server(i).SendData PLAYERACTDATA & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).Act & KONGDATA & Player(Mon(MonID).追击目标).Pic & NETKONGDATA
  168.                                 End If
  169.                             End If
  170.                         Next
  171.                     End If
  172.                 End If
  173.             Case FaceInfo.RightDownFace
  174.                 If Player(Mon(MonID).追击目标).X = Mon(MonID).X + 1 And Player(Mon(MonID).追击目标).Y = Mon(MonID).Y + 1 Then
  175.                     GongVal = Abs(Rnd * (Mon(MonID).DBInfo.DC_攻击力 - Mon(MonID).DBInfo.DCMax_最大攻击力) + IIf(Mon(MonID).DBInfo.DCMax_最大攻击力 > Mon(MonID).DBInfo.DC_攻击力, Mon(MonID).DBInfo.DCMax_最大攻击力, Mon(MonID).DBInfo.DC_攻击力))
  176.                     ShangHai = GongVal - (Abs(Rnd * (Player(Mon(MonID).追击目标).AC1 - Player(Mon(MonID).追击目标).Ac2) + IIf(Player(Mon(MonID).追击目标).Ac2 - Player(Mon(MonID).追击目标).AC1, Player(Mon(MonID).追击目标).Ac2, Player(Mon(MonID).追击目标).AC1)))
  177.                     If ShangHai > 0 And Player(Mon(MonID).追击目标).HP > 0 Then
  178.                         Player(Mon(MonID).追击目标).HP = Player(Mon(MonID).追击目标).HP - ShangHai
  179.                         If Player(Mon(MonID).追击目标).HP > 0 Then
  180.                             Player(Mon(MonID).追击目标).Act = Bruise_受伤
  181.                             Player(Mon(MonID).追击目标).Pic = 0
  182.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  183.                         Else
  184.                             Player(Mon(MonID).追击目标).Act = Dead_死亡
  185.                             Player(Mon(MonID).追击目标).Pic = 0
  186.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  187.                         End If
  188.                         
  189.                         For i = 1 To playercount
  190.                             If Player(i).Connected = True Then
  191.                                 If Server(i).State = sckConnected Then
  192.                                     Server(i).SendData PLAYERHP & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).HP & KONGDATA & Player(Mon(MonID).追击目标).MaxHP & NETKONGDATA
  193.                                     Server(i).SendData PLAYERACTDATA & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).Act & KONGDATA & Player(Mon(MonID).追击目标).Pic & NETKONGDATA
  194.                                 End If
  195.                             End If
  196.                         Next
  197.                     End If
  198.                 End If
  199.             Case FaceInfo.DownFace
  200.                 If Player(Mon(MonID).追击目标).X = Mon(MonID).X And Player(Mon(MonID).追击目标).Y = Mon(MonID).Y + 1 Then
  201.                     GongVal = Abs(Rnd * (Mon(MonID).DBInfo.DC_攻击力 - Mon(MonID).DBInfo.DCMax_最大攻击力) + IIf(Mon(MonID).DBInfo.DCMax_最大攻击力 > Mon(MonID).DBInfo.DC_攻击力, Mon(MonID).DBInfo.DCMax_最大攻击力, Mon(MonID).DBInfo.DC_攻击力))
  202.                     ShangHai = GongVal - (Abs(Rnd * (Player(Mon(MonID).追击目标).AC1 - Player(Mon(MonID).追击目标).Ac2) + IIf(Player(Mon(MonID).追击目标).Ac2 - Player(Mon(MonID).追击目标).AC1, Player(Mon(MonID).追击目标).Ac2, Player(Mon(MonID).追击目标).AC1)))
  203.                     If ShangHai > 0 And Player(Mon(MonID).追击目标).HP > 0 Then
  204.                         Player(Mon(MonID).追击目标).HP = Player(Mon(MonID).追击目标).HP - ShangHai
  205.                         If Player(Mon(MonID).追击目标).HP > 0 Then
  206.                             Player(Mon(MonID).追击目标).Act = Bruise_受伤
  207.                             Player(Mon(MonID).追击目标).Pic = 0
  208.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  209.                         Else
  210.                             Player(Mon(MonID).追击目标).Act = Dead_死亡
  211.                             Player(Mon(MonID).追击目标).Pic = 0
  212.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  213.                         End If
  214.                         
  215.                         For i = 1 To playercount
  216.                             If Player(i).Connected = True Then
  217.                                 If Server(i).State = sckConnected Then
  218.                                     Server(i).SendData PLAYERHP & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).HP & KONGDATA & Player(Mon(MonID).追击目标).MaxHP & NETKONGDATA
  219.                                     Server(i).SendData PLAYERACTDATA & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).Act & KONGDATA & Player(Mon(MonID).追击目标).Pic & NETKONGDATA
  220.                                 End If
  221.                             End If
  222.                         Next
  223.                     End If
  224.                 End If
  225.             Case FaceInfo.LeftDownFace
  226.                 If Player(Mon(MonID).追击目标).X = Mon(MonID).X - 1 And Player(Mon(MonID).追击目标).Y = Mon(MonID).Y + 1 Then
  227.                     GongVal = Abs(Rnd * (Mon(MonID).DBInfo.DC_攻击力 - Mon(MonID).DBInfo.DCMax_最大攻击力) + IIf(Mon(MonID).DBInfo.DCMax_最大攻击力 > Mon(MonID).DBInfo.DC_攻击力, Mon(MonID).DBInfo.DCMax_最大攻击力, Mon(MonID).DBInfo.DC_攻击力))
  228.                     ShangHai = GongVal - (Abs(Rnd * (Player(Mon(MonID).追击目标).AC1 - Player(Mon(MonID).追击目标).Ac2) + IIf(Player(Mon(MonID).追击目标).Ac2 - Player(Mon(MonID).追击目标).AC1, Player(Mon(MonID).追击目标).Ac2, Player(Mon(MonID).追击目标).AC1)))
  229.                     If ShangHai > 0 And Player(Mon(MonID).追击目标).HP > 0 Then
  230.                         Player(Mon(MonID).追击目标).HP = Player(Mon(MonID).追击目标).HP - ShangHai
  231.                         If Player(Mon(MonID).追击目标).HP > 0 Then
  232.                             Player(Mon(MonID).追击目标).Act = Bruise_受伤
  233.                             Player(Mon(MonID).追击目标).Pic = 0
  234.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  235.                         Else
  236.                             Player(Mon(MonID).追击目标).Act = Dead_死亡
  237.                             Player(Mon(MonID).追击目标).Pic = 0
  238.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  239.                         End If
  240.                         
  241.                         For i = 1 To playercount
  242.                             If Player(i).Connected = True Then
  243.                                 If Server(i).State = sckConnected Then
  244.                                     Server(i).SendData PLAYERHP & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).HP & KONGDATA & Player(Mon(MonID).追击目标).MaxHP & NETKONGDATA
  245.                                     Server(i).SendData PLAYERACTDATA & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).Act & KONGDATA & Player(Mon(MonID).追击目标).Pic & NETKONGDATA
  246.                                 End If
  247.                             End If
  248.                         Next
  249.                     End If
  250.                 End If
  251.             Case FaceInfo.LeftFace
  252.                 If Player(Mon(MonID).追击目标).X = Mon(MonID).X - 1 And Player(Mon(MonID).追击目标).Y = Mon(MonID).Y Then
  253.                     GongVal = Abs(Rnd * (Mon(MonID).DBInfo.DC_攻击力 - Mon(MonID).DBInfo.DCMax_最大攻击力) + IIf(Mon(MonID).DBInfo.DCMax_最大攻击力 > Mon(MonID).DBInfo.DC_攻击力, Mon(MonID).DBInfo.DCMax_最大攻击力, Mon(MonID).DBInfo.DC_攻击力))
  254.                     ShangHai = GongVal - (Abs(Rnd * (Player(Mon(MonID).追击目标).AC1 - Player(Mon(MonID).追击目标).Ac2) + IIf(Player(Mon(MonID).追击目标).Ac2 - Player(Mon(MonID).追击目标).AC1, Player(Mon(MonID).追击目标).Ac2, Player(Mon(MonID).追击目标).AC1)))
  255.                     If ShangHai > 0 And Player(Mon(MonID).追击目标).HP > 0 Then
  256.                         Player(Mon(MonID).追击目标).HP = Player(Mon(MonID).追击目标).HP - ShangHai
  257.                         If Player(Mon(MonID).追击目标).HP > 0 Then
  258.                             Player(Mon(MonID).追击目标).Act = Bruise_受伤
  259.                             Player(Mon(MonID).追击目标).Pic = 0
  260.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  261.                         Else
  262.                             Player(Mon(MonID).追击目标).Act = Dead_死亡
  263.                             Player(Mon(MonID).追击目标).Pic = 0
  264.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  265.                         End If
  266.                         
  267.                         For i = 1 To playercount
  268.                             If Player(i).Connected = True Then
  269.                                 If Server(i).State = sckConnected Then
  270.                                     Server(i).SendData PLAYERHP & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).HP & KONGDATA & Player(Mon(MonID).追击目标).MaxHP & NETKONGDATA
  271.                                     Server(i).SendData PLAYERACTDATA & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).Act & KONGDATA & Player(Mon(MonID).追击目标).Pic & NETKONGDATA
  272.                                 End If
  273.                             End If
  274.                         Next
  275.                     End If
  276.                 End If
  277.             Case FaceInfo.LeftUpFace
  278.                 If Player(Mon(MonID).追击目标).X = Mon(MonID).X - 1 And Player(Mon(MonID).追击目标).Y = Mon(MonID).Y - 1 Then
  279.                     GongVal = Abs(Rnd * (Mon(MonID).DBInfo.DC_攻击力 - Mon(MonID).DBInfo.DCMax_最大攻击力) + IIf(Mon(MonID).DBInfo.DCMax_最大攻击力 > Mon(MonID).DBInfo.DC_攻击力, Mon(MonID).DBInfo.DCMax_最大攻击力, Mon(MonID).DBInfo.DC_攻击力))
  280.                     ShangHai = GongVal - (Abs(Rnd * (Player(Mon(MonID).追击目标).AC1 - Player(Mon(MonID).追击目标).Ac2) + IIf(Player(Mon(MonID).追击目标).Ac2 - Player(Mon(MonID).追击目标).AC1, Player(Mon(MonID).追击目标).Ac2, Player(Mon(MonID).追击目标).AC1)))
  281.                     If ShangHai > 0 And Player(Mon(MonID).追击目标).HP > 0 Then
  282.                         Player(Mon(MonID).追击目标).HP = Player(Mon(MonID).追击目标).HP - ShangHai
  283.                         If Player(Mon(MonID).追击目标).HP > 0 Then
  284.                             Player(Mon(MonID).追击目标).Act = Bruise_受伤
  285.                             Player(Mon(MonID).追击目标).Pic = 0
  286.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  287.                         Else
  288.                             Player(Mon(MonID).追击目标).Act = Dead_死亡
  289.                             Player(Mon(MonID).追击目标).Pic = 0
  290.                             Player(Mon(MonID).追击目标).PicSpeed = 0
  291.                         End If
  292.                         
  293.                         For i = 1 To playercount
  294.                             If Player(i).Connected = True Then
  295.                                 If Server(i).State = sckConnected Then
  296.                                     Server(i).SendData PLAYERHP & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).HP & KONGDATA & Player(Mon(MonID).追击目标).MaxHP & NETKONGDATA
  297.                                     Server(i).SendData PLAYERACTDATA & KONGDATA & Mon(MonID).追击目标 & KONGDATA & Player(Mon(MonID).追击目标).Act & KONGDATA & Player(Mon(MonID).追击目标).Pic & NETKONGDATA
  298.                                 End If
  299.                             End If
  300.                         Next
  301.                     End If
  302.                 End If
  303.         End Select
  304.     End If
  305.                     
  306.                     
  307. End Sub
  308. Sub MonActInfo(MonNum As Long, MonRace As Integer, MonRaceImage As Integer)
  309.     Dim i As Long, j As Long
  310.     Select Case MonRace
  311.         Case Is <> 51, 52
  312.             If Abs(Player(Mon(MonNum).追击目标).X - Mon(MonNum).X) <= 1 And Abs(Player(Mon(MonNum).追击目标).Y - Mon(MonNum).Y) <= 1 And Rnd * 10 < 5 Then
  313.                 Mon(MonNum).Act = AttAck_怪攻击
  314.                 Mon(MonNum).Pic = 0
  315.                 Mon(MonNum).PicSpeed = 0
  316.                 Mon(MonNum).Face = GetMonFace(Player(Mon(MonNum).追击目标).X, Player(Mon(MonNum).追击目标).Y, Mon(MonNum).X, Mon(MonNum).Y)
  317.                 For j = 1 To playercount
  318.                     If Player(j).Connected = True Then
  319.                         If Server(j).State = sckConnected Then
  320.                             Server(j).SendData MONACTDATA & KONGDATA & Mon(MonNum).Id & KONGDATA & Mon(Mon(MonNum).Id).Act & KONGDATA & Mon(Mon(MonNum).Id).Face & NETKONGDATA
  321.                         End If
  322.                     End If
  323.                 Next
  324.             End If
  325.         Case 101
  326.     End Select
  327. End Sub
  328. '/////////  载入怪物物品
  329. Public Sub LoadMonItems()
  330.     Dim i As Long, j As Integer, mSS As String, MDD As Variant
  331.     MonItemsFile = 0
  332.     ReDim MonItems(MonItemsFile)
  333.     If File1.ListCount = 0 Then Exit Sub
  334.     MonItemsFile = File1.ListCount
  335.     ReDim MonItems(MonItemsFile)
  336.     For i = 0 To File1.ListCount - 1
  337.         File1.Selected(i) = True
  338.         Open App.Path & "MonItems" & File1.FileName For Input As #1
  339.             MonItems(i + 1).MonName = Left(File1.FileName, Len(File1.FileName) - 4)
  340.             Do While Not EOF(1)
  341.                 Line Input #1, mSS
  342.                 For j = 9 To 2 Step -1
  343.                     mSS = Replace(mSS, String(j, " "), " ")
  344.                 Next j
  345.                 MDD = Split(mSS, " ")
  346.                 If UBound(MDD) >= 1 Then
  347.                     If MDD(1) = "金币" Then
  348.                         If UBound(MDD) >= 2 Then
  349.                             MonItems(i + 1).mItemCount = MonItems(i + 1).mItemCount + 1
  350.                             ReDim Preserve MonItems(i + 1).mItem(MonItems(i + 1).mItemCount)
  351.                             MonItems(i + 1).mItem(MonItems(i + 1).mItemCount).BaoLi = Right(MDD(0), Len(MDD(0)) - 2)
  352.                             MonItems(i + 1).mItem(MonItems(i + 1).mItemCount).ItemName = MDD(1)
  353.                             MonItems(i + 1).mItem(MonItems(i + 1).mItemCount).mCount = MDD(2)
  354.                         End If
  355.                         
  356.                     Else
  357.                         MonItems(i + 1).mItemCount = MonItems(i + 1).mItemCount + 1
  358.                         ReDim Preserve MonItems(i + 1).mItem(MonItems(i + 1).mItemCount)
  359.                         MonItems(i + 1).mItem(MonItems(i + 1).mItemCount).BaoLi = Right(MDD(0), Len(MDD(0)) - 2)
  360.                         MonItems(i + 1).mItem(MonItems(i + 1).mItemCount).ItemName = MDD(1)
  361.                     End If
  362.                 End If
  363.                 DoEvents
  364.             Loop
  365.         Close #1
  366.     Next
  367.     
  368. '    For i = 1 To MonItemsFile
  369. '        Open App.Path & "www" & MonItems(i).MonName & ".txt" For Output As #1
  370. '            If MonItems(i).mItemCount > 0 Then
  371. '                For j = 1 To MonItems(i).mItemCount
  372. '                    If MonItems(i).mItem(j).ItemName = "金币" Then
  373. '                       Print #1, "1/" & MonItems(i).mItem(j).BaoLi & " " & MonItems(i).mItem(j).ItemName & " " & MonItems(i).mItem(j).mCount
  374. '                    Else
  375. '                        Print #1, "1/" & MonItems(i).mItem(j).BaoLi & " " & MonItems(i).mItem(j).ItemName
  376. '                    End If
  377. '                Next
  378. '            End If
  379. '        Close #1
  380. '    Next
  381. End Sub
  382. Private Sub Command1_Click()
  383.     If Text1.Text > 0 Then
  384.         mExp = Text1.Text
  385.         Text.Text = Text.Text & "修改经验值倍数为:" & mExp & vbCrLf
  386.     End If
  387. End Sub
  388. Private Sub Form_Load()
  389.     Me.Show
  390.     DoEvents
  391.     File1.Path = App.Path & "MonItems"
  392.     mExp = 1
  393.     Map.Width = 100
  394.     Map.Height = 100
  395.     ReDim Map.Map3(Map.Width, Map.Height)
  396.     ReDim Map.Map4(Map.Width, Map.Height)
  397.     ReDim Map.Map5(Map.Width, Map.Height)
  398.     MapItemCount = 0
  399.     ReDim MapItem(MapItemCount)
  400.     Text.Text = Text.Text & "服务器正在启动......" & vbCrLf
  401.     LoadLevelHP
  402.     Text.Text = Text.Text & "正在加载魔法技能数据......" & vbCrLf
  403.     LoadMagicDBData
  404.     Text.Text = Text.Text & "加载魔法技能数据成功......" & vbCrLf
  405.     Text.Text = Text.Text & "正在加载物品数据......" & vbCrLf
  406.     LoadItemDBData
  407.     Text.Text = Text.Text & "加载物品数据成功......" & vbCrLf
  408.     Text.Text = Text.Text & "正在加载NPC数据......" & vbCrLf
  409.     LoadNPCInfo
  410.     Text.Text = Text.Text & "加载NPC数据成功......" & vbCrLf
  411.     Text.Text = Text.Text & "正在加载等级经验......" & vbCrLf
  412.     LoadLevelExpData
  413.     Text.Text = Text.Text & "加载等级经验成功......" & vbCrLf
  414.     Text.Text = Text.Text & "正在加载注册ID数据......" & vbCrLf
  415.     loadRegPlayerInfo
  416.     Text.Text = Text.Text & "加载注册ID数据成功......" & vbCrLf
  417.     Text.Text = Text.Text & "正在加载怪物数据......" & vbCrLf
  418.     LoadMonDBData
  419.     Text.Text = Text.Text & "加载怪物数据成功......" & vbCrLf
  420.     Text.Text = Text.Text & "正在加载怪物爆率......" & vbCrLf
  421.     LoadMonItems
  422.     Text.Text = Text.Text & "加载怪物爆率成功......" & vbCrLf
  423.     LoadMonGen
  424.     
  425.     InitMon
  426.     InitMapItem
  427.     
  428.     ServerIP = ReadINIFile("Main", "ServerIP", App.Path & "Main.ini")
  429.     ServerPort = ReadINIFile("Main", "ServerPort", App.Path & "Main.ini")
  430.     Server(0).Bind 7001, ServerIP
  431.     Server(0).Listen
  432.     
  433.     LoginServer(0).Bind ServerPort, ServerIP
  434.     LoginServer(0).Listen
  435.     Text.Text = Text.Text & "服务器启动完成......" & vbCrLf
  436.     mSleep 500
  437.     GameLoop
  438.     
  439. End Sub
  440. Sub InitMapItem()
  441.     Dim i As Long
  442.     MapItemCount = 0
  443.     ReDim MapItem(MapItemCount)
  444.     For i = 1 To MapItemCount
  445.         MapItem(i).Id = i
  446.         MapItem(i).State = True
  447.         MapItem(i).mItem = ItemDB(Rnd * (ItemDBCount - 1) + 1)
  448.         MapItem(i).X = Rnd * Map.Width
  449.         MapItem(i).Y = Rnd * Map.Height
  450.     Next
  451. End Sub
  452. Private Sub GameLoop()
  453.     
  454.     mStart = True
  455.     Do While mStart
  456.         If GetTickCount - LTime > 30 Then
  457.             LTime = GetTickCount
  458.             Randomize
  459.             ActMonGen
  460.             MonAct
  461.             
  462.             
  463.         End If
  464.         DoEvents
  465.     Loop
  466.     End
  467. End Sub
  468. Function GetMonFace(XX1 As Long, YY1 As Long, XX2 As Long, YY2 As Long) As FaceInfo
  469.     If XX1 > XX2 Then
  470.         If YY1 > YY2 Then
  471.             GetMonFace = RightDownFace
  472.         ElseIf YY1 < YY2 Then
  473.             GetMonFace = RightUpFace
  474.         ElseIf YY1 = YY2 Then
  475.             GetMonFace = RightFace
  476.         End If
  477.     ElseIf XX1 < XX2 Then
  478.         If YY1 > YY2 Then
  479.             GetMonFace = LeftDownFace
  480.         ElseIf YY1 < YY2 Then
  481.             GetMonFace = LeftUpFace
  482.         ElseIf YY1 = YY2 Then
  483.             GetMonFace = LeftFace
  484.         End If
  485.     ElseIf XX1 = XX2 Then
  486.         If YY1 > YY2 Then
  487.             GetMonFace = DownFace
  488.         ElseIf YY1 < YY2 Then
  489.             GetMonFace = UpFace
  490.         End If
  491.     End If
  492. End Function
  493. Sub MonTexAct(MonID As Long)
  494.     If Mon(MonID).Act = Stone_怪石化 Then
  495.         If Mon(MonID).Pic > 0 Then
  496.             Mon(MonID).PicSpeed = Mon(MonID).PicSpeed + 1
  497.             If Mon(MonID).PicSpeed > 3 Then
  498.                 Mon(MonID).PicSpeed = 0
  499.                 Mon(MonID).Pic = Mon(MonID).Pic + 1
  500.             End If
  501.         End If
  502.     Else
  503.         Mon(MonID).PicSpeed = Mon(MonID).PicSpeed + 1
  504.         If Mon(MonID).PicSpeed > 2 Then
  505.             Mon(MonID).PicSpeed = 0
  506.             Mon(MonID).Pic = Mon(MonID).Pic + 1
  507.         End If
  508.     End If
  509.     Select Case Mon(MonID).Act
  510.         Case MonActType.Stone_怪石化
  511.             If Mon(MonID).Pic > 5 Then
  512.                 Mon(MonID).PicSpeed = 0
  513.                 Mon(MonID).Pic = 0
  514.                 Mon(MonID).Act = Stand_怪站立
  515.             End If
  516.         Case MonActType.Stand_怪站立
  517.             If Mon(MonID).Pic > 10 Then
  518.                 Mon(MonID).PicSpeed = 0
  519.                 Mon(MonID).Pic = 0
  520.                 Mon(MonID).Act = Stand_怪站立
  521.             End If
  522.         Case MonActType.Move_怪移动
  523.             If Mon(MonID).Pic > 8 Then
  524.                 Mon(MonID).Pic = 0
  525.                 Mon(MonID).Act = Stand_怪站立
  526.                 Mon(MonID).PicSpeed = 0
  527.             End If
  528.         Case MonActType.Bruise_怪受伤
  529.             If Mon(MonID).Pic > 2 Then
  530.                 Mon(MonID).Pic = 0
  531.                 Mon(MonID).Act = Stand_怪站立
  532.                 Mon(MonID).PicSpeed = 0
  533.             End If
  534.         Case MonActType.AttAck_怪攻击
  535.             MonAttackData MonID
  536.             If Mon(MonID).Pic > 5 Then
  537.                 Mon(MonID).Pic = 0
  538.                 Mon(MonID).PicSpeed = 0
  539.                 Mon(MonID).Act = Stand_怪站立
  540.             End If
  541.         Case MonActType.Dead_怪死亡
  542.             If GetTickCount - Mon(MonID).DeadLTime > 5000 Then
  543.                 Mon(MonID).Dead = True
  544.             End If
  545.             If Mon(MonID).DBInfo.Appr_形象代码 = 218 Then
  546.                 If Mon(MonID).Pic > 19 Then
  547.                     Mon(MonID).Pic = 19
  548.                 End If
  549.             Else
  550.                 If Mon(MonID).Pic > 9 Then
  551.                     Mon(MonID).Pic = 9
  552.                 End If
  553.             End If
  554.     End Select
  555. End Sub
  556. Private Sub MonAct()
  557.     Dim i As Long, j As Integer
  558.     Dim XX As Long, YY As Long
  559.     Dim MM As Integer
  560.     If MonCount <= 0 Then Exit Sub
  561.     
  562.     For i = 1 To MonCount
  563.         If Mon(i).Dead = False Then
  564.             MonTexAct i         ' 怪贴图动作
  565.             
  566.             If Mon(i).Act = Stand_怪站立 Or Mon(i).Act = Stone_怪石化 Then
  567.                 If Mon(i).追击 = False Then
  568.                     
  569.                     If GetTickCount - Mon(i).LassWalkTime > Mon(i).DBInfo.WalkWait_行走等待 Then
  570.                         Mon(i).LassWalkTime = GetTickCount
  571.                         If Rnd * 10 = 10 Then
  572.                         
  573.                             XX = Mon(i).X + Rnd * 2 - 1
  574.                             YY = Mon(i).Y + Rnd * 2 - 1
  575.                             If XX < 0 Then XX = Mon(i).X
  576.                             If YY < 0 Then YY = Mon(i).Y
  577.                             If XX > Map.Width Then XX = Mon(i).X
  578.                             If YY > Map.Height Then YY = Mon(i).Y
  579.                             If Mon(i).X <> XX Or Mon(i).Y <> YY Then
  580.                                 Mon(i).Face = GetMonFace(XX, YY, Mon(i).X, Mon(i).Y)
  581.                                 For j = 1 To playercount
  582.                                     If Abs(Mon(i).X - Player(j).X) < 5 And Abs(Mon(i).Y - Player(j).Y) < 5 Then
  583.                                         If Player(j).Connected = True Then
  584.                                             If Server(j).State = sckConnected Then
  585.                                                 Server(j).SendData MONFACE & KONGDATA & Mon(i).Id & KONGDATA & Mon(i).Face & NETKONGDATA
  586.                                                 
  587.                                             End If
  588.                                         End If
  589.                                     End If
  590.                                 Next
  591.                                 Map.Map4(Mon(i).X, Mon(i).Y) = Map.Map4(Mon(i).X, Mon(i).Y) - 1
  592.                                 Mon(i).X = XX
  593.                                 Mon(i).Y = YY
  594.                                 Mon(i).Act = Move_怪移动
  595.                                 Mon(i).Pic = 0
  596.                                 Mon(i).PicSpeed = 0
  597.                                 Map.Map4(Mon(i).X, Mon(i).Y) = Map.Map4(Mon(i).X, Mon(i).Y) + 1
  598.                                 For j = 1 To playercount
  599.                                     If Abs(Mon(i).X - Player(j).X) < 17 And Abs(Mon(i).Y - Player(j).Y) < 20 Then
  600.                                         If Player(j).Connected = True Then
  601.                                             If Server(j).State = sckConnected Then
  602.                                                 Server(j).SendData MONMOVE & KONGDATA & Mon(i).Id & KONGDATA & Mon(i).X & KONGDATA & Mon(i).Y & NETKONGDATA
  603.         '                                        mSendDataMonInfo j
  604.                                             End If
  605.                                         End If
  606.                                     End If
  607.                                 Next
  608.                             End If
  609.                             
  610.                         End If
  611.                         
  612.                     End If
  613.                     For j = 1 To playercount
  614.                         If Abs(Mon(i).X - Player(j).X) < 5 And Abs(Mon(i).Y - Player(j).Y) < 5 Then
  615.                             Mon(i).追击 = True
  616.                             Mon(i).追击目标 = j
  617.                             If Mon(i).Act = Stone_怪石化 And Mon(i).Pic = 0 Then Mon(i).Pic = 1
  618.                             Exit For
  619.                         End If
  620.                     Next
  621.                 ElseIf Mon(i).追击 = True Then
  622.                     If Abs(Mon(i).X - Player(Mon(i).追击目标).X) > 10 Or Abs(Mon(i).Y - Player(Mon(i).追击目标).Y) > 10 Or Player(Mon(i).追击目标).Connected = False Or Player(Mon(i).追击目标).Act = Dead_死亡 Then
  623.                         Mon(i).追击 = False
  624.                     Else
  625.                         If GetTickCount - Mon(i).LassWalkTime > Mon(i).DBInfo.WalkWait_行走等待 And Rnd * 10 < 1 Then
  626.                             Mon(i).LassWalkTime = GetTickCount
  627.                             MonActInfo i, Mon(i).DBInfo.Race_种族, Mon(i).DBInfo.RaceImage_种族图像
  628.                             If Mon(i).Act = Stand_怪站立 Then
  629.                                 XX = Player(Mon(i).追击目标).X: YY = Player(Mon(i).追击目标).Y
  630.                                 FindPath Mon(i).X, Mon(i).Y, XX, YY, Mon(i).WayPath, Mon(i).Way, True
  631.                                 If XX < 0 Then XX = Mon(i).X
  632.                                 If YY < 0 Then YY = Mon(i).Y
  633.                                 If XX > Map.Width Then XX = Mon(i).X
  634.                                 If YY > Map.Height Then YY = Mon(i).Y
  635.                                 If Mon(i).X <> Mon(i).Way(Mon(i).WayPath).X Or Mon(i).Y <> Mon(i).Way(Mon(i).WayPath).Y Then
  636.                                     Mon(i).Face = GetMonFace(Mon(i).Way(Mon(i).WayPath).X, Mon(i).Way(Mon(i).WayPath).Y, Mon(i).X, Mon(i).Y)
  637.                                     For j = 1 To playercount
  638.                                         If Abs(Mon(i).X - Player(j).X) < 17 And Abs(Mon(i).Y - Player(j).Y) < 20 Then
  639.                                             If Player(j).Connected = True Then
  640.                                                 If Server(j).State = sckConnected Then
  641.                                                     Server(j).SendData MONFACE & KONGDATA & Mon(i).Id & KONGDATA & Mon(i).Face & NETKONGDATA
  642.                                                     
  643.                                                 End If
  644.                                             End If
  645.                                         End If
  646.                                     Next
  647.                                     Map.Map4(Mon(i).X, Mon(i).Y) = Map.Map4(Mon(i).X, Mon(i).Y) - 1
  648.                                     Mon(i).X = Mon(i).Way(Mon(i).WayPath).X
  649.                                     Mon(i).Y = Mon(i).Way(Mon(i).WayPath).Y
  650.                                     Mon(i).Act = Move_怪移动
  651.                                     Mon(i).Pic = 0
  652.                                     Mon(i).PicSpeed = 0
  653.                                     Map.Map4(Mon(i).X, Mon(i).Y) = Map.Map4(Mon(i).X, Mon(i).Y) + 1
  654.                                     For j = 1 To playercount
  655.                                         If Abs(Mon(i).X - Player(j).X) < 17 And Abs(Mon(i).Y - Player(j).Y) < 20 Then
  656.                                             If Player(j).Connected = True Then
  657.                                                 If Server(j).State = sckConnected Then
  658.                                                     Server(j).SendData MONMOVE & KONGDATA & Mon(i).Id & KONGDATA & Mon(i).X & KONGDATA & Mon(i).Y & NETKONGDATA
  659.     '                                                mSendDataMonInfo j
  660.                                                 End If
  661.                                             End If
  662.                                         End If
  663.                                     Next
  664.                                 End If
  665.                             End If
  666.                         End If
  667.                     End If
  668.                 End If
  669.             End If
  670.         End If
  671.     Next
  672.     
  673. End Sub
  674. '////////  发送数据
  675. Private Sub ServerSendData(mNum As Integer, Str As String)
  676.     If Server(mNum).State = sckConnected Then
  677.         Server(mNum).SendData Str & NETKONGDATA
  678.     End If
  679. End Sub
  680. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  681.     
  682.     Cancel = 1
  683.     Me.Hide
  684. '
  685.     
  686. End Sub
  687. Private Sub LoginServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)
  688.     Dim i As Integer
  689.     Dim Work As Boolean
  690.     If LoginCount > 0 Then
  691.         For i = 1 To LoginCount
  692.             If LoginServer(i).State = 0 Then
  693.                 LoginServer(i).Accept requestID
  694.                 Work = True
  695.                 Exit For
  696.             End If
  697.         Next
  698.     End If
  699.     
  700.     If Work = False Then
  701.         LoginCount = LoginCount + 1
  702.         Load LoginServer(LoginCount)
  703.         
  704.         LoginServer(LoginCount).Accept requestID
  705.         Work = True
  706.     End If
  707. End Sub
  708. Private Sub LoginServer_DataArrival(Index As Integer, ByVal bytesTotal As Long)
  709.     Dim mData As String
  710.     LoginServer(Index).GetData mData, vbString
  711.     ExecuteNETData mData, Index
  712. End Sub
  713. Private Sub LoginServer_Error(Index As Integer, ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  714.     LoginServer(Index).Close
  715. End Sub
  716. Private Sub Server_Close(Index As Integer)
  717.     Unload Server(Index)
  718.     Player(Index).Connected = False
  719.     Map.Map3(Player(Index).X, Player(Index).Y) = Map.Map3(Player(Index).X, Player(Index).Y) - 1
  720.     Text.Text = Text.Text & "玩家[" & Player(Index).Name_名字 & "]下线了!......" & vbCrLf
  721.     SaveHero = Player(Index)
  722.     SavePlayerInfo
  723.     Dim i As Integer
  724.     For i = 1 To playercount
  725.         If Player(i).Connected = True Then
  726. '            Server(i).SendData PLAYEREND & KONGDATA & Index & NETKONGDATA
  727.             ServerSendData i, PLAYEREND & KONGDATA & Index
  728.         End If
  729.     Next
  730.     Player(Index).Name_名字 = ""
  731. End Sub
  732. Private Sub Server_ConnectionRequest(Index As Integer, ByVal requestID As Long)
  733.     Dim i As Integer, Work As Boolean
  734.     Dim mNum As Integer
  735.     If playercount = 0 Then
  736.         playercount = playercount + 1
  737.         ReDim Preserve Player(playercount)
  738.         Load Server(playercount)
  739.         Server(playercount).Accept requestID
  740.         Server(playercount).SendData NOWPLAYERCOUNT & KONGDATA & playercount & NETKONGDATA
  741.         Server(playercount).SendData PlayerNum & KONGDATA & playercount & NETKONGDATA
  742.         Player(playercount).Connected = True
  743.         Work = True
  744.         mNum = playercount
  745.     End If
  746.     If Work = False Then
  747.         For i = 1 To playercount
  748.             If Player(i).Connected = False Then
  749.                 Player(i).Connected = True
  750.                 Load Server(i)
  751.                 Server(i).Accept requestID
  752.                 Server(i).SendData NOWPLAYERCOUNT & KONGDATA & playercount & NETKONGDATA
  753.                 Server(i).SendData PlayerNum & KONGDATA & i & NETKONGDATA
  754.                 Work = True
  755.                 mNum = i
  756.                 Exit For
  757.             End If
  758.         Next
  759.     End If
  760.     
  761.     If Work = False Then
  762.         playercount = playercount + 1
  763.         ReDim Preserve Player(playercount)
  764.         Load Server(playercount)
  765.         Server(playercount).Accept requestID
  766.         Server(playercount).SendData NOWPLAYERCOUNT & KONGDATA & playercount & NETKONGDATA
  767.         Server(playercount).SendData PlayerNum & KONGDATA & i & NETKONGDATA
  768.         Player(playercount).Connected = True
  769.         Work = True
  770.         mNum = playercount
  771.     End If
  772.     Text.Text = Text.Text & "当前在线人数:" & playercount & vbCrLf
  773.     
  774.     For i = 1 To playercount
  775.         If i <> mNum Then
  776.             If Player(i).Connected = True Then
  777.                 If Server(i).State = 7 Then Server(i).SendData NOWPLAYERCOUNT & KONGDATA & playercount & NETKONGDATA
  778.             End If
  779.         End If
  780.     Next
  781.     
  782. End Sub
  783. Private Sub ExecuteNETData(NowStr As String, Index As Integer)
  784.     Dim mData As Variant, mWord As Variant, i As Long, j As Integer, l As Integer, M As Integer
  785.     Dim MS As String, MM(3) As String, mInt(2) As Integer
  786.     Dim ShangHaiVal As Long
  787.     Dim NowExp As Long
  788.     On Error GoTo mErr
  789.     mWord = Split(NowStr, NETKONGDATA)
  790.     For i = 0 To UBound(mWord)
  791.         If Len(mWord(i)) > 4 Then
  792.             mData = Split(mWord(i), KONGDATA)
  793.             Select Case mData(0)
  794.                 Case PLAYERDUIITEM      '玩家丢物品
  795.                     Player(Index).Bag(mData(1)).State = False
  796.                 Case JIANITEMDATA       '玩家捡地图上物品
  797.                     If MapItem(mData(1)).X = mData(2) And MapItem(mData(1)).Y = mData(3) Then
  798.                         Dim JianItemOK As Boolean
  799.                         JianItemOK = False
  800.                         For j = 0 To 39
  801.                             If Player(Index).Bag(j).State = False Then
  802.                                 Player(Index).Bag(j).State = True
  803.                                 Player(Index).Bag(j).Item = MapItem(mData(1)).mItem
  804.                                 JianItemOK = True
  805.                                 Exit For
  806.                             End If
  807.                         Next
  808.                         If JianItemOK = True Then
  809.                             Server(Index).SendData GIVEITEMDATA & KONGDATA & Index & KONGDATA & Player(Index).Name_名字 & KONGDATA & ItemStr(MapItem(mData(1)).mItem) & NETKONGDATA
  810.                             If mData(1) < MapItemCount Then
  811.                                 MapItem(mData(1)) = MapItem(MapItemCount)
  812.                             End If
  813.                             MapItemCount = MapItemCount - 1
  814.                             ReDim Preserve MapItem(MapItemCount)
  815.                             
  816.                             For j = 1 To playercount
  817.                                 If Player(j).Connected = True Then
  818.                                     If Server(j).State = sckConnected Then
  819.                                         mSendDataMapItemInfo j
  820.                                     End If
  821.                                 End If
  822.                             Next
  823.                         End If
  824.                         
  825.                     End If
  826.                 Case CMDDATA        '命令
  827.                     Dim MDD As Variant
  828.                     MDD = Split(mData(1), " ")
  829.                     If UCase(MDD(0)) = "@LEVEL" Then
  830.                         If UBound(MDD) = 1 Then
  831.                             Player(Index).Level = MDD(1)
  832.                             Player(Index).MaxHP = LevelHP(Player(Index).Level)
  833.                             Player(Index).HP = Player(Index).MaxHP
  834.                             Server(Index).SendData PLAYERHP & KONGDATA & Index & KONGDATA & Player(Index).HP & KONGDATA & Player(Index).MaxHP & NETKONGDATA
  835.                             Server(Index).SendData PLAYERLEVEL & KONGDATA & Index & KONGDATA & Player(Index).Name_名字 & KONGDATA & Player(Index).Level & NETKONGDATA
  836.                             Server(Index).SendData PLAYEREXPDATA & KONGDATA & Player(Index).Exp_经验值 & KONGDATA & LevelExp(Player(Index).Level) & NETKONGDATA
  837.                         End If
  838.                     
  839.                     ElseIf UCase(MDD(0)) = "@MOB" Then
  840.                         Dim mMonCount As Long
  841.                         If UBound(MDD) >= 4 Then
  842.                             MM(0) = MDD(1)      '怪名字
  843.                             mInt(0) = MDD(3)    '怪X
  844.                             mInt(1) = MDD(4)    '怪Y
  845.                             mInt(2) = GetMonDBNum(MM(0))
  846.                             If mInt(2) > 0 Then
  847. '                                mMonCount = MonCount
  848. '                                MonCount = MonCount + MDD(2)
  849. '                                ReDim Preserve Mon(MonCount)
  850. '                                Dim H As Long
  851.                                 AddMon MM(0), mInt(0), mInt(1), Int(MDD(2))
  852. '                                For H = mMonCount To MonCount
  853. '                                    AddMon H, MM(0), mInt(0), mInt(1)
  854. '                                Next
  855.                                 For j = 1 To playercount
  856.                                     If Player(j).Connected = True Then
  857.                                         If Server(j).State = sckConnected Then
  858.                                             mSendDataMonInfo j
  859.                                         End If
  860.                                     End If
  861.                                 Next
  862.                             End If
  863.                         End If
  864.                     ElseIf UCase(MDD(0)) = "@MAKE" Then
  865.                         If UBound(MDD) >= 1 Then
  866.                             
  867.                             Dim mCount As Integer
  868.                             If UBound(MDD) >= 2 Then
  869.                                 mCount = MDD(2)
  870.                             Else
  871.                                 mCount = 1
  872.                             End If
  873.                             
  874.                             Dim mItemNum As Integer
  875.                             MM(1) = MDD(1)
  876.                             mItemNum = GetItemNum(MM(1))
  877.                             If mItemNum > 0 Then
  878.                                 Server(Index).SendData GIVEITEMDATA & KONGDATA & Index & KONGDATA & Player(Index).Name_名字 & KONGDATA & ItemStr(ItemDB(mItemNum)) & KONGDATA & mCount & NETKONGDATA
  879.                             End If
  880.                         End If
  881.                     End If
  882.                 Case REGPLAYERID        '注册ID 和角色名
  883.                     Dim IDOK As Boolean
  884.                     IDOK = True
  885.                     For j = 0 To RegPlayerCount
  886.                         If mData(1) = RegPlayer(j).Id Then
  887.                             IDOK = False
  888.                             Exit For
  889.                         End If
  890.                     Next
  891.                     
  892.                     If IDOK = True Then
  893.                         RegPlayerCount = RegPlayerCount + 1
  894.                         ReDim Preserve RegPlayer(RegPlayerCount)
  895.                         ReDim Preserve RegPlayer(RegPlayerCount).mPlayer(0)
  896.                         RegPlayer(RegPlayerCount).Id = mData(1)
  897.                         Text.Text = Text.Text & "注册ID [ " & mData(1) & " ] 成功..." & vbCrLf
  898.                     End If
  899.                     If IDOK = False Then
  900.                         LoginServer(Index).SendData REGIDSTATE & KONGDATA & 0 & KONGDATA & "ID号已被注册!" & NETKONGDATA
  901.                     Else
  902.                         LoginServer(Index).SendData REGIDSTATE & KONGDATA & 1 & KONGDATA & "恭喜你注册成功!" & NETKONGDATA
  903.                     End If
  904.                 Case SELHERONUM
  905.                     For j = 0 To RegPlayerCount
  906.                         If RegPlayer(j).Id = mData(1) Then
  907.                             RegPlayer(j).SelNum = mData(2)
  908.                             If RegPlayer(j).SelNum = 0 Then RegPlayer(j).SelNum = 1
  909.                             LoginServer(Index).SendData SELHERONUM & KONGDATA & mData(1) & KONGDATA & RegPlayer(j).SelNum & NETKONGDATA
  910.                             Exit For
  911.                         End If
  912.                     Next
  913.                 Case LOGINID        '登陆ID
  914.                     Dim Work As Boolean
  915.                     For j = 1 To RegPlayerCount
  916.                         If mData(1) = RegPlayer(j).Id Then
  917.                             Work = True
  918.                             
  919.                             
  920.                             If RegPlayer(j).SavePlayerCount > 0 Then
  921.                                 For l = 1 To RegPlayer(j).SavePlayerCount
  922.                                     LoginServer(Index).SendData SAVEHERODATA & KONGDATA & l & KONGDATA & RegPlayer(j).mPlayer(l).PlayerName & KONGDATA & RegPlayer(j).mPlayer(l).Level & KONGDATA & RegPlayer(j).mPlayer(l).Job & KONGDATA & RegPlayer(j).mPlayer(l).Sex & NETKONGDATA
  923.                                 Next
  924.                                 If RegPlayer(j).SelNum = 0 Then RegPlayer(j).SelNum = 1
  925.                                 LoginServer(Index).SendData SELHERONUM & KONGDATA & RegPlayer(j).Id & KONGDATA & RegPlayer(j).SelNum & NETKONGDATA
  926.                             
  927.                                 
  928.                                 Exit For
  929.                             End If
  930.                         End If
  931.                     Next
  932.                     If Work = False Then
  933.                         LoginServer(Index).SendData LOGINSTATE & KONGDATA & 0 & NETKONGDATA
  934.                     Else
  935.                         LoginServer(Index).SendData LOGINSTATE & KONGDATA & 1 & NETKONGDATA
  936.                     End If
  937.                 Case REGHERONAME            '建立角色
  938.                     Work = False
  939.                     For j = 0 To RegPlayerCount
  940.                         If RegPlayer(j).SavePlayerCount > 0 Then
  941.                             For l = 1 To RegPlayer(j).SavePlayerCount
  942.                                 If RegPlayer(j).mPlayer(l).PlayerName = mData(2) Then
  943.                                     Work = True
  944.                                     Exit For
  945.                                 End If
  946.                             Next
  947.                         End If
  948.                      Next
  949.                      
  950.                      If Work = False Then
  951.                         For j = 0 To RegPlayerCount
  952.                             If RegPlayer(j).Id = mData(1) Then
  953.                                 RegPlayer(j).SavePlayerCount = RegPlayer(j).SavePlayerCount + 1
  954.                                 ReDim Preserve RegPlayer(j).mPlayer(RegPlayer(j).SavePlayerCount)
  955.                                 RegPlayer(j).mPlayer(RegPlayer(j).SavePlayerCount).PlayerName = mData(2)
  956.                                 RegPlayer(j).mPlayer(RegPlayer(j).SavePlayerCount).Job = mData(3)
  957.                                 RegPlayer(j).mPlayer(RegPlayer(j).SavePlayerCount).Sex = mData(4)
  958.                                 LoginServer(Index).SendData SAVEHERODATA & KONGDATA & RegPlayer(j).SavePlayerCount & KONGDATA & RegPlayer(j).mPlayer(RegPlayer(j).SavePlayerCount).PlayerName & KONGDATA & RegPlayer(j).mPlayer(RegPlayer(j).SavePlayerCount).Level & KONGDATA & RegPlayer(j).mPlayer(RegPlayer(j).SavePlayerCount).Job & KONGDATA & RegPlayer(j).mPlayer(RegPlayer(j).SavePlayerCount).Sex & NETKONGDATA
  959.                                 If RegPlayer(j).SelNum = 0 Then RegPlayer(j).SelNum = 1
  960.                                 LoginServer(Index).SendData SELHERONUM & KONGDATA & RegPlayer(j).Id & KONGDATA & RegPlayer(j).SelNum & NETKONGDATA
  961.                                 Exit For
  962.                             End If
  963.                         Next
  964.                     ElseIf Work = True Then
  965.                         LoginServer(Index).SendData TISHIDATA & KONGDATA & "该角色名已被注册!" & NETKONGDATA
  966.                     End If
  967.                     
  968.                 Case LOGINNAME      '登陆名字
  969.                     MM(1) = mData(1)
  970.                     MM(2) = mData(2)
  971.                     MM(3) = mData(3)
  972.                     If Dir(App.Path & "SavePlayerSave" & MM(1) & ".DB") = "" Then
  973.                         SaveHero.Name_名字 = MM(1)
  974.                         SaveHero.Job_职业 = MM(2)
  975.                         SaveHero.Sex_性别 = MM(3)
  976.                         SaveHero.X = 50
  977.                         SaveHero.Y = 50
  978.                         SaveHero.Level = 1
  979.                         SaveHero.HP = LevelHP(SaveHero.Level)
  980.                         SaveHero.MaxHP = LevelHP(SaveHero.Level)
  981.                         
  982.                         SaveHero.Exp_经验值 = 0
  983.                         SaveHero.Clothing.State = True
  984.                         SaveHero.Clothing.Item = ItemDB(GetItemNum("布衣(男)"))
  985.                         SaveHero.Weapon.State = True
  986.                         SaveHero.Weapon.Item = ItemDB(GetItemNum("炼狱"))
  987.                         SaveHero.FingerRingLeft.State = True
  988.                         SaveHero.FingerRingLeft.Item = ItemDB(GetItemNum("圣战戒指"))
  989.                         SaveHero.FingerRingRight.State = True
  990.                         SaveHero.FingerRingRight.Item = ItemDB(GetItemNum("圣战戒指"))
  991.                         SaveHero.BraceletLeft.State = True
  992.                         SaveHero.BraceletLeft.Item = ItemDB(GetItemNum("圣战手镯"))
  993.                         SaveHero.BraceletRight.State = True
  994.                         SaveHero.BraceletRight.Item = ItemDB(GetItemNum("圣战手镯"))
  995.                         SaveHero.HeadPiece.State = True
  996.                         SaveHero.HeadPiece.Item = ItemDB(GetItemNum("圣战头盔"))
  997.                         SaveHero.Necklace.State = True
  998.                         SaveHero.Necklace.Item = ItemDB(GetItemNum("圣战项链"))
  999.                         SavePlayerInfo
  1000.                     End If
  1001.                     
  1002.                     '///////////  检测角色名是否已经登陆
  1003.                     Dim LoginNameOK As Boolean
  1004.                     LoginNameOK = True
  1005.                     For j = 1 To playercount
  1006.                         If Player(j).Connected = True Then
  1007.                             If Player(j).Name_名字 = MM(1) Then
  1008.                                 Server(j).Close
  1009.                                 Unload Server(j)
  1010.                                 Player(j).Name_名字 = ""
  1011.                                 LoginNameOK = False
  1012.                                 Exit For
  1013.                             End If
  1014.                         End If
  1015.                     Next
  1016.                     ' Download by http://www.codefans.net
  1017.                     '//////////////////////////////////////////////////////////////////////////
  1018.                     If LoginNameOK = False Then
  1019.                         Server(Index).SendData TISHIDATA & KONGDATA & "该角色名已登陆" & NETKONGDATA
  1020.                         mSleep 200
  1021.                         Server_Close (Index)
  1022.                     
  1023.                     ElseIf LoginNameOK = True Then
  1024.                             
  1025.                         LoadPlayer Index, MM(1)
  1026.                         Map.Map3(Player(Index).X, Player(Index).Y) = Map.Map3(Player(Index).X, Player(Index).Y) + 1
  1027.                         Text.Text = Text.Text & "玩家[" & Player(Index).Name_名字 & "]上线了[" & Server(Index).RemoteHostIP & "] ..." & vbCrLf
  1028.                         Player(Index).LoginTime = Time
  1029.     '                ////////////////////////   发送主角信息  ///////////////////////////////////////////////////////////////////////////////
  1030.                          Server(Index).SendData PlayerName & KONGDATA & Index & KONGDATA & Player(Index).Name_名字 & NETKONGDATA
  1031.                          mSleep 100
  1032.                          Server(Index).SendData PLAYERLEVEL & KONGDATA & Index & KONGDATA & Player(Index).Name_名字 & KONGDATA & Player(Index).Level & NETKONGDATA
  1033.                          mSleep 100
  1034.                          Server(Index).SendData PLAYERXY & KONGDATA & Index & KONGDATA & Player(Index).X & KONGDATA & Player(Index).Y & NETKONGDATA
  1035.                          Server(Index).SendData PLAYERFACEDATA & KONGDATA & Index & KONGDATA & Player(Index).Face & NETKONGDATA
  1036.                          If Player(Index).HP <= 0 Then
  1037.                             Player(Index).HP = LevelHP(Player(Index).Level)
  1038.                             Player(Index).X = 50
  1039.                             Player(Index).Y = 50
  1040.                         End If
  1041.                          Server(Index).SendData PLAYERHP & KONGDATA & Index & KONGDATA & Player(Index).HP & KONGDATA & Player(Index).MaxHP & NETKONGDATA
  1042.                         Server(Index).SendData PLAYERSEX & KONGDATA & Index & KONGDATA & Player(Index).Sex_性别 & NETKONGDATA
  1043.                         Server(Index).SendData PLAYEREXPDATA & KONGDATA & Player(Index).Exp_经验值 & KONGDATA & LevelExp(Player(Index).Level) & NETKONGDATA
  1044.                          
  1045.                          If Player(Index).Clothing.State = True Then
  1046.                              Server(Index).SendData CLOTHINGDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).Clothing.Item) & NETKONGDATA
  1047.                          End If
  1048.                          If Player(Index).Weapon.State = True Then
  1049.                              Server(Index).SendData WEAPONDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).Weapon.Item) & NETKONGDATA
  1050.                          End If
  1051.                          If Player(Index).HeadPiece.State = True Then
  1052.                              Server(Index).SendData HEADPIECEDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).HeadPiece.Item) & NETKONGDATA
  1053.                          End If
  1054.                          If Player(Index).Necklace.State = True Then
  1055.                              Server(Index).SendData NECKLACEDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).Necklace.Item) & NETKONGDATA
  1056.                          End If
  1057.                          If Player(Index).BraceletLeft.State = True Then
  1058.                              Server(Index).SendData BRACELETLEFTDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).BraceletLeft.Item) & NETKONGDATA
  1059.                          End If
  1060.                          If Player(Index).BraceletRight.State = True Then
  1061.                              Server(Index).SendData BRACELETRIGHTDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).BraceletRight.Item) & NETKONGDATA
  1062.                          End If
  1063.                          If Player(Index).FingerRingLeft.State = True Then
  1064.                              Server(Index).SendData FINGERRINGLEFTDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).FingerRingLeft.Item) & NETKONGDATA
  1065.                          End If
  1066.                          If Player(Index).FingerRingRight.State = True Then
  1067.                              Server(Index).SendData FINGERRINGRIGHTDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).FingerRingRight.Item) & NETKONGDATA
  1068.                          End If
  1069.                          
  1070.                          '///////////////////////////////////   发送主角信息结束    //////////////////////////////////////////////////////////////////
  1071.                          
  1072.                          mSleep 300
  1073.                          For j = 1 To playercount
  1074.                              If j <> Index Then
  1075.                                  If Player(j).Connected = True Then
  1076.                                      Server(Index).SendData PlayerName & KONGDATA & j & KONGDATA & Player(j).Name_名字 & NETKONGDATA
  1077.                                      mSleep 100
  1078.                                      Server(Index).SendData PLAYERXY & KONGDATA & j & KONGDATA & Player(j).X & KONGDATA & Player(j).Y & NETKONGDATA
  1079.                                      Server(Index).SendData PLAYERFACEDATA & KONGDATA & j & KONGDATA & Player(j).Face & NETKONGDATA
  1080.                                      Server(Index).SendData PLAYERSEX & KONGDATA & j & KONGDATA & Player(j).Sex_性别 & NETKONGDATA
  1081.                                      Server(Index).SendData PLAYERHP & KONGDATA & j & KONGDATA & Player(j).HP & KONGDATA & Player(j).MaxHP & NETKONGDATA
  1082.                                      
  1083.                                      
  1084.                                      If Player(j).HP = 0 Then
  1085.                                          Server(Index).SendData PLAYERACTDATA & KONGDATA & j & KONGDATA & HeroActType.Dead_死亡 & KONGDATA & 3 & NETKONGDATA
  1086.                                      End If
  1087.                                      
  1088.                                      If Player(j).Clothing.State = True Then
  1089.                                          Server(Index).SendData CLOTHINGDATA & KONGDATA & j & KONGDATA & 1 & KONGDATA & ItemStr(Player(j).Clothing.Item) & NETKONGDATA
  1090.                                      End If
  1091.                                      If Player(j).Weapon.State = True Then
  1092.                                          Server(Index).SendData WEAPONDATA & KONGDATA & j & KONGDATA & 1 & KONGDATA & ItemStr(Player(j).Weapon.Item) & NETKONGDATA
  1093.                                      End If
  1094.                                      If Player(j).HeadPiece.State = True Then
  1095.                                          Server(Index).SendData HEADPIECEDATA & KONGDATA & j & KONGDATA & 1 & KONGDATA & ItemStr(Player(j).HeadPiece.Item) & NETKONGDATA
  1096.                                      End If
  1097.                                      If Player(j).Necklace.State = True Then
  1098.                                          Server(Index).SendData NECKLACEDATA & KONGDATA & j & KONGDATA & 1 & KONGDATA & ItemStr(Player(j).Necklace.Item) & NETKONGDATA
  1099.                                      End If
  1100.                                      If Player(j).BraceletLeft.State = True Then
  1101.                                          Server(Index).SendData BRACELETLEFTDATA & KONGDATA & j & KONGDATA & 1 & KONGDATA & ItemStr(Player(j).BraceletLeft.Item) & NETKONGDATA
  1102.                                      End If
  1103.                                      If Player(j).BraceletRight.State = True Then
  1104.                                          Server(Index).SendData BRACELETRIGHTDATA & KONGDATA & j & KONGDATA & 1 & KONGDATA & ItemStr(Player(j).BraceletRight.Item) & NETKONGDATA
  1105.                                      End If
  1106.                                      If Player(j).FingerRingLeft.State = True Then
  1107.                                          Server(Index).SendData FINGERRINGLEFTDATA & KONGDATA & j & KONGDATA & 1 & KONGDATA & ItemStr(Player(j).FingerRingLeft.Item) & NETKONGDATA
  1108.                                      End If
  1109.                                      If Player(j).FingerRingRight.State = True Then
  1110.                                          Server(Index).SendData FINGERRINGRIGHTDATA & KONGDATA & j & KONGDATA & 1 & KONGDATA & ItemStr(Player(j).FingerRingRight.Item) & NETKONGDATA
  1111.                                      End If
  1112.                                  End If
  1113.                                  
  1114.                              End If
  1115.                          Next
  1116.                          
  1117.                          Server(Index).SendData MAPNPCCOUNTINFO & KONGDATA & NpcCount & NETKONGDATA
  1118.                          
  1119.                          For j = 1 To UBound(NPCInfo)
  1120.                              Server(Index).SendData MAPNPCINFO & KONGDATA & j & KONGDATA & NPCInfo(j).X & KONGDATA & NPCInfo(j).Y & KONGDATA & NPCInfo(j).Name_名称 & KONGDATA & NPCInfo(j).Image & NETKONGDATA
  1121.                          Next
  1122.                          
  1123.                          
  1124.                          For j = 1 To playercount
  1125.                             If Player(j).Connected = True Then
  1126.                                 If Server(j).State = 7 Then
  1127.                                     Server(j).SendData PlayerName & KONGDATA & Index & KONGDATA & Player(Index).Name_名字 & NETKONGDATA
  1128.                                     mSleep 100
  1129.                                     Server(j).SendData PLAYERXY & KONGDATA & Index & KONGDATA & Player(Index).X & KONGDATA & Player(Index).Y & NETKONGDATA
  1130.                                     Server(j).SendData PLAYERFACEDATA & KONGDATA & Index & KONGDATA & Player(Index).Face & NETKONGDATA
  1131.                                     Server(j).SendData PLAYERHP & KONGDATA & Index & KONGDATA & Player(Index).HP & KONGDATA & Player(Index).MaxHP & NETKONGDATA
  1132.                                     
  1133.                                     If Player(Index).HP = 0 Then
  1134.                                         Server(j).SendData PLAYERACTDATA & KONGDATA & Index & KONGDATA & HeroActType.Dead_死亡 & KONGDATA & 3 & NETKONGDATA
  1135.                                     End If
  1136.                                     
  1137.                                     If Player(Index).Clothing.State = True Then
  1138.                                         Server(j).SendData CLOTHINGDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).Clothing.Item) & NETKONGDATA
  1139.                                     End If
  1140.                                     If Player(Index).Weapon.State = True Then
  1141.                                         Server(j).SendData WEAPONDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).Weapon.Item) & NETKONGDATA
  1142.                                     End If
  1143. '                                    If Player(Index).HeadPiece.State = True Then
  1144. '                                        Server(j).SendData HEADPIECEDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).HeadPiece.Item) & NETKONGDATA
  1145. '                                    End If
  1146. '                                    If Player(Index).Necklace.State = True Then
  1147. '                                        Server(j).SendData NECKLACEDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).Necklace.Item) & NETKONGDATA
  1148. '                                    End If
  1149. '                                    If Player(Index).BraceletLeft.State = True Then
  1150. '                                        Server(j).SendData BRACELETLEFTDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).BraceletLeft.Item) & NETKONGDATA
  1151. '                                    End If
  1152. '                                    If Player(Index).BraceletRight.State = True Then
  1153. '                                        Server(j).SendData BRACELETRIGHTDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).BraceletRight.Item) & NETKONGDATA
  1154. '                                    End If
  1155. '                                    If Player(Index).FingerRingLeft.State = True Then
  1156. '                                        Server(j).SendData FINGERRINGLEFTDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).FingerRingLeft.Item) & NETKONGDATA
  1157. '                                    End If
  1158. '                                    If Player(Index).FingerRingRight.State = True Then
  1159. '                                        Server(j).SendData FINGERRINGRIGHTDATA & KONGDATA & Index & KONGDATA & 1 & KONGDATA & ItemStr(Player(Index).FingerRingRight.Item) & NETKONGDATA
  1160. '                                    End If
  1161.                                     
  1162.                                 End If
  1163.                             End If
  1164.                          Next
  1165.                     End If
  1166.                     mSendDataMonInfo Index
  1167.                     mSendDataMapItemInfo Index
  1168.                     mSleep 300
  1169.                     mSendDataBagItemInfo Index
  1170.                 Case SCRIPTFUNNAMEINFO          '脚本函数名
  1171.                     MM(1) = mData(3)
  1172.                     mInt(1) = mData(2)
  1173.                     mInt(2) = GetFunNum(1, "@main")
  1174.                     MM(0) = ActScript(mData(1), mData(2), NPCInfo(mData(2)).Script(GetFunNum(mInt(1), MM(1))).ScriptStr)
  1175.                     If Len(MM(0)) > 0 Then
  1176.                         If Player(mData(1)).Connected = True Then
  1177.                             Server(mData(1)).SendData SCRIPTDATAINFO & KONGDATA & mData(2) & KONGDATA & MM(0) & NETKONGDATA
  1178.                         End If
  1179.                     End If
  1180.                 Case TALKINFO       '聊天信息
  1181.                     For j = 1 To playercount
  1182.                         If Player(j).Connected = True Then
  1183.                             Server(j).SendData mWord(i) & NETKONGDATA
  1184.                         End If
  1185.                     Next
  1186.                 Case SILIAOINFO
  1187.                     If Player(mData(3)).Name_名字 = mData(4) And Player(mData(3)).Connected = True Then
  1188.                         Server(mData(1)).SendData TALKINFO & KONGDATA & mData(3) & KONGDATA & mData(4) & KONGDATA & "/" & mData(4) & "  " & mData(5) & KONGDATA & D3DColorRGBA(0, 0, 255, 255) & KONGDATA & 1 & NETKONGDATA
  1189.                         Server(mData(3)).SendData TALKINFO & KONGDATA & mData(3) & KONGDATA & mData(2) & KONGDATA & mData(2) & "→" & mData(5) & KONGDATA & D3DColorRGBA(0, 0, 255, 255) & KONGDATA & 1 & NETKONGDATA
  1190.                         
  1191.                     Else
  1192.                         Server(mData(1)).SendData TALKINFO & KONGDATA & mData(3) & KONGDATA & mData(4) & KONGDATA & mData(4) & "  不在线" & KONGDATA & D3DColorRGBA(255, 0, 0, 255) & KONGDATA & 1 & NETKONGDATA
  1193.                     End If
  1194.                             
  1195.                 Case PLAYERFUHUO        '复活
  1196.                     Player(mData(1)).HP = Player(mData(1)).MaxHP
  1197.                     For j = 1 To playercount
  1198.                         If Player(j).Connected = True Then
  1199.                             Server(j).SendData mWord(i) & NETKONGDATA
  1200.                         End If
  1201.                     Next
  1202.                 Case PLAYERATTACKINFO
  1203.                     Dim AA As Integer, SS As String
  1204.                     AA = mData(1)
  1205.                     SS = mData(2)
  1206.                     GetPlayerInfo AA, SS
  1207.                 Case MONSHANGHAI        '玩家对怪伤害
  1208.                     If Mon(mData(1)).Act <> Dead_怪死亡 Then
  1209.                         If mData(3) = 0 Then
  1210.                             ShangHaiVal = mData(2) - (Rnd * Mon(mData(1)).DBInfo.AC)
  1211.                         ElseIf mData(3) = 1 Then
  1212.                             ShangHaiVal = mData(2) - (Rnd * Mon(mData(1)).DBInfo.MAC)
  1213.                         End If
  1214.                         If ShangHaiVal > 0 Then
  1215.                             Mon(mData(1)).HP = Mon(mData(1)).HP - ShangHaiVal
  1216.                             
  1217.                             If Mon(mData(1)).HP < 0 Then Mon(mData(1)).HP = 0
  1218.                             If Mon(mData(1)).HP > 0 Then
  1219.                                 Mon(mData(1)).追击 = True
  1220.                                 Mon(mData(1)).追击目标 = Index
  1221.                                 If Mon(mData(1)).Act <> AttAck_怪攻击 Or Mon(mData(1)).Act <> Bruise_怪受伤 Then
  1222.                                     Mon(mData(1)).Act = Bruise_怪受伤
  1223.                                     Mon(mData(1)).Pic = 0
  1224.                                     Mon(mData(1)).PicSpeed = 0
  1225.                                 End If
  1226.                             ElseIf Mon(mData(1)).HP = 0 Then
  1227.                                 Mon(mData(1)).DeadLTime = GetTickCount
  1228.                                 Mon(mData(1)).Act = Dead_怪死亡
  1229.                                 Mon(mData(1)).Pic = 0
  1230.                                 Mon(mData(1)).PicSpeed = 0
  1231.                                 Dim mMonItemName() As String, mMonItemCount As Integer, FDD As Integer
  1232.                                 For j = 1 To MonItemsFile
  1233.                                     If Mon(mData(1)).DBInfo.Name_名称 = MonItems(j).MonName Then
  1234.                                         If MonItems(j).mItemCount > 0 Then
  1235.                                             For l = 1 To MonItems(j).mItemCount
  1236.                                                 FDD = Rnd * MonItems(j).mItem(l).BaoLi
  1237. '                                           怪暴东东
  1238.                                                 If FDD < 1 Then
  1239.                                                     mMonItemCount = mMonItemCount + 1
  1240.                                                     ReDim Preserve mMonItemName(mMonItemCount)
  1241.                                                     mMonItemName(mMonItemCount) = MonItems(j).mItem(l).ItemName
  1242.                                                 End If
  1243.                                             Next
  1244.                                         End If
  1245.                                     End If
  1246.                                 Next
  1247.                                 If mMonItemCount > 0 Then
  1248.                                     ItemsXY mMonItemName(), mMonItemCount, Mon(mData(1)).X, Mon(mData(1)).Y
  1249.                                 End If
  1250.                                 NowExp = Mon(mData(1)).DBInfo.Exp_经验值 * mExp
  1251.                                 Player(Index).Exp_经验值 = Player(Index).Exp_经验值 + NowExp
  1252.                                 Server(Index).SendData PLAYERGETEXP & KONGDATA & NowExp & NETKONGDATA
  1253.                                 If Player(Index).Exp_经验值 > LevelExp(Player(Index).Level) Then
  1254.                                     Player(Index).Level = Player(Index).Level + 1
  1255.                                     Player(Index).MaxHP = LevelHP(Player(Index).Level)
  1256.                                     Player(Index).HP = Player(Index).MaxHP
  1257.                                     Server(Index).SendData PLAYERHP & KONGDATA & Index & KONGDATA & Player(Index).HP & KONGDATA & Player(Index).MaxHP & NETKONGDATA
  1258.                                     Server(Index).SendData PLAYERLEVEL & KONGDATA & Index & KONGDATA & Player(Index).Name_名字 & KONGDATA & Player(Index).Level & NETKONGDATA
  1259.                                     Server(Index).SendData PLAYEREXPDATA & KONGDATA & Player(Index).Exp_经验值 & KONGDATA & LevelExp(Player(Index).Level) & NETKONGDATA
  1260.                                 End If
  1261.                                 
  1262.                             End If
  1263.                             For j = 1 To playercount
  1264.                                 If Abs(Mon(mData(1)).X - Player(j).X) < 17 And Abs(Mon(mData(1)).Y - Player(j).Y) < 20 Then
  1265.                                     
  1266.                                     If Player(j).Connected = True Then
  1267.                                         If Server(j).State = sckConnected Then
  1268.                                             Server(j).SendData MONHP & KONGDATA & mData(1) & KONGDATA & Mon(mData(1)).HP & KONGDATA & Mon(mData(1)).MaxHP & NETKONGDATA
  1269.                                             Server(j).SendData MONACTDATA & KONGDATA & mData(1) & KONGDATA & Mon(mData(1)).Act & KONGDATA & Mon(mData(1)).Face & NETKONGDATA
  1270.                                             If mMonItemCount > 0 Then
  1271.                                                 mSendDataMapItemInfo j
  1272.                                             End If
  1273.                                         End If
  1274.                                     End If
  1275.                                 End If
  1276.                             Next
  1277.                         End If
  1278.                     End If
  1279.                 Case SHANGHAIDATA   '玩家伤害
  1280.                     
  1281.                     If mData(3) = 0 Then
  1282.                         ShangHaiVal = mData(2) - (Rnd * Abs(Player(mData(1)).AC1 - Player(mData(1)).Ac2) + IIf(Player(mData(1)).AC1 < Player(mData(1)).Ac2, Player(mData(1)).AC1, Player(mData(1)).Ac2))
  1283.                     ElseIf mData(3) = 1 Then
  1284.                         ShangHaiVal = mData(2) - (Rnd * Abs(Player(mData(1)).MAC1 - Player(mData(1)).Mac2) + IIf(Player(mData(1)).MAC1 < Player(mData(1)).Mac2, Player(mData(1)).MAC1, Player(mData(1)).Mac2))
  1285.                     End If
  1286.                     If ShangHaiVal > 0 Then
  1287.                         Player(mData(1)).HP = Player(mData(1)).HP - ShangHaiVal
  1288.                         If Player(mData(1)).HP < 0 Then Player(mData(1)).HP = 0
  1289.                         For j = 1 To playercount
  1290.                             If Player(j).Connected = True Then
  1291.                                 Server(j).SendData PLAYERHP & KONGDATA & mData(1) & KONGDATA & Player(mData(1)).HP & KONGDATA & Player(mData(1)).MaxHP & NETKONGDATA
  1292.                                 If Player(mData(1)).HP > 0 Then
  1293.                                     Server(j).SendData PLAYERACTDATA & KONGDATA & mData(1) & KONGDATA & HeroActType.Bruise_受伤 & KONGDATA & 0 & NETKONGDATA
  1294.                                 Else
  1295.                                     Server(j).SendData PLAYERACTDATA & KONGDATA & mData(1) & KONGDATA & HeroActType.Dead_死亡 & KONGDATA & 0 & NETKONGDATA
  1296.                                 End If
  1297.                             End If
  1298.                         Next
  1299.                     End If
  1300.                 Case PLAYERHP       '玩家HP
  1301.                     Player(mData(1)).HP = mData(2)
  1302.                     Player(mData(1)).MaxHP = mData(3)
  1303.                     
  1304.                     For j = 1 To playercount
  1305.                         If Player(j).Connected = True Then
  1306.                             Server(j).SendData mWord(i) & NETKONGDATA
  1307.                         End If
  1308.                     Next
  1309.                 Case PLAYERJIAOYIITEM       '交易物品
  1310.                     Server(mData(1)).SendData mWord(i) & NETKONGDATA
  1311.                 Case PLAYERJIAOYIEND        '交易取消
  1312.                     Server(mData(2)).SendData mWord(i) & NETKONGDATA
  1313.                 Case PLAYERJIAOYIOK         '交易确认
  1314.                     Server(mData(2)).SendData PLAYERJIAOYIOK & KONGDATA & mData(1) & NETKONGDATA
  1315.                 Case PLAYERJIAOYI           '交易
  1316.                     If Player(mData(2)).Connected And Player(mData(2)).HP > 0 Then
  1317.                         Server(mData(2)).SendData PLAYERJIAOYI & KONGDATA & mData(1) & NETKONGDATA
  1318.                         Server(mData(1)).SendData PLAYERJIAOYI & KONGDATA & mData(2) & NETKONGDATA
  1319.                     End If
  1320.                 Case PLAYERMP       '玩家MP
  1321.                     Player(mData(1)).MP = mData(2)
  1322.                     Player(mData(1)).MaxMP = mData(3)
  1323.                 Case PlayerName     '玩家名
  1324.                     Player(mData(1)).Name_名字 = mData(2)
  1325.                     Text.Text = Text.Text & "玩家[" & Player(mData(1)).Name_名字 & "]上线了!......" & vbCrLf
  1326.                     For j = 1 To playercount
  1327.                         If Player(j).Connected = True Then
  1328.                             Server(j).SendData mWord(i) & NETKONGDATA
  1329.                         End If
  1330.                     Next
  1331.                 Case PLAYERXY       '玩家XY
  1332.                     Player(mData(1)).X = mData(2)
  1333.                     Player(mData(1)).Y = mData(3)
  1334.                     Player(mData(1)).Act = Stand_站立
  1335.                     Player(mData(1)).ActState = Stand_站立
  1336.                     For j = 1 To playercount
  1337.                         If Player(j).Connected = True Then
  1338.                             If j <> mData(1) Then Server(j).SendData mWord(i) & NETKONGDATA
  1339.                         End If
  1340.                     Next
  1341.                 Case PLAYERATTACKDATA
  1342.                     For j = 1 To playercount
  1343. '                        ServerSendData j, Str(mWord(i))
  1344.                         If Player(j).Connected = True Then
  1345.                             If Server(j).State = sckConnected Then
  1346.                                 Server(j).SendData mWord(i) & NETKONGDATA
  1347.                             End If
  1348.                         End If
  1349.                     Next
  1350.                 Case WALKDATA       '玩家走
  1351.                     Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) - 1
  1352.                     Player(mData(1)).Act = walk_走
  1353.                     Player(mData(1)).Pic = 0
  1354.                     Player(mData(1)).PicSpeed = 0
  1355.                     Player(mData(1)).X = mData(2)
  1356.                     Player(mData(1)).Y = mData(3)
  1357.                     Player(mData(1)).CanAct = False
  1358.                     For j = 1 To playercount
  1359.                         If Player(j).Connected = True Then
  1360.                             Server(j).SendData mWord(i) & NETKONGDATA
  1361.                         End If
  1362.                     Next
  1363.                     Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) + 1
  1364.                     mSendDataMonInfo Index
  1365.                     mSendDataMapItemInfo Index
  1366.                 Case RUNDATA        '玩家跑
  1367.                     Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) - 1
  1368.                     Player(mData(1)).Act = Run_跑
  1369.                     Player(mData(1)).Pic = 0
  1370.                     Player(mData(1)).PicSpeed = 0
  1371.                     Player(mData(1)).X = mData(2)
  1372.                     Player(mData(1)).Y = mData(3)
  1373.                     Player(mData(1)).CanAct = False
  1374.                     For j = 1 To playercount
  1375.                         If Player(j).Connected = True Then
  1376.                             Server(j).SendData mWord(i) & NETKONGDATA
  1377.                         End If
  1378.                     Next
  1379.                     Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) + 1
  1380.                     mSendDataMonInfo Index
  1381.                     mSendDataMapItemInfo Index
  1382.                 Case PLAYERFACEDATA     '玩家方向
  1383.                     Player(Val(mData(1))).Face = mData(2)
  1384.                     For j = 1 To playercount
  1385.                         If Player(j).Connected = True Then
  1386.                             Server(j).SendData mWord(i) & NETKONGDATA
  1387.                             
  1388.                         End If
  1389.                     Next
  1390.                 Case PLAYERMAGICDATA    '施放魔法
  1391.                     If mData(4) = "治愈术" Then
  1392.                         If Player(Index).HP < Player(Index).MaxHP Then
  1393.                             Player(Index).HP = Player(Index).HP + 10
  1394.                             If Player(Index).HP > Player(Index).MaxHP Then
  1395.                                 Player(Index).HP = Player(Index).MaxHP
  1396.                             End If
  1397.                             Server(Index).SendData PLAYERHP & KONGDATA & Index & KONGDATA & Player(Index).HP & KONGDATA & Player(Index).MaxHP & NETKONGDATA
  1398.                         End If
  1399.                     End If
  1400.                     For j = 1 To playercount
  1401.                         If Player(j).Connected = True Then
  1402.                             Server(j).SendData mWord(i) & NETKONGDATA
  1403.                         End If
  1404.                     Next
  1405.                 Case CLOTHINGDATA       '衣服
  1406.                     Player(mData(1)).Clothing.State = mData(2)
  1407.                     MS = mData(3)
  1408.                     If mData(2) <> 0 Then Player(mData(1)).Clothing.Item = GetItem(MS)
  1409.                     For j = 1 To playercount
  1410.                         If Player(j).Connected = True Then
  1411.                             Server(j).SendData mWord(i) & NETKONGDATA
  1412.                         End If
  1413.                     Next
  1414.                 Case WEAPONDATA         '武器
  1415.                     Player(mData(1)).Weapon.State = mData(2)
  1416.                     MS = mData(3)
  1417.                     If mData(2) <> 0 Then Player(mData(1)).Weapon.Item = GetItem(MS)
  1418.                     For j = 1 To playercount
  1419.                         If Player(j).Connected = True Then
  1420.                             Server(j).SendData mWord(i) & NETKONGDATA
  1421.                         End If
  1422.                     Next
  1423.                 Case HEADPIECEDATA         '头盔
  1424.                     Player(mData(1)).HeadPiece.State = mData(2)
  1425.                     MS = mData(3)
  1426.                     If mData(2) <> 0 Then Player(mData(1)).HeadPiece.Item = GetItem(MS)
  1427.                     For j = 1 To playercount
  1428.                         If Player(j).Connected = True Then
  1429.                             Server(j).SendData mWord(i) & NETKONGDATA
  1430.                         End If
  1431.                     Next
  1432.                 Case NECKLACEDATA         '项链
  1433.                     Player(mData(1)).Necklace.State = mData(2)
  1434.                     MS = mData(3)
  1435.                     If mData(2) <> 0 Then Player(mData(1)).Necklace.Item = GetItem(MS)
  1436.                     For j = 1 To playercount
  1437.                         If Player(j).Connected = True Then
  1438.                             Server(j).SendData mWord(i) & NETKONGDATA
  1439.                         End If
  1440.                     Next
  1441.                 Case BRACELETLEFTDATA         '左手镯
  1442.                     Player(mData(1)).BraceletLeft.State = mData(2)
  1443.                     MS = mData(3)
  1444.                     If mData(2) <> 0 Then Player(mData(1)).BraceletLeft.Item = GetItem(MS)
  1445.                     For j = 1 To playercount
  1446.                         If Player(j).Connected = True Then
  1447.                             Server(j).SendData mWord(i) & NETKONGDATA
  1448.                         End If
  1449.                     Next
  1450.                 Case BRACELETRIGHTDATA         '右手镯
  1451.                     Player(mData(1)).BraceletRight.State = mData(2)
  1452.                     MS = mData(3)
  1453.                     If mData(2) <> 0 Then Player(mData(1)).BraceletRight.Item = GetItem(MS)
  1454.                     For j = 1 To playercount
  1455.                         If Player(j).Connected = True Then
  1456.                             Server(j).SendData mWord(i) & NETKONGDATA
  1457.                         End If
  1458.                     Next
  1459.                 Case FINGERRINGLEFTDATA         '左戒指
  1460.                     Player(mData(1)).FingerRingLeft.State = mData(2)
  1461.                     MS = mData(3)
  1462.                     If mData(2) <> 0 Then Player(mData(1)).FingerRingLeft.Item = GetItem(MS)
  1463.                     For j = 1 To playercount
  1464.                         If Player(j).Connected = True Then
  1465.                             Server(j).SendData mWord(i) & NETKONGDATA
  1466.                         End If
  1467.                     Next
  1468.                 Case FINGERRINGRIGHTDATA         '右戒指
  1469.                     Player(mData(1)).FingerRingRight.State = mData(2)
  1470.                     MS = mData(3)
  1471.                     If mData(2) <> 0 Then Player(mData(1)).FingerRingRight.Item = GetItem(MS)
  1472.                     For j = 1 To playercount
  1473.                         If Player(j).Connected = True Then
  1474.                             Server(j).SendData mWord(i) & NETKONGDATA
  1475.                         End If
  1476.                     Next
  1477.             End Select
  1478.         End If
  1479. mErr:
  1480.     Next
  1481.         
  1482. End Sub
  1483. '发送附近怪物信息给玩家
  1484. Private Sub mSendDataMonInfo(Index As Integer)
  1485.     Dim i As Integer
  1486.     HMonCount = 0
  1487.     ReDim HMonInfo(0)
  1488.     For i = 1 To MonCount
  1489.         If Abs(Mon(i).X - Player(Index).X) < 17 And Abs(Mon(i).Y - Player(Index).Y) < 20 And Mon(i).Dead = False Then
  1490.             HMonCount = HMonCount + 1
  1491.             ReDim Preserve HMonInfo(HMonCount)
  1492.             HMonInfo(HMonCount) = Mon(i)
  1493.         End If
  1494.     Next
  1495.     
  1496.     If HMonCount > 0 Then
  1497.         If Player(Index).Connected = True Then
  1498.             If Server(Index).State = sckConnected Then
  1499.                 Server(Index).SendData HEREMONCOUNT & KONGDATA & HMonCount & NETKONGDATA
  1500.                 For i = 1 To HMonCount
  1501.                     Server(Index).SendData HEREMONINFO & KONGDATA & i & KONGDATA & HMonInfo(i).Id & KONGDATA & HMonInfo(i).DBInfo.Race_种族 & KONGDATA & HMonInfo(i).DBInfo.RaceImage_种族图像 & KONGDATA & HMonInfo(i).DBInfo.Appr_形象代码 & KONGDATA & HMonInfo(i).DBInfo.Name_名称 & KONGDATA & HMonInfo(i).Face & KONGDATA & HMonInfo(i).X & KONGDATA & HMonInfo(i).Y & KONGDATA & HMonInfo(i).Act & KONGDATA & HMonInfo(i).Pic & NETKONGDATA
  1502.                 Next
  1503.             End If
  1504.         End If
  1505.     End If
  1506. End Sub
  1507. '////////  发送玩家包裹物品信息
  1508. Private Sub mSendDataBagItemInfo(Index As Integer)
  1509.     Dim i As Integer
  1510.     
  1511.     For i = 0 To 39
  1512.         If Player(Index).Bag(i).State = True Then
  1513.             Server(Index).SendData PLAYERBAGITEMDATA & KONGDATA & i & KONGDATA & ItemStr(Player(Index).Bag(i).Item) & NETKONGDATA
  1514.         End If
  1515.     Next
  1516.         
  1517. End Sub
  1518. '///  发送附近地图上物品
  1519. Public Sub mSendDataMapItemInfo(Index As Integer)
  1520.     Dim i As Integer
  1521.     Dim mMapItemCount As Long
  1522.     Dim mMapItem() As MapItemType
  1523.     For i = 1 To MapItemCount
  1524.         If i > MapItemCount Then Exit For
  1525.         If GetTickCount - MapItem(i).mTime > 60000 Then
  1526.             MapItem(i) = MapItem(MapItemCount)
  1527.             MapItemCount = MapItemCount - 1
  1528.             ReDim Preserve MapItem(MapItemCount)
  1529.         Else
  1530.             If Abs(MapItem(i).X - Player(Index).X) < 17 And Abs(MapItem(i).Y - Player(Index).Y) < 20 Then
  1531.                 mMapItemCount = mMapItemCount + 1
  1532.                 ReDim Preserve mMapItem(mMapItemCount)
  1533.                 mMapItem(mMapItemCount) = MapItem(i)
  1534.                 mMapItem(mMapItemCount).Id = i
  1535.             End If
  1536.         End If
  1537.     Next
  1538.     If mMapItemCount > 0 Then
  1539.         If Player(Index).Connected = True Then
  1540.             If Server(Index).State = sckConnected Then
  1541.                 Server(Index).SendData HEREMAPITEMCOUNT & KONGDATA & mMapItemCount & NETKONGDATA
  1542.                 
  1543.                 For i = 1 To mMapItemCount
  1544.                     Server(Index).SendData HEREMAPITEMINFO & KONGDATA & i & KONGDATA & mMapItem(i).Id & KONGDATA & mMapItem(i).mItem.Name & KONGDATA & mMapItem(i).mItem.Looks & KONGDATA & mMapItem(i).X & KONGDATA & mMapItem(i).Y & NETKONGDATA
  1545.                 Next
  1546.             End If
  1547.         End If
  1548.     End If
  1549. End Sub
  1550. Private Sub Server_DataArrival(Index As Integer, ByVal bytesTotal As Long)
  1551.     Dim mData As String
  1552.     Server(Index).GetData mData, vbString
  1553.     ExecuteNETData mData, Index
  1554. '    Text.Text = Text.Text & Server(Index).BytesReceived & vbCrLf
  1555. End Sub
  1556. Private Sub Server_Error(Index As Integer, ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  1557.     Player(Index).Connected = False
  1558.     Server(Index).Close
  1559. '    Unload Server(Index)
  1560.     
  1561. End Sub
  1562. Private Sub Text_Change()
  1563.     Text.SelStart = Len(Text.Text)
  1564.     Text.SelLength = 1
  1565. End Sub
  1566. Private Sub Text_KeyPress(KeyAscii As Integer)
  1567.     KeyAscii = 0
  1568. End Sub
  1569. Private Sub Timer1_Timer()
  1570.     MonAct
  1571. End Sub