FrmMain.frm
资源名称:vbmcrisrc.rar [点击查看]
上传用户:pcw2004
上传日期:2022-02-02
资源大小:743k
文件大小:76k
源码类别:
DirextX编程
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
- Begin VB.Form FrmMain
- BackColor = &H80000001&
- BorderStyle = 1 'Fixed Single
- Caption = "仿传奇"
- ClientHeight = 9000
- ClientLeft = 45
- ClientTop = 435
- ClientWidth = 12000
- Icon = "FrmMain.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 600
- ScaleMode = 3 'Pixel
- ScaleWidth = 800
- StartUpPosition = 2 '屏幕中心
- Begin VB.Timer Timer2
- Enabled = 0 'False
- Interval = 500
- Left = 1200
- Top = 600
- End
- Begin VB.TextBox RegHeroText
- BackColor = &H80000006&
- BorderStyle = 0 'None
- BeginProperty Font
- Name = "宋体"
- Size = 12
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000004&
- Height = 270
- Left = 7320
- TabIndex = 5
- Top = 1590
- Visible = 0 'False
- Width = 2175
- End
- Begin VB.TextBox RegIDText
- BackColor = &H80000006&
- BorderStyle = 0 'None
- BeginProperty Font
- Name = "宋体"
- Size = 12
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000004&
- Height = 240
- Left = 3720
- TabIndex = 4
- Top = 2475
- Visible = 0 'False
- Width = 1695
- End
- Begin VB.TextBox IDText
- BackColor = &H80000006&
- BorderStyle = 0 'None
- BeginProperty Font
- Name = "宋体"
- Size = 12
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000004&
- Height = 270
- Left = 5400
- TabIndex = 3
- Top = 3960
- Visible = 0 'False
- Width = 2055
- End
- Begin MSWinsockLib.Winsock LoginClient
- Left = 480
- Top = 600
- _ExtentX = 741
- _ExtentY = 741
- _Version = 393216
- End
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- Height = 240
- Left = 3120
- TabIndex = 1
- Top = 8715
- Visible = 0 'False
- Width = 5775
- End
- Begin VB.Timer Timer1
- Interval = 1
- Left = 840
- Top = 600
- End
- Begin MSWinsockLib.Winsock Client
- Left = 120
- Top = 600
- _ExtentX = 741
- _ExtentY = 741
- _Version = 393216
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "Label2"
- Height = 180
- Left = 1320
- TabIndex = 2
- Top = 360
- Visible = 0 'False
- Width = 540
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "正在连接服务器......"
- BeginProperty Font
- Name = "宋体"
- Size = 15
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000005&
- Height = 300
- Left = 4560
- TabIndex = 0
- Top = 4200
- Width = 3000
- End
- End
- Attribute VB_Name = "FrmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Client_Close()
- If JiaoYi.State = True Then
- JiaoYiOKCancel False
- JiaoYi.State = False
- Client.SendData PLAYERJIAOYIEND & KONGDATA & MainHeroNum & KONGDATA & JiaoYi.JiaoYiPlayerNum & NETKONGDATA
- SendDataOK = False
- End If
- mSleep 100
- Client.Close
- End Sub
- '//////// Server发送数据
- Private Sub ClientSendData(Str As String)
- If Client.State = sckConnected Then
- Client.SendData Str & NETKONGDATA
- End If
- End Sub
- '//////// LoginServer发送数据
- Private Sub LoginClientSendData(Str As String)
- If LoginClient.State = sckConnected Then
- LoginClient.SendData Str & NETKONGDATA
- End If
- End Sub
- Private Sub Client_Connect()
- LoginClient.Close
- ' If LoginGameMusic.GetStatus = 1 Then LoginGameMusic.Stop
- Set LoginGameMusic = Nothing
- Client.SendData LOGINNAME & KONGDATA & mHero(mSelHeroNum).mName & KONGDATA & mHero(mSelHeroNum).Job & KONGDATA & mHero(mSelHeroNum).Sex & NETKONGDATA
- End Sub
- Private Sub Client_DataArrival(ByVal bytesTotal As Long)
- Dim mData As String
- Client.GetData mData, vbString
- NETDATACOUNT = NETDATACOUNT + 1
- If NETDATACOUNT > 100 Then NETDATACOUNT = 0
- ReDim Preserve NETDATA(NETDATACOUNT)
- NETDATA(NETDATACOUNT) = mData
- End Sub
- Public Sub PlayNetData()
- Dim N As Integer, M As Integer
- Dim AA As Integer, BB As String, CC As String, EE As Long, DD As Long
- Dim MM(5) As String
- On Error GoTo mErr
- If NETDATACOUNT > 0 And NowNETData = "" Then
- NowNETData = NETDATA(1)
- If NETDATACOUNT > 1 Then
- For M = 1 To NETDATACOUNT
- If M < NETDATACOUNT Then NETDATA(M) = NETDATA(M + 1)
- DoEvents
- Next
- End If
- NETDATACOUNT = NETDATACOUNT - 1
- ReDim Preserve NETDATA(NETDATACOUNT)
- Dim mData As Variant, mWord As Variant, i As Integer, j As Integer, l As Integer
- Dim mS As String
- mWord = Split(NowNETData, NETKONGDATA)
- For i = 0 To UBound(mWord)
- If Len(mWord(i)) > 4 Then
- mData = Split(mWord(i), KONGDATA)
- Select Case mData(0)
- Case PLAYERBAGITEMDATA '玩家包裹物品
- For j = 0 To 39
- If Bag(j).State = False Then
- Bag(j).State = True
- Bag(j).ID = mData(1)
- MM(0) = mData(2)
- Bag(j).Item = GetItem(MM(0))
- Exit For
- End If
- Next
- Case PLAYEREXPDATA '玩家经验值
- Player(MainHeroNum).Exp_经验值 = mData(1)
- Player(MainHeroNum).MaxExp_所需经验 = mData(2)
- Case PLAYERGETEXP
- Player(MainHeroNum).Exp_经验值 = Player(MainHeroNum).Exp_经验值 + mData(1)
- AddTalkStr "获得" & mData(1) & "经验", D3DColorRGBA(255, 0, 0, 255)
- Case HEREMAPITEMCOUNT '附近地图上物品数量
- MapItemCount = mData(1)
- ReDim MapItem(MapItemCount)
- Case HEREMAPITEMINFO '附近地图上物品属性
- MapItem(mData(1)).ID = mData(2)
- MapItem(mData(1)).mItem.Name = mData(3)
- MapItem(mData(1)).mItem.Looks = mData(4)
- MapItem(mData(1)).X = mData(5)
- MapItem(mData(1)).Y = mData(6)
- Case MONFACE '怪 方向
- For j = 1 To MonCount
- If Mon(j).ID = mData(1) Then
- Mon(j).Face = mData(2)
- Exit For
- End If
- Next
- Case MONHP '怪HP
- For j = 1 To MonCount
- If Mon(j).ID = mData(1) Then
- Mon(j).HP = mData(2)
- Mon(j).MaxHP = mData(3)
- Exit For
- End If
- Next
- Case MONACTDATA '怪动作
- For j = 1 To MonCount
- If Mon(j).ID = mData(1) Then
- Mon(j).Act = mData(2)
- Mon(j).Face = mData(3)
- Mon(j).Pic = 0
- Mon(j).PicSpeed = 0
- Exit For
- End If
- Next
- Case MONMOVE '怪移动
- For j = 1 To MonCount
- If Mon(j).ID = mData(1) Then
- Mon(j).X = mData(2)
- Mon(j).Y = mData(3)
- Mon(j).Act = Move_怪移动
- Mon(j).Pic = 0
- Mon(j).PicSpeed = 0
- Mon(j).XOFFECT = 48
- Mon(u).YOFFECT = 32
- Exit For
- End If
- Next
- Case HEREMONCOUNT '附近怪数量
- SaveMonCount = MonCount
- ReDim SaveMon(SaveMonCount)
- For j = 1 To SaveMonCount
- SaveMon(j) = Mon(j)
- Next
- MonCount = mData(1)
- ReDim Mon(MonCount)
- Case HEREMONINFO '附近怪属性
- ' MsgBox mData(1)
- Mon(mData(1)).ID = mData(2)
- For j = 1 To SaveMonCount
- If Mon(mData(1)).ID = SaveMon(j).ID Then
- Mon(mData(1)) = SaveMon(j)
- Exit For
- End If
- Next
- Mon(mData(1)).DBInfo.Race_种族 = mData(3)
- Mon(mData(1)).DBInfo.RaceImage_种族图像 = mData(4)
- Mon(mData(1)).DBInfo.Appr_形象代码 = mData(5)
- Mon(mData(1)).DBInfo.Name_名称 = mData(6)
- Mon(mData(1)).Face = mData(7)
- Mon(mData(1)).X = mData(8)
- Mon(mData(1)).Y = mData(9)
- ' If Mon(mData(1)).Act <> mData(10) Then
- ' Mon(mData(1)).Act = mData(10)
- ' Mon(mData(1)).Pic = mData(11)
- ' End If
- If mData(1) = MonCount Then MonPaiXu
- Case TISHIDATA '提示信息
- MsgBox mData(1)
- Case REGIDSTATE
- If mData(1) = 0 Then
- MsgBox mData(2)
- ElseIf mData(1) = 1 Then
- MsgBox "注册成功!"
- End If
- Case LOGINSTATE '登陆游戏状态
- If mData(1) = 0 Then
- MsgBox "登陆失败,账号错误!,请重新输入账号!", , "登陆失败"
- ElseIf mData(1) = 1 Then
- FrmMain.IDText.Visible = False
- IDLoginOK = True
- End If
- Case SAVEHERODATA '角色信息
- ' MsgBox "dkj"
- mHero(mData(1)).State = True
- mHero(mData(1)).mName = mData(2)
- mHero(mData(1)).Level = mData(3)
- mHero(mData(1)).Job = mData(4)
- mHero(mData(1)).Sex = mData(5)
- Case SELHERONUM '选择角色
- If HeroID = mData(1) Then mSelHeroNum = mData(2)
- mHero(mSelHeroNum).mSel = 3
- mHero(mSelHeroNum).Pic = 0
- mHero(3 - mSelHeroNum).mSel = 2
- mHero(3 - mSelHeroNum).Pic = 12
- SelHeroMagic = True
- SelHeroMagicPic = 0
- SelHeroMagicPicSpeed = 0
- Case PLAYERSEX '玩家性别
- If Player(mData(1)).Name_名字 = mData(2) Then
- Player(mData(1)).Sex_性别 = mData(3)
- End If
- Case PLAYERGOLD '玩家金币
- If Player(mData(1)).Name_名字 = mData(2) Then
- Player(mData(1)).Gold_金币 = mData(3)
- End If
- Case GIVEITEMDATA '得到物品
- Dim mCount As Integer
- If Player(mData(1)).Name_名字 = mData(2) Then
- MM(0) = mData(3)
- If UBound(mData) >= 4 Then
- mCount = mData(4)
- Else
- mCount = 1
- End If
- GetItems GetItem(MM(0)), mCount
- AddTalkStr "获得〖" & GetItem(MM(0)).Name & "〗", D3DColorRGBA(255, 0, 0, 255)
- End If
- Case PLAYERLEVEL '玩家等级
- Player(mData(1)).Level = mData(3)
- AddTalkStr "恭喜你升到" & Player(mData(1)).Level & "级", D3DColorRGBA(255, 0, 0, 255)
- Case PLAYERPK '玩家PK值
- Player(mData(1)).PK值 = mData(2)
- Case SCRIPTDATAINFO '脚本信息
- SelNpcNum = mData(1)
- MM(0) = mData(2)
- GetText MM(0)
- NpcFrm.State = True
- Case MAPNPCCOUNTINFO '地图上NPC数量
- NpcCount = mData(1)
- ReDim NPCInfo(NpcCount)
- Case MAPNPCINFO '地图上NPC信息
- NPCInfo(mData(1)).X = mData(2)
- NPCInfo(mData(1)).Y = mData(3)
- NPCInfo(mData(1)).Name_名称 = mData(4)
- NPCInfo(mData(1)).Image = mData(5)
- Map.Map5(NPCInfo(mData(1)).X, NPCInfo(mData(1)).Y) = 1
- Case TALKINFO '聊天信息
- Select Case mData(5)
- Case 0
- MM(0) = mData(2)
- MM(1) = mData(3)
- DD = mData(4)
- AddTalkStr MM(1), DD, MM(0)
- If Player(mData(1)).Name_名字 = MM(0) Then
- Player(mData(1)).LiaoTianInfo = InfoHuangHang(MM(1))
- Player(mData(1)).LiaoTianLTime = GetTickCount
- End If
- Case 1
- MM(0) = mData(2)
- MM(1) = mData(3)
- DD = mData(4)
- AddTalkStr MM(1), DD, MM(0)
- End Select
- Case PLAYERFUHUO
- Player(mData(1)).Dead = False
- Player(mData(1)).HP = Player(mData(1)).MaxHP
- Player(mData(1)).Act = Stand_站立
- Player(mData(1)).ActState = Stand_站立
- Player(mData(1)).Pic = 0
- Case PLAYERJIAOYIEND '交易取消
- JiaoYiOKCancel False
- Case PLAYERJIAOYIOK '交易确认
- If JiaoYi.JiaoYiOK = False Then
- JiaoYi.JiaoYiOK = True
- Else
- JiaoYiOKCancel True
- End If
- Case PLAYERJIAOYI '交易
- JiaoYi.State = True
- JiaoYi.JiaoYiOK = False
- JiaoYi.JiaoYiPlayerNum = mData(1)
- JiaoYi.JiaoYiPlayerName = Player(mData(1)).Name_名字
- BagFrm.State = True: BagFrm.X = 0: BagFrm.Y = 30
- Case PLAYERJIAOYIITEM
- For N = 0 To 9
- If JiaoYi.BeiJiaoYiItems(N).State = False Then
- JiaoYi.BeiJiaoYiItems(N).State = True
- mS = mData(2)
- JiaoYi.BeiJiaoYiItems(N).Item = GetItem(mS)
- Exit For
- End If
- Next
- Case MONACTDATA
- For j = 1 To MonCount
- If Mon(j).ID = mData(1) Then
- Mon(j).Act = mData(2)
- Mon(j).Pic = 0
- Mon(j).PicSpeed = 0
- End If
- Next
- Case PLAYERACTDATA
- If Player(mData(1)).Act <> Dead_死亡 And Player(mData(1)).Act <> mData(2) Then
- Player(mData(1)).Act = mData(2)
- Player(mData(1)).ActState = mData(2)
- Player(mData(1)).Pic = mData(3)
- Player(mData(1)).PicSpeed = 0
- End If
- Case PLAYERHP '玩家HP
- Player(mData(1)).HP = mData(2)
- Player(mData(1)).MaxHP = mData(3)
- Case PLAYEREND '玩家下线
- If mData(1) <> MainHeroNum Then
- AddTalkStr "玩家【" & Player(mData(1)).Name_名字 & "】已下线", D3DColorRGBA(255, 0, 0, 255)
- End If
- Player(mData(1)).Conneted = False
- Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = 0
- Case PLAYERMAGICDATA '玩家魔法
- If mData(1) = MainHeroNum Then
- If mData(3) = HeroActType.AttAck_攻击 Then
- NetAttackData = False
- ElseIf mData(3) = HeroActType.Magic_魔法 Then
- NetMagicData = False
- End If
- Else
- Player(mData(1)).Act = mData(3)
- Player(mData(1)).Pic = 0
- Player(mData(1)).PicSpeed = 0
- Player(mData(1)).CanAct = False
- End If
- AA = mData(1)
- BB = mData(2)
- CC = mData(4)
- DD = mData(5)
- EE = mData(6)
- UserPlayerMagic AA, BB, CC, DD, EE
- Case NOWPLAYERCOUNT '玩家总数
- PlayerCount = mData(1)
- ReDim Preserve Player(PlayerCount)
- ReDim Preserve PaiXuPlayerNum(PlayerCount)
- Case PlayerName '玩家名字
- Player(mData(1)).Name_名字 = mData(2)
- If mData(1) <> MainHeroNum Then
- AddTalkStr "玩家【" & mData(2) & "】已上线", D3DColorRGBA(255, 0, 0, 255)
- End If
- Running = 2
- Case PLAYERXY '玩家坐标
- Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = 0
- Player(mData(1)).X = mData(2)
- Player(mData(1)).Y = mData(3)
- Player(mData(1)).Act = Stand_站立
- Player(mData(1)).ActState = Stand_站立
- Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = mData(1)
- Player(mData(1)).Conneted = True
- PaiXuPlayer
- Case PLAYERATTACKDATA
- If mData(1) = MainHeroNum Then
- NetAttackData = False
- Else
- Player(mData(1)).Act = AttAck_攻击
- Player(mData(1)).ActState = AttAck_攻击
- Player(mData(1)).Pic = 0
- Player(mData(1)).PicSpeed = 0
- End If
- Case WALKDATA '玩家走
- If mData(1) = MainHeroNum Then
- NetWalkData = False
- Else
- Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = 0
- Player(mData(1)).Act = walk_走
- Player(mData(1)).Pic = 0
- Player(mData(1)).PicSpeed = 0
- Player(mData(1)).X = mData(2)
- Player(mData(1)).Y = mData(3)
- Player(mData(1)).XOFFECT = 48
- Player(mData(1)).YOFFECT = 32
- Player(mData(1)).Face = mData(4)
- Player(mData(1)).CanAct = False
- Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = mData(1)
- Player(mData(1)).Conneted = True
- PaiXuPlayer
- End If
- Case RUNDATA '玩家跑
- If mData(1) = MainHeroNum Then
- NetRunData = False
- Else
- Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = 0
- Player(mData(1)).Act = Run_跑
- Player(mData(1)).Pic = 0
- Player(mData(1)).PicSpeed = 0
- Player(mData(1)).X = mData(2)
- Player(mData(1)).Y = mData(3)
- Player(mData(1)).XOFFECT = 96
- Player(mData(1)).YOFFECT = 64
- Player(mData(1)).Face = mData(4)
- Player(mData(1)).CanAct = False
- Map.Map3(Player(mData(1)).X, Player(mData(1)).Y) = mData(1)
- Player(mData(1)).Conneted = True
- PaiXuPlayer
- End If
- Case PLAYERFACEDATA '玩家方向
- Player(mData(1)).Face = mData(2)
- Case PlayerNum '玩家编号
- MainHeroNum = mData(1)
- Dim k As Integer
- For k = 0 To 39
- Bag(k).State = False
- Next
- TalkCount = 0
- ReDim Preserve TalkStr(TalkCount)
- ' Player(MainHeroNum) = SaveHero
- Client.SendData LOGINNAME & KONGDATA & mLoginName & NETKONGDATA
- GetHeroInfo
- Player(MainHeroNum).Act = Stand_站立
- Map.Map3(Player(MainHeroNum).X, Player(MainHeroNum).Y) = MainHeroNum
- DoEvents
- Label1.Visible = False
- AddTalkStr "欢迎进入仿传奇,您可以在游戏中随意PK,如果有人的话~", D3DColorRGBA(20, 180, 100, 255)
- AddTalkStr "祝您在游戏中玩的开心、愉快~~~~!!,感谢您对我的支持!!!", D3DColorRGBA(20, 180, 100, 255)
- Player(MainHeroNum).Gold_金币 = 1000000
- MainLoop
- Case CLOTHINGDATA '衣服
- Player(mData(1)).Clothing.State = mData(2)
- mS = mData(3)
- If Player(mData(1)).Clothing.State = True Then Player(mData(1)).Clothing.Item = GetItem(mS)
- If mData(1) = MainHeroNum Then GetHeroInfo
- Case WEAPONDATA '武器
- Player(mData(1)).Weapon.State = mData(2)
- mS = mData(3)
- If mData(2) <> 0 Then Player(mData(1)).Weapon.Item = GetItem(mS)
- If mData(1) = MainHeroNum Then GetHeroInfo
- Case HEADPIECEDATA '头盔
- Player(mData(1)).HeadPiece.State = mData(2)
- mS = mData(3)
- If mData(2) <> 0 Then Player(mData(1)).HeadPiece.Item = GetItem(mS)
- If mData(1) = MainHeroNum Then GetHeroInfo
- Case NECKLACEDATA '项链
- Player(mData(1)).Necklace.State = mData(2)
- mS = mData(3)
- If mData(2) <> 0 Then Player(mData(1)).Necklace.Item = GetItem(mS)
- If mData(1) = MainHeroNum Then GetHeroInfo
- Case BRACELETLEFTDATA '左手镯
- Player(mData(1)).BraceletLeft.State = mData(2)
- mS = mData(3)
- If mData(2) <> 0 Then Player(mData(1)).BraceletLeft.Item = GetItem(mS)
- If mData(1) = MainHeroNum Then GetHeroInfo
- Case BRACELETRIGHTDATA '右手镯
- Player(mData(1)).BraceletRight.State = mData(2)
- mS = mData(3)
- If mData(2) <> 0 Then Player(mData(1)).BraceletRight.Item = GetItem(mS)
- If mData(1) = MainHeroNum Then GetHeroInfo
- Case FINGERRINGLEFTDATA '左戒指
- Player(mData(1)).FingerringLeft.State = mData(2)
- mS = mData(3)
- If mData(2) <> 0 Then Player(mData(1)).FingerringLeft.Item = GetItem(mS)
- If mData(1) = MainHeroNum Then GetHeroInfo
- Case FINGERRINGRIGHTDATA '右戒指
- Player(mData(1)).FingerringRight.State = mData(2)
- mS = mData(3)
- If mData(2) <> 0 Then Player(mData(1)).FingerringRight.Item = GetItem(mS)
- If mData(1) = MainHeroNum Then GetHeroInfo
- End Select
- End If
- DoEvents
- mErr:
- Next
- End If
- NowNETData = ""
- Exit Sub
- End Sub
- '///////// 点击人物装备窗口
- Private Sub ClickHeroInfoFrm(X As Single, Y As Single)
- Dim nItem As ItemType
- '/////////////////////////////////////// 放置手镯左 /////////////////////////////////////////
- If X > HeroInfoFrm.X + 43 And X < HeroInfoFrm.X + 77 And _
- Y > HeroInfoFrm.Y + 175 And Y < HeroInfoFrm.Y + 207 And HeroInfoFrm.Type = 0 Then
- If Player(MainHeroNum).BraceletLeft.State = True Then
- nItem = Player(MainHeroNum).BraceletLeft.Item
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 24 Or Mouse.Item.Item.StdMode = 26 Then
- Player(MainHeroNum).BraceletLeft.Item = Mouse.Item.Item
- Client.SendData BRACELETLEFTDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).BraceletLeft.Item) & NETKONGDATA
- Mouse.Item.Item = nItem
- End If
- Else
- Player(MainHeroNum).BraceletLeft.State = False
- Client.SendData BRACELETLEFTDATA & KONGDATA & MainHeroNum & KONGDATA & 0 & KONGDATA & ItemStr(Player(MainHeroNum).BraceletLeft.Item) & NETKONGDATA
- Mouse.Item.State = True
- Mouse.Item.Item = Player(MainHeroNum).BraceletLeft.Item
- End If
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- Else
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 24 Or Mouse.Item.Item.StdMode = 26 Then
- Player(MainHeroNum).BraceletLeft.State = True
- Player(MainHeroNum).BraceletLeft.Item = Mouse.Item.Item
- Client.SendData BRACELETLEFTDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).BraceletLeft.Item) & NETKONGDATA
- Mouse.Item.State = False
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- End If
- End If
- End If
- '/////////////////////////////////////// 放置手镯右 /////////////////////////////////////////
- ElseIf X > HeroInfoFrm.X + 168 And X < HeroInfoFrm.X + 200 And _
- Y > HeroInfoFrm.Y + 175 And Y < HeroInfoFrm.Y + 207 And HeroInfoFrm.Type = 0 Then
- If Player(MainHeroNum).BraceletRight.State = True Then
- nItem = Player(MainHeroNum).BraceletRight.Item
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 24 Or Mouse.Item.Item.StdMode = 26 Then
- Player(MainHeroNum).BraceletRight.Item = Mouse.Item.Item
- Client.SendData BRACELETRIGHTDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).BraceletRight.Item) & NETKONGDATA
- Mouse.Item.Item = nItem
- End If
- Else
- Client.SendData BRACELETRIGHTDATA & KONGDATA & MainHeroNum & KONGDATA & 0 & KONGDATA & ItemStr(Player(MainHeroNum).BraceletRight.Item) & NETKONGDATA
- Mouse.Item.Item = Player(MainHeroNum).BraceletRight.Item
- Player(MainHeroNum).BraceletRight.State = False
- Mouse.Item.State = True
- End If
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- Else
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 24 Or Mouse.Item.Item.StdMode = 26 Then
- Player(MainHeroNum).BraceletRight.State = True
- Player(MainHeroNum).BraceletRight.Item = Mouse.Item.Item
- Client.SendData BRACELETRIGHTDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).BraceletRight.Item) & NETKONGDATA
- Mouse.Item.State = False
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- End If
- End If
- End If
- '//////////////////////////////////// 放置武器 ///////////////////////////
- ElseIf X > HeroInfoFrm.X + 45 And X < HeroInfoFrm.X + 87 And _
- Y > HeroInfoFrm.Y + 90 And Y < HeroInfoFrm.Y + 167 And HeroInfoFrm.Type = 0 Then
- If Player(MainHeroNum).Weapon.State = True Then
- nItem = Player(MainHeroNum).Weapon.Item
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 5 Or Mouse.Item.Item.StdMode = 6 Then
- Player(MainHeroNum).Weapon.Item = Mouse.Item.Item
- Mouse.Item.Item = nItem
- Client.SendData WEAPONDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).Weapon.Item) & NETKONGDATA
- End If
- Else
- Player(MainHeroNum).Weapon.State = False
- Client.SendData WEAPONDATA & KONGDATA & MainHeroNum & KONGDATA & 0 & KONGDATA & ItemStr(Player(MainHeroNum).Weapon.Item) & NETKONGDATA
- Mouse.Item.State = True
- Mouse.Item.Item = Player(MainHeroNum).Weapon.Item
- End If
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- Else
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 5 Or Mouse.Item.Item.StdMode = 6 Then
- Player(MainHeroNum).Weapon.State = True
- Player(MainHeroNum).Weapon.Item = Mouse.Item.Item
- Client.SendData WEAPONDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).Weapon.Item) & NETKONGDATA
- Mouse.Item.State = False
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- End If
- End If
- End If
- '//////////////////////////////////////// 放置衣服 ///////////////////////
- ElseIf X > HeroInfoFrm.X + 100 And X < HeroInfoFrm.X + 150 And _
- Y > HeroInfoFrm.Y + 120 And Y < HeroInfoFrm.Y + 230 And HeroInfoFrm.Type = 0 Then
- If Player(MainHeroNum).Clothing.State = True Then
- nItem = Player(MainHeroNum).Clothing.Item
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 10 + Player(MainHeroNum).Sex_性别 Then
- Player(MainHeroNum).Clothing.Item = Mouse.Item.Item
- Client.SendData CLOTHINGDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).Clothing.Item) & NETKONGDATA
- Mouse.Item.Item = nItem
- End If
- Else
- Mouse.Item.State = True
- Mouse.Item.Item = Player(MainHeroNum).Clothing.Item
- Player(MainHeroNum).Clothing.State = False
- Client.SendData CLOTHINGDATA & KONGDATA & MainHeroNum & KONGDATA & 0 & KONGDATA & ItemStr(Player(MainHeroNum).Clothing.Item) & NETKONGDATA
- End If
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- Else
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 10 + Player(MainHeroNum).Sex_性别 Then
- Player(MainHeroNum).Clothing.State = True
- Player(MainHeroNum).Clothing.Item = Mouse.Item.Item
- Client.SendData CLOTHINGDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).Clothing.Item) & NETKONGDATA
- Mouse.Item.State = False
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- End If
- End If
- End If
- '////////////////////////////////////// 放置戒指左 ///////////////////////
- ElseIf X > HeroInfoFrm.X + 43 And X < HeroInfoFrm.X + 74 And _
- Y > HeroInfoFrm.Y + 215 And Y < HeroInfoFrm.Y + 243 And HeroInfoFrm.Type = 0 Then
- If Player(MainHeroNum).FingerringLeft.State = True Then
- nItem = Player(MainHeroNum).FingerringLeft.Item
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 22 Or Mouse.Item.Item.StdMode = 23 Then
- Player(MainHeroNum).FingerringLeft.Item = Mouse.Item.Item
- Mouse.Item.Item = nItem
- Client.SendData FINGERRINGLEFTDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).FingerringLeft.Item) & NETKONGDATA
- End If
- Else
- Player(MainHeroNum).FingerringLeft.State = False
- Client.SendData FINGERRINGLEFTDATA & KONGDATA & MainHeroNum & KONGDATA & 0 & KONGDATA & ItemStr(Player(MainHeroNum).FingerringLeft.Item) & NETKONGDATA
- Mouse.Item.State = True
- Mouse.Item.Item = Player(MainHeroNum).FingerringLeft.Item
- End If
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- Else
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 22 Or Mouse.Item.Item.StdMode = 23 Then
- Player(MainHeroNum).FingerringLeft.State = True
- Player(MainHeroNum).FingerringLeft.Item = Mouse.Item.Item
- Client.SendData FINGERRINGLEFTDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).FingerringLeft.Item) & NETKONGDATA
- Mouse.Item.State = False
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- End If
- End If
- End If
- '////////////////////////////////////// 放置戒指右 ///////////////////////
- ElseIf X > HeroInfoFrm.X + 168 And X < HeroInfoFrm.X + 200 And _
- Y > HeroInfoFrm.Y + 215 And Y < HeroInfoFrm.Y + 243 And HeroInfoFrm.Type = 0 Then
- If Player(MainHeroNum).FingerringRight.State = True Then
- nItem = Player(MainHeroNum).FingerringRight.Item
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 22 Or Mouse.Item.Item.StdMode = 23 Then
- Player(MainHeroNum).FingerringRight.Item = Mouse.Item.Item
- Mouse.Item.Item = nItem
- Client.SendData FINGERRINGRIGHTDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).FingerringRight.Item) & NETKONGDATA
- End If
- Else
- Player(MainHeroNum).FingerringRight.State = False
- Client.SendData FINGERRINGRIGHTDATA & KONGDATA & MainHeroNum & KONGDATA & 0 & KONGDATA & ItemStr(Player(MainHeroNum).FingerringRight.Item) & NETKONGDATA
- Mouse.Item.State = True
- Mouse.Item.Item = Player(MainHeroNum).FingerringRight.Item
- End If
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- Else
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 22 Or Mouse.Item.Item.StdMode = 23 Then
- Player(MainHeroNum).FingerringRight.State = True
- Player(MainHeroNum).FingerringRight.Item = Mouse.Item.Item
- Client.SendData FINGERRINGRIGHTDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).FingerringRight.Item) & NETKONGDATA
- Mouse.Item.State = False
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- End If
- End If
- End If
- '////////////////////////////////////////// 放置项链 ////////////////////////////
- ElseIf X > HeroInfoFrm.X + 170 And X < HeroInfoFrm.X + 200 And _
- Y > HeroInfoFrm.Y + 87 And Y < HeroInfoFrm.Y + 115 And HeroInfoFrm.Type = 0 Then
- If Player(MainHeroNum).Necklace.State = True Then
- nItem = Player(MainHeroNum).Necklace.Item
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 19 Or Mouse.Item.Item.StdMode = 20 Or Mouse.Item.Item.StdMode = 21 Then
- Player(MainHeroNum).Necklace.Item = Mouse.Item.Item
- Mouse.Item.Item = nItem
- Client.SendData NECKLACEDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).Necklace.Item) & NETKONGDATA
- End If
- Else
- Player(MainHeroNum).Necklace.State = False
- Client.SendData NECKLACEDATA & KONGDATA & MainHeroNum & KONGDATA & 0 & KONGDATA & ItemStr(Player(MainHeroNum).Necklace.Item) & NETKONGDATA
- Mouse.Item.State = True
- Mouse.Item.Item = Player(MainHeroNum).Necklace.Item
- End If
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- Else
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 19 Or Mouse.Item.Item.StdMode = 20 Or Mouse.Item.Item.StdMode = 21 Then
- Player(MainHeroNum).Necklace.State = True
- Player(MainHeroNum).Necklace.Item = Mouse.Item.Item
- Client.SendData NECKLACEDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).Necklace.Item) & NETKONGDATA
- Mouse.Item.State = False
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- End If
- End If
- End If
- '///////////////////////////////////// 放置头盔 ////////////////////////////
- ElseIf X > HeroInfoFrm.X + 115 And X < HeroInfoFrm.X + 130 And _
- Y > HeroInfoFrm.Y + 90 And Y < HeroInfoFrm.Y + 120 And HeroInfoFrm.Type = 0 Then
- If Player(MainHeroNum).HeadPiece.State = True Then
- nItem = Player(MainHeroNum).HeadPiece.Item
- If Mouse.Item.State = True Then
- If Mouse.Item.Item.StdMode = 15 Then
- Player(MainHeroNum).HeadPiece.Item = Mouse.Item.Item
- Mouse.Item.Item = nItem
- Client.SendData HEADPIECEDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).HeadPiece.Item) & NETKONGDATA
- End If
- Else
- Player(MainHeroNum).HeadPiece.State = False
- Client.SendData HEADPIECEDATA & KONGDATA & MainHeroNum & KONGDATA & 0 & KONGDATA & ItemStr(Player(MainHeroNum).HeadPiece.Item) & NETKONGDATA
- Mouse.Item.State = True
- Mouse.Item.Item = Player(MainHeroNum).HeadPiece.Item
- End If
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- Else
- If Mouse.Item.State = True And Mouse.Item.Item.StdMode = 15 Then
- Player(MainHeroNum).HeadPiece.State = True
- Player(MainHeroNum).HeadPiece.Item = Mouse.Item.Item
- Client.SendData HEADPIECEDATA & KONGDATA & MainHeroNum & KONGDATA & 1 & KONGDATA & ItemStr(Player(MainHeroNum).HeadPiece.Item) & NETKONGDATA
- Mouse.Item.State = False
- GetHeroInfo
- Client.SendData PLAYERATTACKINFO & KONGDATA & MainHeroNum & KONGDATA & PlayerInfoStr(MainHeroNum) & NETKONGDATA
- End If
- End If
- End If
- End Sub
- Private Sub Client_SendComplete()
- SendDataOK = True
- End Sub
- Sub InitMon()
- Dim i As Integer
- MonCount = 100
- ReDim Mon(MonCount)
- For i = 1 To MonCount
- Mon(i).X = 50
- Mon(i).Y = 50
- Mon(i).DBInfo = MonDB(GetMonDBNum("鸡"))
- Mon(i).MaxHP = Mon(i).DBInfo.HP
- Mon(i).HP = Mon(i).MaxHP
- Next
- End Sub
- Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
- Dim i As Integer
- If KeyCode = vbKeyQ Then InitGame
- If KeyCode = vbKeyF8 Then JianFa = Not JianFa
- If KeyCode = vbKeyI Then HeroInfoFrm.State = Not HeroInfoFrm.State: HeroInfoFrm.X = 500: HeroInfoFrm.Y = 30: HeroInfoFrm.Type = 0
- If KeyCode = vbKeyO Then BagFrm.State = Not BagFrm.State: BagFrm.X = 0: BagFrm.Y = 30
- If KeyCode = vbKeyF Then
- If Player(MainHeroNum).Act = Dead_死亡 Then
- Client.SendData PLAYERFUHUO & KONGDATA & MainHeroNum & NETKONGDATA
- End If
- End If
- If KeyCode = vbKeyH Then
- If Shift = 2 Then
- Hero.攻击模式 = Hero.攻击模式 + 1
- If Hero.攻击模式 > 3 Then Hero.攻击模式 = 和平攻击模式
- End If
- End If
- If KeyCode = vbKeyUp Then
- If TalkStrStart > 0 Then TalkStrStart = TalkStrStart - 1
- End If
- If KeyCode = vbKeyDown Then
- If TalkStrStart < TalkCount - 1 Then TalkStrStart = TalkStrStart + 1
- End If
- If Shift = 1 And KeyCode = vbKeyG Then
- For i = 0 To 1
- Bag(i).State = True
- Bag(i).Item = ItemDB(GetItemNum("[GM]剑"))
- Exit For
- Next
- End If
- If KeyCode = vbKeyU Then
- For i = 0 To 1
- Bag(i).State = True
- Bag(i).Item = ItemDB(Rnd * (ItemDBCount - 1) + 1)
- Next
- End If
- If KeyCode = vbKeyF1 Then
- If Player(MainHeroNum).CanAct = True Then
- NetMagicData = True
- Client.SendData PLAYERMAGICDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Name_名字 & KONGDATA & HeroActType.Magic_魔法 & KONGDATA & "治愈术" & KONGDATA & Mouse.SelX & KONGDATA & Mouse.SelY & NETKONGDATA
- Player(MainHeroNum).Act = Magic_魔法
- Player(MainHeroNum).ActState = Magic_魔法
- Player(MainHeroNum).Pic = 0
- Player(MainHeroNum).PicSpeed = 0
- Player(MainHeroNum).CanAct = False
- ' UserPlayerMagic 1, "治愈术"
- End If
- End If
- If KeyCode = vbKeyF2 Then
- If Player(MainHeroNum).CanAct = True Then
- NetMagicData = True
- Client.SendData PLAYERMAGICDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Name_名字 & KONGDATA & HeroActType.Magic_魔法 & KONGDATA & "冰咆哮" & KONGDATA & Mouse.SelX & KONGDATA & Mouse.SelY & NETKONGDATA
- Player(MainHeroNum).Act = Magic_魔法
- Player(MainHeroNum).ActState = Magic_魔法
- Player(MainHeroNum).Pic = 0
- Player(MainHeroNum).PicSpeed = 0
- Player(MainHeroNum).CanAct = False
- ' UserPlayerMagic 1, "冰咆哮"
- End If
- End If
- If KeyCode = vbKeyF3 Then
- If Player(MainHeroNum).CanAct = True Then
- NetMagicData = True
- Client.SendData PLAYERMAGICDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Name_名字 & KONGDATA & HeroActType.Magic_魔法 & KONGDATA & "魔法盾" & KONGDATA & (Mouse.X + WorldX - 400) 48 & KONGDATA & (Mouse.Y + WorldY - 290) 32 & NETKONGDATA
- Player(MainHeroNum).Act = Magic_魔法
- Player(MainHeroNum).ActState = Magic_魔法
- Player(MainHeroNum).Pic = 0
- Player(MainHeroNum).PicSpeed = 0
- Player(MainHeroNum).CanAct = False
- ' UserPlayerMagic 1, "魔法盾"
- End If
- End If
- If KeyCode = vbKeyF4 Then
- If Player(MainHeroNum).CanAct = True Then
- GetMagicLock
- NetMagicData = True
- Client.SendData PLAYERMAGICDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Name_名字 & KONGDATA & HeroActType.Magic_魔法 & KONGDATA & "雷电术" & KONGDATA & Hero.MagicX & KONGDATA & Hero.MagicY & NETKONGDATA
- Player(MainHeroNum).Act = Magic_魔法
- Player(MainHeroNum).ActState = Magic_魔法
- Player(MainHeroNum).Pic = 0
- Player(MainHeroNum).PicSpeed = 0
- Player(MainHeroNum).CanAct = False
- ' UserPlayerMagic 1, "雷电术"
- End If
- End If
- If KeyCode = vbKeyF5 Then
- If Player(MainHeroNum).CanAct = True Then
- NetMagicData = True
- Client.SendData PLAYERMAGICDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Name_名字 & KONGDATA & HeroActType.Magic_魔法 & KONGDATA & "火球术" & KONGDATA & Hero.MagicX & KONGDATA & Hero.MagicY & NETKONGDATA
- Player(MainHeroNum).Act = Magic_魔法
- Player(MainHeroNum).ActState = Magic_魔法
- Player(MainHeroNum).Pic = 0
- Player(MainHeroNum).PicSpeed = 0
- Player(MainHeroNum).CanAct = False
- End If
- End If
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer)
- If KeyAscii = 27 Then End
- If KeyAscii = 13 Then Text1.Visible = True
- End Sub
- Private Sub Form_Load()
- Label1.Caption = "正在载入信息..."
- If Dir("c:windowssystem32MSWINSCK.OCX") = "" Then
- Shell App.Path & "注册控件.bat"
- MsgBox "控件注册成功"
- End If
- DoEvents
- SCREEN_WIDTH = 800
- SCREEN_HEIGHT = 600
- Me.Show
- InitD3D Me.hWnd, False, SCREEN_WIDTH, SCREEN_HEIGHT
- mVolume = -1100
- ServerIP = ReadINIFile("Main", "ServerIP", App.Path & "Main.ini")
- ServerPort = ReadINIFile("Main", "ServerPort", App.Path & "Main.ini")
- Open App.Path & "ResPath.txt" For Input As #1
- Input #1, ResPath
- Close #1
- ' ResPath = App.Path & "data"
- If Right(ResPath, 1) <> "" Then ResPath = ResPath & ""
- CreateTexture1 Map3Tex, App.Path & "1.bmp"
- ' Set Map3Tex = D3DX.CreateTextureFromResource(D3DDevice, App.hInstance, "PIC1")
- ' LoadHumTexData respath & "Datadatahum1data.txt"
- LoadHumTexData ResPath & "DataHum.wix"
- LoadWeaponTexData ResPath & "DataWeapon.wix"
- LoadItemsTexData ResPath & "DataItems.wix"
- LoadStateItemTexData ResPath & "DataStateItem.wix"
- LoadNpcTexData ResPath & "DataNpc.wix"
- LoadMagicTexData
- LoadPrguseTexData ResPath & "DataPrguse.wix"
- LoadPrguse2TexData ResPath & "DataPrguse2.wix"
- LoadPrguse3TexData ResPath & "DataPrguse3.wix"
- LoadChrSelTexData ResPath & "DataChrSel.wix"
- LoadMonTexData
- LoadMagicDBData
- LoadItemDBData
- GetBI
- GetBiRGB
- InitGame
- ' MsgBox "数据读取成功!!"
- ReDim Bag(39)
- Me.Show
- DoEvents
- Hero.攻击模式 = 和平攻击模式
- Label1.Caption = "正在连接服务器......"
- Timer2.Enabled = True
- End Sub
- ' Download by http://www.codefans.net
- Sub InitGame()
- Dim i As Integer
- Dim MM As String
- Map.Width = 100
- Map.Height = 100
- ReDim Map.Map1(Map.Width, Map.Height)
- ReDim Map.Map2(Map.Width, Map.Height)
- ReDim Map.Map3(Map.Width, Map.Height)
- ReDim Map.Map4(Map.Width, Map.Height)
- ReDim Map.Map5(Map.Width, Map.Height)
- PlayerCount = 0
- ReDim Player(PlayerCount)
- SaveHero.Pic = 0
- SaveHero.PicSpeed = 0
- SaveHero.Act = Stand_站立
- SaveHero.ActState = Stand_站立
- SaveHero.AC_自身物防 = 1
- SaveHero.MAC_自身魔防 = 1
- SaveHero.DC_自身攻击 = 1
- SaveHero.MC_自身魔法 = 1
- SaveHero.SC_自身道术 = 1
- ' SaveHero.X = 50
- ' SaveHero.Y = 50
- ' SaveHero.HP = 65535
- ' SaveHero.MaxHP = 65535
- NETDATACOUNT = 0
- ReDim NETDATA(NETDATACOUNT)
- End Sub
- Sub MainLoop()
- Dim mStart As Boolean, i As Integer
- Dim mStr As String
- mStart = True
- On Error GoTo MainErr
- Do While mStart
- PlayNetData
- Sleep 1
- Randomize
- Select Case Running
- Case 0 '账号登陆
- D3DDevice.BeginScene
- D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
- DrawLoginGamePic
- D3DDevice.EndScene
- D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0
- Case 1 '角色选择
- D3DDevice.BeginScene
- D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
- DrawSelHeroFrm
- D3DDevice.EndScene
- D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0
- Case 2 '游戏
- Mouse.SelX = (Mouse.X + WorldX - 400) 48
- Mouse.SelY = (Mouse.Y + WorldY - 290) 32
- If GetTickCount - MainLassTime > MainSleep Then
- Frame = Frame + 1
- If GetTickCount - FrameLassTime > 1000 Then
- FrameLassTime = GetTickCount
- FPS = Frame
- Frame = 0
- End If
- MainLassTime = GetTickCount
- GetInput
- MovePlayer
- PlayerAct
- MonTexAct
- PlayerMagicTexAct
- PlayerMagicActInfo1
- MapMagicTexAct
- MoveScreen
- MouseSelMonNum
- D3DDevice.BeginScene
- D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
- DrawMap1
- DrawMapItem
- ' DrawMap2
- ' PaiXuPlayer
- DrawMap22
- DrawMapNpc
- DrawMon22 '画怪物
- DrawMap222
- DrawMapItemName
- MagicPaiXu '魔法Y排序
- DrawMagic2
- DrawPrguse
- DrawNpcInfoFrm
- DrawJiaoYiFrm
- DrawBagFrm
- DrawHeroInfoFrm MainHeroNum
- DrawErrorFrm
- DrawMouseItem
- mRECT.Left = 10
- mRECT.Right = 100
- mRECT.Top = 170
- mRECT.bottom = mRECT.Top + 20
- D3DX.DrawText D3DFont1, D3DColorRGBA(0, 255, 255, 255), "FPS " & FPS, mRECT, DT_CENTER
- mRECT.Left = 10
- mRECT.Right = 200
- mRECT.Top = 200
- mRECT.bottom = mRECT.Top + 20
- D3DX.DrawText D3DFont1, D3DColorRGBA(0, 255, 255, 255), "剩余网络数据个数= " & NETDATACOUNT, mRECT, DT_LEFT
- D3DDevice.EndScene
- D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0
- End If
- End Select
- ' D3DDevice.EndScene
- ' D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0
- MainErr:
- DoEvents
- Loop
- End Sub
- Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim BagNum As Integer, nItem As ItemType
- Dim PlayerNum As Integer
- Mouse.X = X
- Mouse.Y = Y
- Mouse.Button1DownX = X
- Mouse.Button1DownY = Y
- If Button = 1 Then
- Mouse.Button1Down = True
- If Mouse.SelFrm = HeroInfoFrom Then
- HeroInfoFrm.MDX = Mouse.X - HeroInfoFrm.X
- HeroInfoFrm.MDY = Mouse.Y - HeroInfoFrm.Y
- ElseIf Mouse.SelFrm = BagFrom Then
- BagFrm.MDX = Mouse.X - BagFrm.X
- BagFrm.MDY = Mouse.Y - BagFrm.Y
- ElseIf Mouse.SelFrm = ErrorFrom Then
- ErrorFrm.MDX = Mouse.X - ErrorFrm.X
- ErrorFrm.MDY = Mouse.Y - ErrorFrm.Y
- End If
- If Mouse.SelFrm = MainFrom Then
- Dim mWork As Boolean
- If Mouse.SelX = Player(MainHeroNum).X And Mouse.SelY = Player(MainHeroNum).Y Then
- For i = 0 To 39
- If Bag(i).State = False Then
- mWork = True
- Exit For
- End If
- Next
- If mWork = True Then
- For i = 1 To MapItemCount
- If MapItem(i).X = Player(MainHeroNum).X And MapItem(i).Y = Player(MainHeroNum).Y Then
- Client.SendData JIANITEMDATA & KONGDATA & MapItem(i).ID & KONGDATA & MapItem(i).X & KONGDATA & MapItem(i).Y & NETKONGDATA
- Exit For
- End If
- Next
- End If
- End If
- For i = 1 To NpcCount
- If NPCInfo(i).X = Mouse.SelX And NPCInfo(i).Y = Mouse.SelY Then
- Client.SendData SCRIPTFUNNAMEINFO & KONGDATA & MainHeroNum & KONGDATA & i & KONGDATA & "@Main" & NETKONGDATA
- Exit For
- End If
- Next
- End If
- '///////////////////// 点击包裹窗口////////////////////////////////////////////////////////////////////
- If Mouse.SelFrm = BagFrom Then
- If X > BagFrm.X And X < BagFrm.X + PrguseTex(3).Wid And _
- Y > BagFrm.Y And Y < BagFrm.Y + PrguseTex(3).Hei Then
- '////////////////// 选择 包裹物品
- If X > BagFrm.X + 20 And X < BagFrm.X + 304 And _
- Y > BagFrm.Y + 14 And Y < BagFrm.Y + 174 Then
- BagNum = (((X - BagFrm.X - 20) 36) Mod 8) + ((Y - BagFrm.Y - 14) 32) * 8
- If Bag(BagNum).State = True Then
- nItem = Bag(BagNum).Item
- If Mouse.Item.State = True Then
- Bag(BagNum).Item = Mouse.Item.Item
- Mouse.Item.Item = nItem
- Else
- Mouse.Item.State = True
- Mouse.Item.Item = nItem
- Bag(BagNum).State = False
- End If
- Else
- If Mouse.Item.State = True Then
- Bag(BagNum).State = True
- Bag(BagNum).Item = Mouse.Item.Item
- Mouse.Item.State = False
- End If
- End If
- End If
- End If
- End If
- '///////////////////// 点击装备窗口////////////////////////////////////////////////////////////////////
- If Mouse.SelFrm = HeroInfoFrom Then
- If X > HeroInfoFrm.X And X < HeroInfoFrm.X + Prguse3Tex(207).Wid And _
- Y > HeroInfoFrm.Y And Y < HeroInfoFrm.Y + Prguse3Tex(207).Hei Then
- ClickHeroInfoFrm X, Y
- End If
- End If
- ElseIf Button = 2 Then
- Mouse.button2Down = True
- If Mouse.SelFrm = MainFrom Then
- If Mouse.Item.State = True Then
- For i = 0 To 39
- If Bag(i).State = False Then
- Bag(i).State = True
- Bag(i).Item = Mouse.Item.Item
- Mouse.Item.State = False
- Exit For
- End If
- Next
- End If
- End If
- End If
- If Shift = 1 Then ShiftKey = True
- End Sub
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Mouse.X = X
- Mouse.Y = Y
- MouseSelFrm
- If Button = 1 Then
- If Mouse.SelFrm = HeroInfoFrom Then
- HeroInfoFrm.X = Mouse.X - HeroInfoFrm.MDX
- HeroInfoFrm.Y = Mouse.Y - HeroInfoFrm.MDY
- ElseIf Mouse.SelFrm = BagFrom Then
- BagFrm.X = Mouse.X - BagFrm.MDX
- BagFrm.Y = Mouse.Y - BagFrm.MDY
- ElseIf Mouse.SelFrm = ErrorFrom Then
- ErrorFrm.X = Mouse.X - ErrorFrm.MDX
- ErrorFrm.Y = Mouse.Y - ErrorFrm.MDY
- End If
- End If
- End Sub
- Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim i As Integer
- Dim PlayerNum As Integer
- If Button = 1 Then
- Mouse.Button1Down = False
- ElseIf Button = 2 Then
- Mouse.button2Down = False
- End If
- If Shift = 1 Then ShiftKey = False
- If Running = 0 Then '登陆界面
- If RegIDFrm = False Then
- '点击登陆按钮
- If Mouse.X > 432 And Mouse.X < 504 And _
- Mouse.Y > 346 And Mouse.Y < 374 Then
- If IDText.Text <> "" Then
- HeroID = IDText.Text
- LoginClient.SendData LOGINID & KONGDATA & IDText.Text & NETKONGDATA
- IDText.Text = ""
- End If
- '点击注册按钮
- ElseIf Mouse.X > 286 And Mouse.X < 380 And _
- Mouse.Y > 387 And Mouse.Y < 414 Then
- IDText.Visible = False
- RegIDFrm = True
- RegIDText.Visible = True
- End If
- ElseIf RegIDFrm = True Then '注册界面
- '点击注册按钮
- If Mouse.X > 252 And Mouse.X < 323 And _
- Mouse.Y > 469 And Mouse.Y < 498 Then
- If RegIDText.Text <> "" Then
- LoginClient.SendData REGPLAYERID & KONGDATA & RegIDText.Text & NETKONGDATA
- RegIDFrm = False
- RegIDText.Visible = False
- IDText.Visible = True
- End If
- '点击取消按钮
- ElseIf Mouse.X > 538 And Mouse.X < 628 And _
- Mouse.Y > 471 And Mouse.Y < 498 Then
- RegIDFrm = False
- RegIDText.Visible = False
- IDText.Visible = True
- End If
- End If
- ElseIf Running = 1 Then '角色界面
- If RegHero = False Then '建立角色界面关闭
- '//////选择角色
- If Mouse.X > 134 And Mouse.X < 210 And _
- Mouse.Y > 453 And Mouse.Y < 486 Then
- If mHero(1).State = True And mSelHeroNum <> 1 Then
- ' LoginClient.SendData SELHERONUM & KONGDATA & HeroID & KONGDATA & 1 & NETKONGDATA
- LoginClientSendData SELHERONUM & KONGDATA & HeroID & KONGDATA & 1
- End If
- ElseIf Mouse.X > 685 And Mouse.X < 761 And _
- Mouse.Y > 453 And Mouse.Y < 486 Then
- If mHero(2).State = True And mSelHeroNum <> 2 Then
- ' LoginClient.SendData SELHERONUM & KONGDATA & HeroID & KONGDATA & 2 & NETKONGDATA
- LoginClientSendData SELHERONUM & KONGDATA & HeroID & KONGDATA & 2
- End If
- End If
- '//////// 点击开始按钮
- If Mouse.X > 388 And X < 426 And _
- Mouse.Y > 460 And Mouse.Y < 474 Then
- If Client.State = sckClosed Then Client.Connect ServerIP, "7001"
- End If
- '//////// 点击创建角色按钮
- If Mouse.X > 350 And Mouse.X < 463 And _
- Mouse.Y > 488 And Mouse.Y < 504 Then
- If mHero(2).State = False Then
- RegHero = True
- RegHeroText.Visible = True
- End If
- End If
- '//////// 点击删除角色按钮
- If Mouse.X > 350 And Mouse.X < 464 And _
- Mouse.Y > 509 And Mouse.Y < 524 Then
- If mHero(2).State = False Then
- End If
- End If
- '/////// 点击退出按钮
- If Mouse.X > 382 And X < 431 And _
- Mouse.Y > 548 And Y < 564 Then
- LoginClient.Close
- End
- End If
- ElseIf RegHero = True Then '建立角色界面开启
- If Mouse.X > 468 And Mouse.X < 602 And _
- Mouse.Y > 157 And Mouse.Y < 191 Then
- RegHeroJob = (Mouse.X - 468) 44
- End If
- If Mouse.X > 513 And Mouse.X < 602 And _
- Mouse.Y > 231 And Mouse.Y < 265 Then
- RegHeroSex = (Mouse.X - 513) 44
- End If
- '///// 点击建立角色提交按钮
- If Mouse.X > 523 And Mouse.X < 595 And _
- Mouse.Y > 361 And Mouse.Y < 389 Then
- If RegHeroText.Text <> "" Then
- RegHero = False
- RegHeroText.Visible = False
- ' LoginClient.SendData REGHERONAME & KONGDATA & HeroID & KONGDATA & RegHeroText.Text & KONGDATA & RegHeroJob & KONGDATA & RegHeroSex & NETKONGDATA
- LoginClientSendData REGHERONAME & KONGDATA & HeroID & KONGDATA & RegHeroText.Text & KONGDATA & RegHeroJob & KONGDATA & RegHeroSex
- End If
- '////// 点击关闭按钮
- ElseIf Mouse.X > 668 And Mouse.X < 679 And _
- Mouse.Y > 32 And Mouse.Y < 50 Then
- RegHero = False
- RegHeroText.Visible = False
- End If
- End If
- End If
- '///////////// 点击交易窗口
- If Mouse.SelFrm = JiaoYiFrom Then
- If X > 372 And X < 550 And _
- Y > 236 And Y < 300 Then
- If Mouse.Item.State = True Then
- For i = 0 To 9
- If JiaoYi.JiaoYiItems(i).State = False Then
- Client.SendData PLAYERJIAOYIITEM & KONGDATA & JiaoYi.JiaoYiPlayerNum & KONGDATA & ItemStr(Mouse.Item.Item) & NETKONGDATA
- JiaoYi.JiaoYiItems(i).State = True
- JiaoYi.JiaoYiItems(i).Item = Mouse.Item.Item
- Mouse.Item.State = False
- Exit For
- End If
- Next
- End If
- End If
- End If
- If Mouse.SelFrm = InfoFrom Then
- '/////////// 点击交易按扭
- If Mouse.Button1DownX > 237 And Mouse.Button1DownX < 265 And _
- Mouse.Button1DownY > 453 And Mouse.Button1DownY < 466 Then
- PlayerNum = GetMapXYPlayerNum(Player(MainHeroNum).X, Player(MainHeroNum).Y, Player(MainHeroNum).Face, 1)
- If PlayerNum > 0 And Abs(Player(PlayerNum).Face - Player(MainHeroNum).Face) = 4 Then
- Client.SendData PLAYERJIAOYI & KONGDATA & MainHeroNum & KONGDATA & PlayerNum & NETKONGDATA
- Else
- ErrorFrm.State = True
- ErrorStr = "请和你交易的人面对面~!"
- ErrorFrm.X = 300
- ErrorFrm.Y = 250
- End If
- End If
- '/////////////// 点击包袱按钮
- If Mouse.X > 681 And Mouse.X < 704 And _
- Mouse.Y > 389 And Mouse.Y < 412 Then
- BagFrm.State = Not BagFrm.State
- BagFrm.X = 0
- BagFrm.Y = 30
- End If
- '///////// 点击装备按钮
- If Mouse.X > 642 And Mouse.X < 685 And _
- Mouse.Y > 412 And Mouse.Y < 434 Then
- HeroInfoFrm.State = Not HeroInfoFrm.State
- HeroInfoFrm.X = 500
- HeroInfoFrm.Y = 30
- HeroInfoFrm.Type = 0
- End If
- '/////////////// 点击技能按钮
- If Mouse.X > 722 And Mouse.X < 744 And _
- Mouse.Y > 369 And Mouse.Y < 392 Then
- HeroInfoFrm.State = Not HeroInfoFrm.State
- HeroInfoFrm.X = 500
- HeroInfoFrm.Y = 30
- HeroInfoFrm.Type = 2
- End If
- '/////// 点击OUT按钮
- If X > 542 And X < 570 And _
- Y > 453 And Y < 466 Then
- If MsgBox("确定要退出吗?", vbOKCancel Or vbDefaultButton2) = vbOK Then
- PlayerCount = 0
- ReDim Player(PlayerCount)
- Client_Close
- LoginClient.Connect ServerIP, ServerPort
- End If
- End If
- '///////// 点击X按钮
- If X > 570 And X < 598 And _
- Y > 453 And Y < 466 Then
- If MsgBox("确定要退出游戏吗?", vbOKCancel Or vbDefaultButton2) = vbOK Then
- End
- End If
- End If
- End If
- If Mouse.SelFrm = ErrorFrom Then
- If Mouse.X > ErrorFrm.X + 330 And Mouse.X < ErrorFrm.X + 330 + PrguseTex(361).Wid And _
- Mouse.Y > ErrorFrm.Y + 130 And Mouse.Y < ErrorFrm.Y + 130 + PrguseTex(361).Hei Then
- ErrorFrm.State = False
- End If
- End If
- If Mouse.SelFrm = BagFrom Then
- If Mouse.X > BagFrm.X + 312 And X < BagFrm.X + 322 And _
- Mouse.Y > BagFrm.Y + 206 And Y < BagFrm.Y + 221 Then
- BagFrm.State = False
- End If
- End If
- If Mouse.SelFrm = MainFrom Then
- '//////// 丢物品
- If Mouse.Item.State = True Then
- Mouse.Item.State = False
- Client.SendData PLAYERDUIITEM & KONGDATA & Mouse.Item.ID & NETKONGDATA
- End If
- End If
- '//////// 点击NPC信息窗口
- If NpcFrm.State = True Then
- If Mouse.SelFrm = NpcFrom Then
- For i = 0 To StrCount
- If Mouse.X > StrInfo(i).tRECT.Left And Mouse.X < StrInfo(i).tRECT.Right And _
- Mouse.Y > StrInfo(i).tRECT.Top And Mouse.Y < StrInfo(i).tRECT.bottom Then
- If StrInfo(i).Type = 1 Then
- If StrInfo(i).FunctionName <> "" Then
- If UCase(StrInfo(i).FunctionName) = UCase("@exit") Then
- NpcFrm.State = False
- Else
- Client.SendData SCRIPTFUNNAMEINFO & KONGDATA & MainHeroNum & KONGDATA & SelNpcNum & KONGDATA & StrInfo(i).FunctionName & NETKONGDATA
- End If
- End If
- End If
- End If
- Next
- If Mouse.X > 402 And Mouse.X < 411 And _
- Mouse.Y > 4 And Mouse.Y < 19 Then
- NpcFrm.State = False
- End If
- End If
- End If
- If Mouse.SelFrm = HeroInfoFrom Then
- If X > HeroInfoFrm.X + 10 And X < HeroInfoFrm.X + 27 And _
- Y > HeroInfoFrm.Y + 131 And Y < HeroInfoFrm.Y + 146 Then
- HeroInfoFrm.Type = HeroInfoFrm.Type - 1
- If HeroInfoFrm.Type < 0 Then HeroInfoFrm.Type = 3
- ElseIf X > HeroInfoFrm.X + 10 And X < HeroInfoFrm.X + 27 And _
- Y > HeroInfoFrm.Y + 190 And Y < HeroInfoFrm.Y + 205 Then
- HeroInfoFrm.Type = HeroInfoFrm.Type + 1
- If HeroInfoFrm.Type > 3 Then HeroInfoFrm.Type = 0
- ElseIf X > HeroInfoFrm.X + 11 And X < HeroInfoFrm.X + 20 And _
- Y > HeroInfoFrm.Y + 42 And Y < HeroInfoFrm.Y + 57 Then
- HeroInfoFrm.State = False
- '/////////// 主角信息窗口关闭
- End If
- End If
- If Mouse.SelFrm = JiaoYiFrom Then
- If X > 571 And X < 583 And _
- Y > 223 And Y < 240 Then
- Client.SendData PLAYERJIAOYIEND & KONGDATA & MainHeroNum & KONGDATA & JiaoYi.JiaoYiPlayerNum & NETKONGDATA
- JiaoYiOKCancel False
- JiaoYi.State = False
- End If
- If X > 505 And X < 546 And _
- Y > 307 And Y < 322 Then
- If JiaoYi.JiaoYiOK = False Then
- Client.SendData PLAYERJIAOYIOK & KONGDATA & MainHeroNum & KONGDATA & JiaoYi.JiaoYiPlayerNum & NETKONGDATA
- JiaoYi.JiaoYiOK = True
- Else
- Client.SendData PLAYERJIAOYIOK & KONGDATA & MainHeroNum & KONGDATA & JiaoYi.JiaoYiPlayerNum & NETKONGDATA
- JiaoYiOKCancel True
- End If
- End If
- End If
- End Sub
- Private Sub Form_Resize()
- If Me.WindowState <> 1 Then
- Me.Scale (0, 0)-(SCREEN_WIDTH, SCREEN_HEIGHT)
- End If
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- LoginClient.Close
- Client_Close
- ClearDx
- Set LoginGameMusic = Nothing
- End
- End Sub
- Private Sub IDText_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- KeyAscii = 0
- If IDText.Text <> "" Then
- HeroID = IDText.Text
- LoginClient.SendData LOGINID & KONGDATA & IDText.Text & NETKONGDATA
- IDText.Text = ""
- End If
- End If
- End Sub
- Private Sub LoginClient_Connect()
- ' LoginPic.Visible = True
- Running = 0
- IDLoginOK = False
- IDText.Visible = True
- If HeroID <> "" Then LoginClient.SendData LOGINID & KONGDATA & HeroID & NETKONGDATA
- If LoginGameMusic Is Nothing Then
- Set LoginGameMusic = DS.CreateSoundBufferFromFile(ResPath & "Wavmain_theme.wav", DSBDESC)
- End If
- LoginGameMusic.SetVolume mVolume
- LoginGameMusic.Play DSBPLAY_LOOPING
- MainLoop
- End Sub
- Private Sub LoginClient_DataArrival(ByVal bytesTotal As Long)
- Dim mData As String
- LoginClient.GetData mData, vbString
- NETDATACOUNT = NETDATACOUNT + 1
- ReDim Preserve NETDATA(NETDATACOUNT)
- NETDATA(NETDATACOUNT) = mData
- End Sub
- Private Sub Text1_Change()
- Text1.SelStart = Len(Text1.Text)
- End Sub
- Private Sub Text1_KeyPress(KeyAscii As Integer)
- Dim nData As Variant, SS As String
- Dim i As Integer
- If KeyAscii = 13 Then
- KeyAscii = 0
- If Left(Text1.Text, 1) = "/" Then
- nData = Split(Text1.Text, " ")
- SS = Right(nData(0), Len(nData(0)) - 1)
- For i = 1 To PlayerCount
- If Player(i).Name_名字 = SS Then
- If UBound(nData) > 0 Then
- Client.SendData SILIAOINFO & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Name_名字 & KONGDATA & i & KONGDATA & Player(i).Name_名字 & KONGDATA & Right(Text1.Text, Len(Text1.Text) - Len(nData(0))) & NETKONGDATA
- Else
- Client.SendData SILIAOINFO & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Name_名字 & KONGDATA & i & KONGDATA & Player(i).Name_名字 & KONGDATA & " " & NETKONGDATA
- End If
- Exit For
- End If
- Next
- ElseIf Left(Text1.Text, 1) = "!" Then
- Client.SendData TALKINFO & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Name_名字 & KONGDATA & "(!)" & Player(MainHeroNum).Name_名字 & ":" & Right(Text1.Text, Len(Text1.Text) - 1) & KONGDATA & D3DColorRGBA(255, 0, 255, 255) & KONGDATA & 1 & NETKONGDATA
- ElseIf Left(Text1.Text, 1) = "@" Then
- Client.SendData CMDDATA & KONGDATA & Text1.Text & NETKONGDATA
- Else
- Client.SendData TALKINFO & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Name_名字 & KONGDATA & Player(MainHeroNum).Name_名字 & ":" & Text1.Text & KONGDATA & D3DColorRGBA(0, 0, 0, 255) & KONGDATA & 0 & NETKONGDATA
- End If
- Text1.Text = ""
- Text1.Visible = False
- End If
- End Sub
- Private Sub Timer1_Timer()
- PlayNetData
- End Sub
- Private Sub Timer2_Timer()
- If LoginClient.State <> 7 Then LoginClient.Close: LoginClient.Connect ServerIP, ServerPort
- If LoginClient.State = 7 Then Timer2.Enabled = False
- End Sub