|
|

楼主 |
发表于 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
|
|