init: add workspace files
This commit is contained in:
101
world/obj/sp/bj/jing.js
Normal file
101
world/obj/sp/bj/jing.js
Normal file
@@ -0,0 +1,101 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "本",
|
||||
name: "四十二章经",
|
||||
desc: "一本镶黄旗的经书,封皮很精致。",
|
||||
max_level: 100,
|
||||
value: 5800,
|
||||
grade: 1,
|
||||
jing_index: 0
|
||||
});
|
||||
this.transable = true;
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) return;
|
||||
var lv = parseInt(par.substr(1));
|
||||
this.jing_index = lv;
|
||||
switch (lv) {
|
||||
case 1:
|
||||
this.name = "四十二章经一";
|
||||
this.desc = "一本镶黄旗的经书,封皮很精致。";
|
||||
break;
|
||||
case 2:
|
||||
this.name = "四十二章经二";
|
||||
this.desc = "一本正黄旗的经书,封皮很精致。";
|
||||
break;
|
||||
case 3:
|
||||
this.name = "四十二章经三";
|
||||
this.desc = "一本正蓝旗的经书,封皮很精致。";
|
||||
break;
|
||||
case 4:
|
||||
this.name = "四十二章经四";
|
||||
this.desc = "一本镶蓝旗的经书,封皮很精致。";
|
||||
break;
|
||||
case 5:
|
||||
this.name = "四十二章经五";
|
||||
this.desc = "一本镶红旗的经书,封皮很精致。";
|
||||
break;
|
||||
case 6:
|
||||
this.name = "四十二章经六";
|
||||
this.desc = "一本正红旗的经书,封皮很精致。";
|
||||
break;
|
||||
case 7:
|
||||
this.name = "四十二章经七";
|
||||
this.desc = "一本镶白旗的经书,封皮很精致。";
|
||||
break;
|
||||
case 8:
|
||||
this.name = "四十二章经八";
|
||||
this.desc = "一本正白旗的经书,封皮很精致。";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
this.add_action("si", "撕封皮", function (me) {
|
||||
var items = [];
|
||||
|
||||
for (var i = 0; i < me.items.length; i++) {
|
||||
if (me.items[i].jing_index) {
|
||||
|
||||
items[me.items[i].jing_index - 1] = me.items[i];
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
if (!items[i]) return me.notify("你还是等凑齐八本经书再撕吧。");
|
||||
}
|
||||
if (items.length != 8) {
|
||||
return me.notify("你还是等凑齐八本经书再撕吧。");
|
||||
}
|
||||
me.send_room("$N将八本四十二章经的封皮撕开,每本书都掉了一块羊皮出来。");
|
||||
me.notify("你把地图上画的内容牢牢记在脑中,然后点火把地图烧掉了。");
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
me.remove_obj(items[i], 1);
|
||||
}
|
||||
me.set_temp("map42", 1);
|
||||
});
|
||||
|
||||
this.add_action("he", "兑换", function (me, par) {
|
||||
me.send('如果你有多余的其他经书,可以每五本兑换一本其他经书。');
|
||||
if (this.count > 4) {
|
||||
if (!par) {
|
||||
var str = ["{type:\"cmds\",items:["];
|
||||
var names = "一二三四五六七八";
|
||||
for (let i = 1; i <= 8; i++) {
|
||||
if (i === this.jing_index) continue;
|
||||
if (str.length > 1) str.push(',');
|
||||
str.push("{cmd:\"packitem he ", this.id, " ", i, '",name:"四十二章经', names[i - 1], '"}');
|
||||
}
|
||||
str.push("]}");
|
||||
me.send(str.join(""));
|
||||
} else {
|
||||
let index = parseInt(par);
|
||||
if (!(index > 0 && index < 9))
|
||||
return me.send('参数错误。');
|
||||
if (index === this.jing_index)
|
||||
return me.send('你不能兑换自己。');
|
||||
|
||||
me.remove_obj(this, 5);
|
||||
let obj = me.add_obj('sp/bj/jing#' + index);
|
||||
me.send('你使用' + this.unit_name(5) + "兑换了" + obj.unit_name(1) + "。");
|
||||
}
|
||||
}
|
||||
});
|
||||
8
world/obj/sp/bj/jiu.js
Normal file
8
world/obj/sp/bj/jiu.js
Normal file
@@ -0,0 +1,8 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "指挥使令牌",
|
||||
desc: "这是魏贤自制的令牌,整体金黄,一条似龙非龙的巨蟒环绕,正面刻着【九千岁】几个大字",
|
||||
unit: "块",
|
||||
value: 10,
|
||||
grade:3
|
||||
});
|
||||
7
world/obj/sp/bj/laofangkey.js
Normal file
7
world/obj/sp/bj/laofangkey.js
Normal file
@@ -0,0 +1,7 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "牢房钥匙",
|
||||
desc: "这是一把牢房钥匙",
|
||||
unit: "把",
|
||||
value: 100,
|
||||
});
|
||||
10
world/obj/sp/bj/map.js
Normal file
10
world/obj/sp/bj/map.js
Normal file
@@ -0,0 +1,10 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "份",
|
||||
name: "龙脉地图",
|
||||
desc: "这是一份从四十二章经里得到的地图,八分凑到一起才能大概看清楚四周地形,看样子像是关外某个地方",
|
||||
max_level: 100,
|
||||
combined: false,
|
||||
value: 10000,
|
||||
grade: 2
|
||||
});
|
||||
7
world/obj/sp/bj/wu.js
Normal file
7
world/obj/sp/bj/wu.js
Normal file
@@ -0,0 +1,7 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "吴之荣的头颅",
|
||||
desc: "归安县的知县,因告发庄家,害的庄家家破人亡",
|
||||
unit: "颗",
|
||||
value: 0
|
||||
});
|
||||
7
world/obj/sp/bj/yanji.js
Normal file
7
world/obj/sp/bj/yanji.js
Normal file
@@ -0,0 +1,7 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "阎基的头颅",
|
||||
desc: "胡斐的杀父仇人阎基的头颅",
|
||||
unit: "颗",
|
||||
value: 0
|
||||
});
|
||||
9
world/obj/sp/bj/zhu.js
Normal file
9
world/obj/sp/bj/zhu.js
Normal file
@@ -0,0 +1,9 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "夜明珠",
|
||||
desc: "鸽卵大小的浑圆珠子,通体乳白,很值钱",
|
||||
unit: "颗",
|
||||
value: 1000000,
|
||||
grade: 3
|
||||
});
|
||||
this.transable = true;
|
||||
13
world/obj/sp/dati.js
Normal file
13
world/obj/sp/dati.js
Normal file
@@ -0,0 +1,13 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "张",
|
||||
name: "答题卡",
|
||||
desc: "一封密函,火漆封口,似乎写的什么秘密的军事机密",
|
||||
value: 10000,
|
||||
grade: 3
|
||||
});
|
||||
this.on_open = function (me) {
|
||||
var task = TASK.GET("xiangyang");
|
||||
if (!task) return me.notify_fail("你不知道里面写的什么东西。");
|
||||
me.notify_fail("你打开密函仔细读了一下,发现你不认识蒙古字,还是交给襄阳城的郭大侠看看吧。");
|
||||
}
|
||||
17
world/obj/sp/dizi.js
Normal file
17
world/obj/sp/dizi.js
Normal file
@@ -0,0 +1,17 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "个",
|
||||
name: "首席弟子称号",
|
||||
desc: "",
|
||||
grade:1,
|
||||
value: 1000
|
||||
});
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) return;
|
||||
this.family = FAMILIES[par.substr(1)];
|
||||
}
|
||||
this.on_receive = function (me) {
|
||||
if (!this.family || !this.family.top_name) return;
|
||||
me.add_title(this.family.top_name,"family");
|
||||
me.notify("<hig>你获得了称号:" + this.family.top_name +"</hig>。");
|
||||
}
|
||||
13
world/obj/sp/mihan.js
Normal file
13
world/obj/sp/mihan.js
Normal file
@@ -0,0 +1,13 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "封",
|
||||
name: "蒙古密函",
|
||||
desc: "一封密函,火漆封口,似乎写的什么秘密的军事机密",
|
||||
value: 0,
|
||||
grade: 3
|
||||
});
|
||||
this.on_open = function (me) {
|
||||
var task = TASK.GET("xiangyang");
|
||||
if (!task) return me.notify_fail("你不知道里面写的什么东西。");
|
||||
return me.notify_fail("你打开密函仔细读了一下,发现你不认识蒙古字,还是交给襄阳城的郭大侠看看吧。");
|
||||
}
|
||||
20
world/obj/sp/new/ksforce.js
Normal file
20
world/obj/sp/new/ksforce.js
Normal file
@@ -0,0 +1,20 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "本",
|
||||
name: "内功快速入门",
|
||||
desc: "一本可以快速学会内功心法的书,虽说只能学1级",
|
||||
value: 0,
|
||||
max_level: 1,
|
||||
combined: false,
|
||||
skill: "force",
|
||||
no_drop:true
|
||||
});
|
||||
this.on_study = function (me, skill_base) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
this.do_study = function (me, skill_base) {
|
||||
|
||||
skill_base.add_exp(me, 10);
|
||||
}
|
||||
20
world/obj/sp/new/ksunarmed.js
Normal file
20
world/obj/sp/new/ksunarmed.js
Normal file
@@ -0,0 +1,20 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "本",
|
||||
name: "拳脚快速入门",
|
||||
desc: "一本可以快速学些拳脚功夫的书",
|
||||
value: 0,
|
||||
max_level: 1,
|
||||
combined: false,
|
||||
skill: "unarmed",
|
||||
no_drop: true
|
||||
});
|
||||
this.on_study = function (me,skill_base) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
this.do_study = function (me, skill_base) {
|
||||
|
||||
skill_base.add_exp(me, 10);
|
||||
}
|
||||
7
world/obj/sp/new/mutou.js
Normal file
7
world/obj/sp/new/mutou.js
Normal file
@@ -0,0 +1,7 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "块",
|
||||
name: "木头",
|
||||
desc: "木头人身上掉下来的一块木头",
|
||||
value: 0
|
||||
});
|
||||
8
world/obj/sp/new/qicai.js
Normal file
8
world/obj/sp/new/qicai.js
Normal file
@@ -0,0 +1,8 @@
|
||||
this.inherits(EQUIPMENT);
|
||||
this.set({
|
||||
unit: "件",
|
||||
name: "<hig>七彩天岚衣<hig>",
|
||||
desc: "",
|
||||
value: 0,
|
||||
eq_type: EQUIP_TYPE.CLOTH,
|
||||
});
|
||||
110
world/obj/sp/npc.js
Normal file
110
world/obj/sp/npc.js
Normal file
@@ -0,0 +1,110 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "张",
|
||||
name: "契约",
|
||||
desc: "一张契约",
|
||||
value: 100000,
|
||||
grade: 5
|
||||
});
|
||||
this.on_use = function (me, par) {
|
||||
if (!me.is_player) return me.notify_fail("你不能使用契约书。");
|
||||
if (me.environment.parent.id != "home") return me.notify_fail("你只能在自己家使用契约。");
|
||||
if (!this.npc_path) return me.notify("你使用了契约书,可是没有任何反应。");
|
||||
var npc = NPC.CLONE(this.npc_path);
|
||||
if (!npc) return me.notify("你使用了契约书,可是没有任何反应。");
|
||||
var max = me.query_temp("max_follower", 3);
|
||||
var is_max = false;
|
||||
if (me.follower && me.follower.length >= max) is_max = true;
|
||||
if (!par && is_max) {
|
||||
var str = ["{type:\"cmds\",items:["];
|
||||
for (var i = 0; i < me.follower.length; i++) {
|
||||
if (me.follower[i].path == npc.path) {
|
||||
return me.notify_fail("你已经拥有" + npc.name + "了。");
|
||||
}
|
||||
var follower = FOLLOWER.GET(me, me.follower[i]);
|
||||
if (!follower) return me.notify_fail("未能读取到你的追随者,请尝试出去住所重新进入。");
|
||||
if (str.length > 1) str.push(",");
|
||||
str.push("{cmd:\"use ");
|
||||
str.push(this.id);
|
||||
str.push(" ");
|
||||
str.push(follower.id);
|
||||
str.push("\",name:\"继承");
|
||||
str.push(follower.name);
|
||||
str.push("的属性\"}");
|
||||
}
|
||||
me.send("你家的位置已经不多了,请选择如何安置" + npc.name
|
||||
+ ":\n<hir>会继承你选择的随从的经验,潜能,背包,装备。技能取两者的最高等级,进阶后的技能将保持等级不变</hir>");
|
||||
str.push("]}");
|
||||
me.send(str.join(""));
|
||||
return false;
|
||||
} else if (par) {
|
||||
for (var i = 0; i < me.follower.length; i++) {
|
||||
if (me.follower[i].path == npc.path) {
|
||||
return me.notify_fail("你已经拥有" + npc.name + "了。");
|
||||
}
|
||||
}
|
||||
var follower = FOLLOWER.GET(me, { id: par });
|
||||
if (!follower) return me.notify_fail("你家没有这个人。");
|
||||
// for (let sk in follower.skills) {
|
||||
// let skill = follower.skills[sk];
|
||||
// if (skill.addin && skill.addin.length)
|
||||
// return me.notify_fail(follower.name
|
||||
// + "的技能" +
|
||||
// SKILL.get(sk).query_color_name(follower) + "已经进阶,取消进阶才可以覆盖。");
|
||||
// }
|
||||
let old_name = follower.name;
|
||||
FOLLOWER.REPLACE(me, follower, npc);
|
||||
follower.master_json = null;
|
||||
if (follower.actions) {
|
||||
for (let item of follower.actions) {
|
||||
item.name = item.name.replace(old_name, npc.name);
|
||||
}
|
||||
}
|
||||
me.notify("<him>恭喜你获得了" + npc.name + "的追随。</him>");
|
||||
} else {
|
||||
if (me.add_follower(npc)) {
|
||||
me.notify("<him>恭喜你获得了" + npc.name + "的追随。</him>");
|
||||
me.environment.item_changed(FOLLOWER.GET(me, npc), true);
|
||||
} else {
|
||||
return me.notify_fail("召唤失败。");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) {
|
||||
return;
|
||||
}
|
||||
path = this.npcs[par.substr(1)];
|
||||
if (!path) return;
|
||||
var npc = NPC.CLONE(path);
|
||||
if (!npc) return;
|
||||
this.name = "契约:" + npc.name;
|
||||
this.desc = "这是一张契约书,在你的家里使用就可以拥有" + npc.name + ",你最多可以拥有三个追随者,新增的会继承原先NPC的技能,装备,物品。";
|
||||
this.npc_path = path;
|
||||
}
|
||||
this.npcs = {
|
||||
wang: "follower/wang",
|
||||
shuang: "follower/shuang",
|
||||
zhou: "follower/zhou",
|
||||
cheng: "follower/cheng",
|
||||
xiaozhao: "follower/xiaozhao",
|
||||
zhang: "follower/zhang",
|
||||
xia: "follower/xia",
|
||||
wen: "follower/wenyi",
|
||||
liumang: "yz/lm/xiaolm",
|
||||
wei: "yz/lcy/weichunfang",
|
||||
aobai: "bj/ao/aobai",
|
||||
qufeiyan: "wuyue/henshan/qufeiyan",
|
||||
huang: "follower/huang",
|
||||
azi: "follower/azi",
|
||||
azhu: "murong/azhu",
|
||||
abi: "murong/abi",
|
||||
long: "follower/xiaolongnv",
|
||||
qing: "follower/qing",
|
||||
qin: "follower/qin",
|
||||
lang: "follower/lang",
|
||||
dini: "follower/dini",
|
||||
shimei: "follower/shimei"
|
||||
};
|
||||
31
world/obj/sp/tool/chu.js
Normal file
31
world/obj/sp/tool/chu.js
Normal file
@@ -0,0 +1,31 @@
|
||||
this.inherits(EQUIPMENT);
|
||||
this.set({
|
||||
unit: "把",
|
||||
name: "铁镐",
|
||||
desc: "一根精铁制成的铁镐",
|
||||
value: 1000,
|
||||
eq_type: EQUIP_TYPE.WEAPON,
|
||||
weapon_type: WEAPON_TYPE.STAFF,
|
||||
|
||||
});
|
||||
|
||||
this.on_create = function (path, par) {
|
||||
let lv = 1;
|
||||
if (par) {
|
||||
par = par.substr(1);
|
||||
lv = parseInt(par);
|
||||
if (!(lv > 0 && lv < 7)) return;
|
||||
}
|
||||
this.grade = lv;
|
||||
this.prop = {
|
||||
gj: [1, 10, 40, 120, 340, 490, 690][lv],
|
||||
kuang1: [1, 5, 10, 15, 20, 25, 30][lv],
|
||||
desc: "你可以容易挖到高级宝石"
|
||||
};
|
||||
|
||||
if (this.grade === 6) {
|
||||
this.name = "移山镐";
|
||||
this.desc = "你可以在自家后院挖矿,更容易挖到高级的宝石";
|
||||
}
|
||||
EQUIPMENT.prototype.on_create.apply(this);
|
||||
}
|
||||
25
world/obj/sp/tool/diao.js
Normal file
25
world/obj/sp/tool/diao.js
Normal file
@@ -0,0 +1,25 @@
|
||||
this.inherits(EQUIPMENT);
|
||||
this.set({
|
||||
unit: "根",
|
||||
name: "钓鱼竿",
|
||||
desc: "一根竹子制成的钓鱼竿",
|
||||
value: 1000,
|
||||
eq_type: EQUIP_TYPE.WEAPON,
|
||||
weapon_type: WEAPON_TYPE.CLUB
|
||||
});
|
||||
this.on_create = function (path, par) {
|
||||
let lv = 1;
|
||||
if (par) {
|
||||
par = par.substr(1);
|
||||
lv = parseInt(par);
|
||||
if (!(lv > 0 && lv < 7)) return;
|
||||
}
|
||||
this.grade = lv;
|
||||
this.prop = {
|
||||
gj: [1, 10, 40, 120, 340, 490, 690][lv],
|
||||
diaoyu1: [1, 5, 10, 15, 20, 25, 30][lv],
|
||||
desc: "你更容易掉到稀有的鱼"
|
||||
};
|
||||
|
||||
EQUIPMENT.prototype.on_create.apply(this);
|
||||
}
|
||||
39
world/obj/sp/tool/er.js
Normal file
39
world/obj/sp/tool/er.js
Normal file
@@ -0,0 +1,39 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "个",
|
||||
name: "鱼饵",
|
||||
desc: "一些钓鱼用到的鱼饵",
|
||||
value: 100,
|
||||
consume: 5000
|
||||
});
|
||||
this.transable = true;
|
||||
//this.value = [500, 1000, 5000, 10000, 50000, 100000, 680000][this.grade];
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) return;
|
||||
par = par.substr(1);
|
||||
var lv = parseInt(par);
|
||||
if (!(lv > 0 && lv < 6)) return;
|
||||
this.grade = lv;
|
||||
switch (lv) {
|
||||
case 2:
|
||||
this.value = 200;
|
||||
this.consume = 15000;
|
||||
break;
|
||||
case 3:
|
||||
this.value = 300;
|
||||
this.consume = 20000;
|
||||
break;
|
||||
case 4:
|
||||
this.value = 400;
|
||||
this.consume = 25000;
|
||||
break;
|
||||
case 5:
|
||||
this.value = 500;
|
||||
this.consume = 30000;
|
||||
break;
|
||||
default:
|
||||
this.value = 100;
|
||||
this.consume = 10000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
27
world/obj/sp/tool/er2.js
Normal file
27
world/obj/sp/tool/er2.js
Normal file
@@ -0,0 +1,27 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "包",
|
||||
name: "鱼饵",
|
||||
desc: "一些钓鱼用到的鱼饵,可能有50-100个同品质鱼饵",
|
||||
value: 100
|
||||
});
|
||||
this.transable = true;
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) return;
|
||||
par = par.substr(1);
|
||||
var lv = parseInt(par);
|
||||
if (!(lv > 0 && lv < 6)) return;
|
||||
this.grade = lv;
|
||||
this.value = lv * 10000;
|
||||
}
|
||||
|
||||
this.on_open = function (me) {
|
||||
|
||||
var result = [
|
||||
{
|
||||
obj: 'sp/tool/er#' + this.grade, min: 50, max: 100
|
||||
}
|
||||
];
|
||||
|
||||
return OBJ.create_by_odds(result);
|
||||
}
|
||||
36
world/obj/sp/tool/exp.js
Normal file
36
world/obj/sp/tool/exp.js
Normal file
@@ -0,0 +1,36 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "本",
|
||||
name: "挖矿指南",
|
||||
desc: "一本书,里面记载的挖矿的方法,提高你的挖矿效率",
|
||||
grade: 1,
|
||||
value: 10000
|
||||
});
|
||||
this.on_use = function (me) {
|
||||
me.notify("你打开这本挖矿指南仔细研究起来....");
|
||||
COMMAND.DO('sys', me.name + '捡到一本挖矿指南,学会了里面记载的挖矿技巧,所有人的挖矿效率都提高了。');
|
||||
|
||||
let lv = WORLD.DATA.query_temp("kuang_exp", 0);
|
||||
let value = this.grade * 10;
|
||||
if (lv > value) return;
|
||||
WORLD.DATA.set_temp("kuang_exp", value, 600000);
|
||||
|
||||
EVENTS.add({
|
||||
id: "wkzn",
|
||||
name: "挖矿指南",
|
||||
desc: me.name + '学会了新的挖矿技巧,所有人的挖矿效率都提高了,获得经验+' + value + '。',
|
||||
time: Date.now() + 600000,
|
||||
grade: this.grade
|
||||
});
|
||||
return true;
|
||||
}
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) {
|
||||
this.path = path + "#1";
|
||||
return;
|
||||
}
|
||||
par = par.substr(1);
|
||||
var lv = parseInt(par);
|
||||
if (!(lv > 0 && lv < 6)) return;
|
||||
this.grade = lv;
|
||||
}
|
||||
35
world/obj/sp/tool/fuqi.js
Normal file
35
world/obj/sp/tool/fuqi.js
Normal file
@@ -0,0 +1,35 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "休书",
|
||||
desc: "这是一封休书",
|
||||
unit: "封",
|
||||
value: 0,
|
||||
grade: 3
|
||||
});
|
||||
this.on_create = function (path, par) {
|
||||
if (par) {
|
||||
this.target = par.substr(1);
|
||||
}
|
||||
}
|
||||
|
||||
this.on_receive = function (me) {
|
||||
if (!this.target) return;
|
||||
if (me.query_temp("wife") == this.target) {
|
||||
var name = me.query_temp("wife_n");
|
||||
me.remove_temp("wife");
|
||||
me.remove_temp("wife_n");
|
||||
me.commands_json = null;
|
||||
me.notify("你和" + name + "的夫妻关系解除了。");
|
||||
me.add_title("", "mar");
|
||||
me.set_temp("marry_leave", 1, 7 * 24 * 3600000);
|
||||
} else if (me.query_temp("husband") == this.target) {
|
||||
var name = me.query_temp("husband_n");
|
||||
me.remove_temp("husband");
|
||||
me.remove_temp("husband_n");
|
||||
me.commands_json = null;
|
||||
me.notify("你和" + name + "的夫妻关系解除了。");
|
||||
|
||||
me.add_title("", "mar");
|
||||
me.set_temp("marry_leave", 1, 7 * 24 * 3600000);
|
||||
}
|
||||
}
|
||||
32
world/obj/sp/tool/shitu.js
Normal file
32
world/obj/sp/tool/shitu.js
Normal file
@@ -0,0 +1,32 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "师徒关系解除通知",
|
||||
desc: "",
|
||||
unit: "封",
|
||||
value: 0,
|
||||
grade: 3
|
||||
});
|
||||
this.on_create = function (path, par) {
|
||||
if (par) {
|
||||
this.target = par.substr(1);
|
||||
}
|
||||
}
|
||||
|
||||
this.on_receive = function (me) {
|
||||
if (!this.target) return;
|
||||
if (me.query_temp("tudi") == this.target) {
|
||||
var name = me.query_temp("tudi_n");
|
||||
me.remove_temp("tudi");
|
||||
me.remove_temp("tudi_n");
|
||||
me.commands_json = null;
|
||||
me.notify("你和" + name + "的师徒关系自动解除了。");
|
||||
me.set_temp("st_leave", 1, 3600000 * 24 * 7);
|
||||
} else if (me.query_temp("shifu") == this.target){
|
||||
var name = me.query_temp("shifu_n");
|
||||
me.remove_temp("shifu");
|
||||
me.remove_temp("shifu_n");
|
||||
me.commands_json = null;
|
||||
me.notify("你和" + name + "的师徒关系自动解除了。");
|
||||
me.set_temp("st_leave", 1, 3600000 * 24 * 7);
|
||||
}
|
||||
}
|
||||
20
world/obj/sp/tool/sm.js
Normal file
20
world/obj/sp/tool/sm.js
Normal file
@@ -0,0 +1,20 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "个",
|
||||
name: "师门令牌",
|
||||
desc: "可以用来完成师门交给你的任务,限制30难度以前",
|
||||
grade: 1,
|
||||
value: 0
|
||||
});
|
||||
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) {
|
||||
this.path = path + "#1";
|
||||
return;
|
||||
}
|
||||
par = par.substr(1);
|
||||
var lv = parseInt(par);
|
||||
if (!(lv > 0 && lv < 6)) return;
|
||||
this.grade = lv;
|
||||
this.desc = "可以用来完成师门交给你的任务,限制" + (10 + this.grade * 20) + "难度以前";
|
||||
}
|
||||
22
world/obj/sp/tool/summon.js
Normal file
22
world/obj/sp/tool/summon.js
Normal file
@@ -0,0 +1,22 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "块",
|
||||
name: "召唤令",
|
||||
desc: "使用后可召唤出一个首领级NPC",
|
||||
value: 10000,
|
||||
grade:3
|
||||
});
|
||||
this.on_use= function (me) {
|
||||
var task = TASK.GET("boss");
|
||||
if (!task) return me.notify_fail("现在不能召唤。");
|
||||
if (me.environment.is_copy()) return me.notify_fail("副本和家中不可以召唤。");
|
||||
if (me.environment.no_fight) return me.notify_fail("这里没办法战斗,你召唤出来干嘛。");
|
||||
var boss = task.create_boss();
|
||||
me.environment.item_changed(boss, true, "<hiw>" + boss.name + "突然出现一片烟雾中。</hiw>");
|
||||
this.call_out(this.on_disappear, 1800000,boss);
|
||||
}
|
||||
this.on_disappear = function (boss) {
|
||||
if (boss.environment) {
|
||||
boss.destroy(boss.name+"走了。");
|
||||
}
|
||||
}
|
||||
27
world/obj/sp/tool/yao.js
Normal file
27
world/obj/sp/tool/yao.js
Normal file
@@ -0,0 +1,27 @@
|
||||
this.inherits(EQUIPMENT);
|
||||
this.set({
|
||||
unit: "本",
|
||||
name: "药王神篇",
|
||||
desc: "毒手药王无嗔大师的著作,里面记载了很多药草知识",
|
||||
value: 1000,
|
||||
eq_type: EQUIP_TYPE.JEWELS
|
||||
});
|
||||
this.on_create = function (path, par) {
|
||||
let lv = 1;
|
||||
if (par) {
|
||||
par = par.substr(1);
|
||||
lv = parseInt(par);
|
||||
if (!(lv > 0 && lv < 7)) return;
|
||||
}
|
||||
this.grade = lv;
|
||||
this.prop = {
|
||||
int: [1, 3, 8, 13, 20, 30, 100][lv],
|
||||
caiyao1: [1, 5, 10, 15, 20, 25, 30][lv],
|
||||
desc: "你更容易采到稀有的药草"
|
||||
};
|
||||
if (this.grade === 6) {
|
||||
this.name = "神农百草经";
|
||||
this.desc = "药神神农氏的著作,里面记载了很多药草知识";
|
||||
}
|
||||
EQUIPMENT.prototype.on_create.apply(this);
|
||||
}
|
||||
54
world/obj/sp/tool/zhuisha.js
Normal file
54
world/obj/sp/tool/zhuisha.js
Normal file
@@ -0,0 +1,54 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "个",
|
||||
name: "门派追杀令",
|
||||
desc: "门派追杀令,使用后可以召唤门派NPC追杀10分钟内击杀过自己门派NPC的玩家",
|
||||
grade: 1,
|
||||
value: 10000
|
||||
});
|
||||
this.on_use = function (me) {
|
||||
if (!me.is_player) return me.notify("你不能用追杀令。");
|
||||
me.notify("请说出你要追杀的玩家的名字(打开聊天框任意频道输入):");
|
||||
|
||||
me.wait_input = readname.bind(this);
|
||||
return false;
|
||||
}
|
||||
function readname(me, cmd) {
|
||||
if (!cmd) return me.send('请说出你要追杀的玩家的名字(打开聊天框任意频道输入):');
|
||||
var ss = cmd.split(' ');
|
||||
if (ss.length != 2) return me.notify("请说出你要追杀的玩家的名字(打开聊天框任意频道输入):");
|
||||
var name = ss[1];
|
||||
var name_reg = /^[\u4E00-\u9FA5]{2,5}$/;
|
||||
if (!name_reg.test(name)) {
|
||||
return me.send('玩家的名字需要是2-5个中文字符');
|
||||
}
|
||||
me.wait_input = null;
|
||||
var obj = me.find_obj_bypath(this.path);
|
||||
if (!obj || !obj.count) {
|
||||
me.send('你身上没有追杀令。');
|
||||
return;
|
||||
}
|
||||
var user = WORLD.find_user(name);
|
||||
if (!user) return me.notify("没有这个玩家或者不在线。");
|
||||
var fam = me.family;
|
||||
if (!user.query_temp("killer_" + fam.id)) return me.notify(name + "和你的门派没有恩怨,你不能使用追杀令。");
|
||||
if (!me.remove_obj(obj, 1)) return;
|
||||
user.notify("<hir>" + fam.name + "对你发出追杀令,听天由命吧。</hir>");
|
||||
me.notify("<hir>追杀令已发出,一分钟内对方将被你的门派弟子追杀。</hir>");
|
||||
var npc = fam.create_npc(obj.grade-1);
|
||||
if (fam.boss) {
|
||||
fam.boss.do_command("chat", npc.name + "听令,即刻起追杀" + name + ",不得有误。");
|
||||
}
|
||||
npc.follow_kill(user);
|
||||
}
|
||||
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) {
|
||||
this.path = path + "#1";
|
||||
return;
|
||||
}
|
||||
par = par.substr(1);
|
||||
var lv = parseInt(par);
|
||||
if (!(lv > 0 && lv <= 5)) return;
|
||||
this.grade = lv;
|
||||
}
|
||||
26
world/obj/sp/yz/box1.js
Normal file
26
world/obj/sp/yz/box1.js
Normal file
@@ -0,0 +1,26 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "小箱子",
|
||||
desc: "这是在崔员外家找到的一个小箱子,不知道里面放了些了什么。",
|
||||
unit: "个",
|
||||
value: 0,
|
||||
grade:2
|
||||
});
|
||||
this.on_open = function (me) {
|
||||
return OBJ.create_by_odds([{
|
||||
obj: "money/gold",
|
||||
min: 1,
|
||||
max:10
|
||||
}, {
|
||||
obj: ["book/book#unarmed", "book/book#parry", "book/book#dodge", "book/book#sword"],
|
||||
odds: 10000
|
||||
}, {
|
||||
obj: ["st/st_blu", "st/st_red", "st/st_gre", "st/st_yel"],
|
||||
min: 1,
|
||||
max: 3,
|
||||
odds: 5000
|
||||
}, {
|
||||
obj: ["eq/lv1/pifeng"],
|
||||
odds: 2000
|
||||
}]);
|
||||
}
|
||||
8
world/obj/sp/yz/qiantiao.js
Normal file
8
world/obj/sp/yz/qiantiao.js
Normal file
@@ -0,0 +1,8 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "欠条",
|
||||
desc: "这是一张从流氓头身上搜出来的条子,上面歪歪扭扭的写着:\n因欠韦老板黄金5两,抵押本人武器拳套千斤拳一副,三日内凭此据赎回。赵三拳立",
|
||||
unit: "张",
|
||||
value: 0,
|
||||
combined: false
|
||||
});
|
||||
16
world/obj/sp/yz/xin.js
Normal file
16
world/obj/sp/yz/xin.js
Normal file
@@ -0,0 +1,16 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "崔员外的信",
|
||||
desc: "这是一封崔员外写给扬州城外流氓头的信,还没送出去。上面火漆封口也不知道是什么内容。",
|
||||
unit: "封",
|
||||
value: 0,
|
||||
combined:false
|
||||
});
|
||||
this.add_action("chai", "拆开", function (me) {
|
||||
|
||||
var str = '史兄弟在上:/n,近日愚兄偶得一本武林秘籍《奋进》,听闻兄弟醉心武学,故奉上供兄弟研究,另献上本月供奉100两黄金。望史兄弟武运昌隆,庇佑愚兄。';
|
||||
|
||||
me.notify(str);
|
||||
me.notify("这封信应该是崔员外府上的管家代写的,秀才硬要充草莽,又酸又假装豪放,不知道这个信上说的史兄弟是哪个山头的贼人。");
|
||||
|
||||
});
|
||||
7
world/obj/sp/yz/yaoshi.js
Normal file
7
world/obj/sp/yz/yaoshi.js
Normal file
@@ -0,0 +1,7 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
name: "东厢钥匙",
|
||||
desc: "这是一把很普通的钥匙,在崔员外家找到的",
|
||||
unit: "把",
|
||||
value: 10,
|
||||
});
|
||||
Reference in New Issue
Block a user