您当前的位置:首页 > 魔兽技术

全程详细自己定义任务数据说明

本文出处:网游动力作者:本站发布时间:2008-08-14阅读次数:

随便找了一个任务文件做这次的例程
[creature 198]
questscript=KheldenBremen ——>在tcl下相关的文件名
name=Khelden Bremen ——>名字
npctext0_0=Greetings mage . Shall I provide you with further insight into the wolrd of magic ?
——>点NPC时候说的话
attack=1946 2141 ——>攻击速度
bounding_radius=0.347000 ——>攻击距离
combat_reach=7.35 ——>活动半径
damage=5 6   ——>伤害
faction=35   ——>状态:
flags1=08400066   ——>标记
guild=Mage Trainer ——>组织 职称 
level=5 5   ——>最小等级与最高等级
maxhealth=132   ——>最大HP
maxmana=105   ——>最大SP
model=5001   ——>模型代码
npcflags=18   ——>定义类型:这里的意思是技能训练师+任务
speed=0.97   ——>速度
train=6116 //Frost Armor 1 ——>技能代码
train=1472 //Arcane Intellect 1
train=1142 //Frostbolt 1
train=5507 //Conjure Water 1
train=1173 //Fireball 2
train=2141 //Fire Blast 1
train=1249 //Conjure Food 1
train=1191 //Frostbolt 2
train=1168 //Polymorph 1
train=5146 //Arcane Missiles 1
train=1194 //Frost Nova 1
train=1174 //Frost Armor 2
train=5565 //Conjure Water 2
type=7   ——>属性
family=7   ——>
equip=0 791   ——>主手装备 装备代码



下面的相关的tcl文件说明,相同的地方我将不在重复说明,仔细看
# created by Slayer


#--------------------------------------------------------
namespace eval TommyJoe {
}


#--------------------------------------------------------
proc TommyJoe::GossipHello { npc player } {
#进入任务状态
SendGossipComplete $player
#关闭玩家任务窗口
SendSwitchGossip $player $npc 0
#切换玩家任务窗口内容
}


#--------------------------------------------------------
proc TommyJoe::GossipSelect { npc player option } {
#进行任务选择
SendGossipComplete $player
SendSwitchGossip $player $npc 0
}


#--------------------------------------------------------
proc TommyJoe::QueryQuest { npc player questid } {
#任务查询
}


#--------------------------------------------------------
# questgiver status query replies:
# QUEST_STATUS_NONE 0 // no mark on the head, chat not available
# QUEST_STATUS_COMPLETE 1 // gray (!) mark,   chat not available
# QUEST_STATUS_UNAVAILABLE 2 // no mark,       chat available, req higher level
# QUEST_STATUS_INCOMPLETE 3 // gray (?) mark,   chat available
# QUEST_STATUS_AVAILABLE 4 // yellow (!) mark,   chat available
#--------------------------------------------------------
proc TommyJoe::QuestStatus { npc player } {
#任务开始(没仔细用过,欢迎验证)
set reply 0
#定义reply的值
set qs106 [GetQuestStatus $player 106] ;# Young Lovers
#定义qs106的值 [获得玩家的flag任务状态 这里为106] 
set qs111 [GetQuestStatus $player 111] ;# Speak with Gramma
set level [GetLevel $player]
#定义level的值 [获得玩家的等级数值]

if {(([GetQFlag $player Q106]==0)&&($qs106==3))} {
#检测玩家的任务状态是否=106 同时检测qs106是否==3
    set reply 5
  } 


if {[GetQFlag $player Q106]==1} {
  if {(($qs111==4)&&([GetQFlag $player Q111]==0))} {
    if { $level >=5} {set reply 4}
#检测等级level的值是否>=5,在上面level值已经定义为玩家的等级数值。{定义reply}
  }
}


return $reply
#返回reply
}


#--------------------------------------------------------
proc TommyJoe::QuestHello { npc player } {


if {(([GetQFlag $player Q106]==0)&&([GetQuestStatus $player 106]==3))} {
  SendGossip $player $npc { quest 106 "Young Lovers"}
#发送player npc 的值{任务 106 名称}
  return


  set q111 ""



if {[GetQFlag $player Q106]==1} {
#检测玩家是否获得flag的标记 q106
  if {[GetQFlag $player Q111]==0} { set q111 111 }
  SendQuestsList $player $npc $q111
#发送任务列表 
  } 
}


#--------------------------------------------------------
proc TommyJoe::QuestSelect { npc player questid } {
#任务完成
if { [GetQuestStatus $player $questid] == 3 } {
#获取玩家flag任务状态
  SendQuestReward $player $npc $questid
#发送玩家奖励
} else {
#反之执行下面代码。这里是if检测的结果,如果玩家的flag任务状态不==3,那么就执行下面的代码
  SendQuestDetails $player $npc $questid
#发送任务细节给玩家,也就是任务说明拉
}
}

#--------------------------------------------------------
proc TommyJoe::QuestAccept { npc player questid } {
#接受任务
}


#--------------------------------------------------------
proc TommyJoe::QuestChooseReward { npc player questid choose } {
#领取任务奖励
SetQFlag $player "Q$questid"
#永久标记,该玩家已经完成过该任务
}


用到的Quest.scp里的相关文件
[quest 106]
name=Young Lovers ——>名字
desc=Give Maybell’s Love Letter to Tommy Joe Stonefield. ——>标题
details=Oh, I’m cursed! My heart belongs to Tommy Joe Stonefield, but our families are bitter enemies. So I can’t see him, 

even though my eyes ache to gaze upon that handsome face!$B$BPlease, take this letter and give it to Tommy Joe. He’s 

usually at the river to the west of the Stonefield Farm, which is due west of here. ——>内容
quest_flags=020 ——>任务的flags标记值
levels=1 6 ——>任务等级限制,属于新手任务
reward_xp=65 ——>任务完成时候奖励的XP
next_quest=111 ——>完成后还可以接的任务代码111
src_item=1208 1 ——>完成后奖励的物品
deliver=1208 1   ——>把物品放到你包包里拉
zone=12   ——>地域??

[quest 111]
name=Speak with Gramma
desc=Speak with Gramma Stonefield.
details=Please, $N, talk with my Gramma. If anyone can find a way to bring me together with Maybell, she can.$B$BShe’s 

inside our house east of here.
quest_flags=00
levels=1 6
reward_xp=70
next_quest=107
zone=12