游戏开发论坛

 找回密码
 立即注册
搜索
查看: 3310|回复: 5

魔兽世界服务器端编程资料已经更新

[复制链接]

20

主题

451

帖子

470

积分

中级会员

Rank: 3Rank: 3

积分
470
发表于 2006-4-24 05:26:00 | 显示全部楼层 |阅读模式
由于这两个星期我这里的网络问题,虽然文章写了,但是一直没有机会上传,现在终于可以传上来了。这次更新了2篇,主要把登陆服务器的全部处理讲完了,并且讲解了游戏服务器的验证过程和封包加解密方法。
另外,我的WOW模拟器现在已经把脚本系统完全定下形了,并且也已经写好了一个DB读取写入脚本,还有角色数据脚本的一部分,由于工作量太大以及还有两个数据存储方式还未定下来,所以未完成,我会把这个脚本附在2楼的帖子,希望大家能把少了的部分补上。
所有东西我已经更新在我的网站上了,大家去看看吧:
www.asstudio.de

20

主题

451

帖子

470

积分

中级会员

Rank: 3Rank: 3

积分
470
 楼主| 发表于 2006-4-24 05:28:00 | 显示全部楼层

Re:魔兽世界服务器端编程资料已经更新

Imports MyWoW.Common
Imports System

Namespace MyWoW.Scripts.Player
    Public Class PlayerClass
        Public Shared Sub InitRace(ByVal pl As MyWoW.Common.Player)
            Select Case pl.Race
                Case Race.RACE_DWARF
                    pl.Strength = 22
                    pl.Agility = 16
                    pl.Stamina = 23
                    pl.Intellect = 19
                    pl.Spirit = 19
                    Select Case pl.Gender
                        Case Gender.Male
                            pl.Model = 53
                        Case Gender.Female
                            pl.Model = 54
                    End Select
                    pl.MapID = 0
                    pl.ZoneID = 1
                    pl.Position_X = -6240.32
                    pl.Position_Y = 331.033
                    pl.Position_Z = 382.758
                    pl.Faction = 3
                    AddSpell(pl, 672)
                    'p.SetSkill (111, 300, 300)  # Language: Dwarven
                    OneTimeRacialAlliance(pl)
                    AddSpell(pl, 2481)       '# Find Treasure
                    AddSpell(pl, 20594)      '# Stoneform
                    AddSpell(pl, 20595)      '# Gun Specialization
                    AddSpell(pl, 20596)      '# Frost Resistance
                Case Race.RACE_GNOME
                    pl.Strength = 15
                    pl.Agility = 23
                    pl.Stamina = 19
                    pl.Intellect = 23
                    pl.Spirit = 20

                    '#--- Resistances ---        
                    'p.ModifyArcaneResist(10)   # Arcane Resistance 10

                    '            If oneTimeInit Then
                    Select Case pl.Gender
                        Case Gender.Male
                            pl.Model = 1563
                        Case Gender.Female
                            pl.Model = 1564
                    End Select
                    pl.Position_X = -6240.32
                    pl.Position_Y = 331.033
                    pl.Position_Z = 382.758
                    pl.MapID = 0
                    pl.ZoneID = 1
                    'p.StartupLocation (0, -6240.32, 331.033, 382.758, 1.0)  # Coldridge Valley
                    pl.Faction = 8          '# PLAYER, Gnome

                    AddSpell(pl, 7340)           '# Language: Gnomish
                    'p.SetSkill (313, 300, 300)  # Language: Gnomish

                    OneTimeRacialAlliance(pl)
                    'Reputation(p)

                    '#--- Racial ---
                    AddSpell(pl, 20589)      '# Escape Artist
                    AddSpell(pl, 20591)      '# Expansive Mind
                    AddSpell(pl, 20592)      '# Arcane Resistance
                    AddSpell(pl, 20593)      '# Engineering Specialization
                Case Race.RACE_HUMAN

                Case Race.RACE_NIGHT_ELF

                Case Race.RACE_ORC

                Case Race.RACE_TAUREN

                Case Race.RACE_TROLL

                Case Race.RACE_UNDEAD

            End Select
        End Sub

        Public Shared Sub InitClass(ByVal pl As MyWoW.Common.Player)
            Select Case pl.Class
                Case [Class].CLASS_DRUID
                    pl.PowerType = Common.PowerType.POWER_TYPE_MANA
                Case [Class].CLASS_HUNTER
                    pl.PowerType = Common.PowerType.POWER_TYPE_MANA
                    pl.RangedAttackTime = 2200
                Case [Class].CLASS_MAGE
                    pl.PowerType = Common.PowerType.POWER_TYPE_MANA
                Case [Class].CLASS_PALADIN
                    pl.PowerType = Common.PowerType.POWER_TYPE_MANA
                Case [Class].CLASS_PRIEST
                    pl.PowerType = Common.PowerType.POWER_TYPE_MANA
                Case [Class].CLASS_ROGUE
                    pl.PowerType = Common.PowerType.POWER_TYPE_ENERGY
                    pl.RangedAttackTime = 2200
                Case [Class].CLASS_SHAMAN
                    pl.PowerType = PowerType.POWER_TYPE_MANA
                Case [Class].CLASS_WARLOCK
                    pl.PowerType = PowerType.POWER_TYPE_MANA
                Case [Class].CLASS_WARRIOR
                    pl.PowerType = PowerType.POWER_TYPE_RAGE
                    pl.Strength += 3
                    pl.Stamina += 2
                    Recalculate(pl)
                    AddSpell(pl, 9077)           '# Leather
                    'p.SetSkill (414, 1, 1)      # Leather
                    AddSpell(pl, 8737)           '# Mail
                    'SetSkill (413, 1, 1)      # Mail
                    AddSpell(pl, 9116)           '# Shield
                    'SetSkill (433, 1, 1)      # Shield

                    '#--- Class Skills ---
                    'p.SetSkill (26, 1, 1)       # Arms

                    '#--- Other ---
                    'p.SetSkill (95, 1, 5)       # Defense
                    AddSpell(pl, 107)            '# Block
                    AddSpell(pl, 78)             '# Heroic Strike
                    AddSpell(pl, 2457)           '# Battle stance
                    Select Case pl.Race
                        Case Race.RACE_DWARF
                            AddSpell(pl, 197)            '# Two-Handed Axes
                            'p.SetSkill (172, 1, 5)      # Two-Handed Axes
                            AddSpell(pl, 198)            '# Maces
                            'p.SetSkill (54, 1, 5)       # Maces
                            AddSpell(pl, 196)            '# Axes
                            'p.SetSkill (44, 1, 5)       # Axes

                            '#--- Initial Items ---
                            AddItemtoSlot(pl, 38, 3)     '# recruit's shirt
                            AddItemtoSlot(pl, 39, 6)       '# recruit's pants
                            AddItemtoSlot(pl, 40, 7)       '# recruit's boots
                            AddItemtoSlot(pl, 12282, 15)  '# Worn Battleaxe

                            AddItemtoSlot(pl, 117, 24)    '# Tough Jerky
                    End Select

            End Select
        End Sub

        Private Shared Sub OneTimeRacialAlliance(ByVal pl As MyWoW.Common.Player)
            AddSpell(pl, 668)            '# Language: Common
            'p.SetSkill (98, 300, 300)   # Language: Common
            AddSpell(pl, 203)            '# Unarmed
            'p.SetSkill (162, 1, 5)      # Unarmed
            AddSpell(pl, 81)             '# Dodge
            AddSpell(pl, 6603)         '# Attack Melee
            AddSpell(pl, 3365)           '# Opening
            AddSpell(pl, 6478)          ' # Opening
            AddSpell(pl, 9078)           '# Cloth
            'p.SetSkill (415, 1, 1)      # Cloth
            AddSpell(pl, 7266)           '# Duel
            '#--- Initial Items GLOBAL ---
            AddItemtoSlot(pl, 6948, 23)
        End Sub

        Private Shared Sub OneTimeRacialHorde(ByVal pl As MyWoW.Common.Player)
            AddSpell(pl, 669)            '# Language: Orcish
            'p.SetSkill (109, 300, 300)  # Language: Orcish
            AddSpell(pl, 203)            '# Unarmed
            'p.SetSkill (162, 1, 5)      # Unarmed
            AddSpell(pl, 81)             '# Dodge
            AddSpell(pl, 6603)         '# Attack Melee
            AddSpell(pl, 3365)           '# Opening
            AddSpell(pl, 6478)           '# Opening
            AddSpell(pl, 9078)           '# Cloth
            'p.SetSkill (415, 1, 1)      # Cloth
            AddSpell(pl, 7266)           '# Duel
            '#--- Initial Items GLOBAL ---
            AddItemtoSlot(pl, 6948, 23)                   '# Hearthstone
        End Sub

        Private Shared Sub AddItemtoSlot(ByVal pl As MyWoW.Common.Player, ByVal ItemID As Integer, ByVal Index As Integer)
            Dim i As Int16
            i = Index - pl.Items.Count + 1
            If i > 0 Then
                Do While i > 0
                    pl.Items.Add(0)
                    i -= 1
                Loop
            End If
            If pl.Items(Index) = 0 Then pl.Items(Index) = ItemID
        End Sub

        Private Shared Sub AddSkill(ByVal pl As MyWoW.Common.Player, ByVal SkillID As Integer)
            If pl.Skills.IndexOf(SkillID) = -1 Then
                pl.Skills.Add(SkillID)
            End If
        End Sub

        Private Shared Sub AddSpell(ByVal pl As MyWoW.Common.Player, ByVal SpellID As Integer)
            If pl.Spells.IndexOf(SpellID) = -1 Then
                pl.Spells.Add(SpellID)
            End If
        End Sub

20

主题

451

帖子

470

积分

中级会员

Rank: 3Rank: 3

积分
470
 楼主| 发表于 2006-4-24 16:19:00 | 显示全部楼层

Re:魔兽世界服务器端编程资料已经更新

顶起来

3

主题

159

帖子

159

积分

注册会员

Rank: 2

积分
159
发表于 2006-4-24 18:28:00 | 显示全部楼层

Re:魔兽世界服务器端编程资料已经更新

支持一下!
去看看

20

主题

451

帖子

470

积分

中级会员

Rank: 3Rank: 3

积分
470
 楼主| 发表于 2006-4-25 18:50:00 | 显示全部楼层

Re:魔兽世界服务器端编程资料已经更新

再顶

20

主题

451

帖子

470

积分

中级会员

Rank: 3Rank: 3

积分
470
 楼主| 发表于 2006-5-2 04:31:00 | 显示全部楼层

Re:魔兽世界服务器端编程资料已经更新

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-24 10:01

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表