游戏淘宝湾

 找回密码
 立即注册
开启左侧

[其他] 全程详细自己定义任务数据说明

[复制链接]
calmsolemn 发表于 2022-11-4 08:09:02 | 显示全部楼层 |阅读模式
随便找了一个任务文件做这次的例程
[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:ueryQuest { 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:uestStatus { 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:uestHello { 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:uestSelect { npc player questid } {
#任务完成
if { [GetQuestStatus $player $questid] == 3 } {
#获取玩家flag任务状态
  SendQuestReward $player $npc $questid
#发送玩家奖励
} else {
#反之执行下面代码。这里是if检测的结果,如果玩家的flag任务状态不==3,那么就执行下面的代码
  SendQuestDetails $player $npc $questid
#发送任务细节给玩家,也就是任务说明拉
}
}

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


#--------------------------------------------------------
proc TommyJoe:uestChooseReward { 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

本楼点评(0) 收起
zwx_no7 发表于 2022-11-4 08:15:44 | 显示全部楼层
楼主加油,我们都看好你哦。
本楼点评(0) 收起
回复

使用道具 举报

deltero 发表于 2022-11-4 08:15:44 | 显示全部楼层
我只是路过打酱油的。
本楼点评(0) 收起
回复

使用道具 举报

jdyuxp12 发表于 2022-11-10 17:03:49 | 显示全部楼层
感恩无私的分享与奉献
本楼点评(0) 收起
回复

使用道具 举报

108426382 发表于 2022-11-11 04:59:08 | 显示全部楼层
太生气了,无法HOLD啦 >_<......
本楼点评(0) 收起
回复

使用道具 举报

zwp707 发表于 2022-11-11 19:43:20 | 显示全部楼层
太生气了,无法HOLD啦 >_<......
本楼点评(0) 收起
回复

使用道具 举报

mikeshinoda 发表于 2022-11-11 20:07:18 | 显示全部楼层
我只是路过打酱油的。
本楼点评(0) 收起
回复

使用道具 举报

abooooooo 发表于 2022-11-14 11:54:08 | 显示全部楼层
看到这帖子真是高兴!
本楼点评(0) 收起
回复

使用道具 举报

dhxmeidou 发表于 2022-11-15 16:31:38 | 显示全部楼层
楼主加油,我们都看好你哦。
本楼点评(0) 收起
回复

使用道具 举报

ranyi170 发表于 2022-11-19 13:19:26 | 显示全部楼层
真是被感动的痛哭流涕……
本楼点评(0) 收起
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|游戏淘宝湾

GMT+8, 2024-4-30 07:26 , Processed in 0.098999 second(s), 96 queries .

Powered by 游戏淘宝湾 X3.4

Copyright © 2001-2023, Oddpp Cloud.

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