init: add workspace files
This commit is contained in:
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;
|
||||
}
|
||||
Reference in New Issue
Block a user