init: add workspace files
This commit is contained in:
9
world/map/wudao/ding.js
Normal file
9
world/map/wudao/ding.js
Normal file
@@ -0,0 +1,9 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "塔顶"
|
||||
this.desc = "这里是武道塔的顶部,脚下是高耸入云的武道塔,你仿佛踏在云端,果然是会当凌绝顶,一览众山小。这里空荡荡的什么都没有,一个看上去疯疯癫癫的老头靠在墙角。";
|
||||
this.exits = {
|
||||
"west": "wudao/west", "up": "wudao/ta2", "down": "wudao/men",
|
||||
"east": "wudao/east", "north": "wudao/north", "south": "wudao/south"
|
||||
};
|
||||
|
||||
|
||||
23
world/map/wudao/east.js
Normal file
23
world/map/wudao/east.js
Normal file
@@ -0,0 +1,23 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "青龙台"
|
||||
this.desc = "这里是武道塔顶部的东面平台,一座青龙的雕塑凭空而立,传说中的四大守护神兽之一。";
|
||||
this.exits = { "west": "wudao/ding" };
|
||||
this.max_item_count = 1;
|
||||
this.is_shadow = true;
|
||||
this.no_relive = true;
|
||||
// this.add_action('biguan', '聚魂', function (me) {
|
||||
// WORLD.COMMANDS['wsxl'].enter(me);
|
||||
// });
|
||||
this.on_enter = function (me) {
|
||||
let npc = NPC.CLONE('pub/wudao_ss');
|
||||
npc.init_from(me, 0);
|
||||
|
||||
this.item_changed(npc, true);
|
||||
npc.do_kill(me);
|
||||
}
|
||||
|
||||
this.on_leave = function (me) {
|
||||
let npc = this.find_obj_bypath('pub/wudao_ss');
|
||||
if (npc) npc.destroy();
|
||||
me.remove_status('ss');
|
||||
}
|
||||
26
world/map/wudao/men.js
Normal file
26
world/map/wudao/men.js
Normal file
@@ -0,0 +1,26 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "入口"
|
||||
this.desc = "这里是武道塔的入口,旁边就是天下学武之人无限向往的武道之塔了,站在这里你可以完完整整感受到它庄严雄伟的气势,犹如一根擎天巨柱直入云霄。";
|
||||
this.exits = { "enter": "wudao/ta" };
|
||||
//this.no_fight = true;
|
||||
this.set_npc("pub/wudao_men");
|
||||
//this.on_enter = function (me) {
|
||||
// if (me.level == 4 && me.query_temp("wd")==1) {
|
||||
// var npc = this.items[0];
|
||||
// if (npc.is("pub/wudao_men")) {
|
||||
// me.notify("守门人深深地看了你一眼...");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
this.on_leave = function (me, dir) {
|
||||
if (dir === 'enter') {
|
||||
var level = me.query_temp("wd_level", 0);
|
||||
if (level >= 99) {
|
||||
me.moveto('wudao/ding');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
22
world/map/wudao/north.js
Normal file
22
world/map/wudao/north.js
Normal file
@@ -0,0 +1,22 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "玄武台"
|
||||
this.desc = "这里是武道塔顶部的北面平台,一座玄武的雕塑凭空而立,传说中的四大守护神兽之一。";
|
||||
this.exits = { "south": "wudao/ding" };
|
||||
this.max_item_count = 1;
|
||||
this.is_shadow = true;
|
||||
this.no_relive = true;
|
||||
// this.add_action('biguan', '聚魂', function (me) {
|
||||
// WORLD.COMMANDS['wsxl'].enter(me);
|
||||
// });
|
||||
this.on_enter = function (me) {
|
||||
let npc = NPC.CLONE('pub/wudao_ss');
|
||||
npc.init_from(me, 2);
|
||||
|
||||
this.item_changed(npc, true);
|
||||
npc.do_kill(me);
|
||||
}
|
||||
this.on_leave = function (me) {
|
||||
let npc = this.find_obj_bypath('pub/wudao_ss');
|
||||
if (npc) npc.destroy();
|
||||
me.remove_status('ss');
|
||||
}
|
||||
23
world/map/wudao/south.js
Normal file
23
world/map/wudao/south.js
Normal file
@@ -0,0 +1,23 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "朱雀台"
|
||||
this.desc = "这里是武道塔顶部的北面平台,一座朱雀的雕塑凭空而立,传说中的四大守护神兽之一。";
|
||||
this.exits = { "north": "wudao/ding" };
|
||||
this.max_item_count = 1;
|
||||
this.is_shadow = true;
|
||||
this.no_relive = true;
|
||||
// this.add_action('biguan', '聚魂', function (me) {
|
||||
// WORLD.COMMANDS['wsxl'].enter(me);
|
||||
// });
|
||||
this.on_enter = function (me) {
|
||||
let npc = NPC.CLONE('pub/wudao_ss');
|
||||
npc.init_from(me, 3);
|
||||
|
||||
this.item_changed(npc, true);
|
||||
npc.do_kill(me);
|
||||
}
|
||||
|
||||
this.on_leave = function (me) {
|
||||
let npc = this.find_obj_bypath('pub/wudao_ss');
|
||||
if (npc) npc.destroy();
|
||||
me.remove_status('ss');
|
||||
}
|
||||
204
world/map/wudao/ta.js
Normal file
204
world/map/wudao/ta.js
Normal file
@@ -0,0 +1,204 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "第一层"
|
||||
this.desc = "这里是武道塔的内部,塔身已经石迹斑驳,但是仍然耸立挺拔。四周都是坚固的石壁,不知道什么原因留下一些横七竖八的刀刻剑痕,你想细看却觉得眼睛被刺得发疼。";
|
||||
this.exits = { "up": "wudao/up", "out": "wudao/men" };
|
||||
this.max_item_count = 1;
|
||||
this.on_before_enter = function (me) {
|
||||
var level = (me.query_temp("wd_level") || 0) + 1;
|
||||
var name = UTIL.to_c(level);
|
||||
this.name = "第" + name + "层";
|
||||
var npc = null;
|
||||
if (level > 99) return this.refresh();
|
||||
// if (level == 100 || me.query_temp('wudao_o')) {
|
||||
// npc = NPC.CLONE( "pub/wudao_boss");
|
||||
|
||||
// npc.die = this.on_die_boss;
|
||||
// this.name = "第" + name + "层";
|
||||
// npc.init_from(me);
|
||||
// } else {
|
||||
npc = NPC.CLONE("pub/wudao");
|
||||
npc.init_from(me, level);
|
||||
if (level >= 90) {
|
||||
me.clear_combat_prop();
|
||||
me.clear_status();
|
||||
}
|
||||
|
||||
npc.die = this.on_die2;
|
||||
// }
|
||||
|
||||
npc.environment = this;
|
||||
this.items.length = 0;
|
||||
this.items.push(npc);
|
||||
this.refresh();
|
||||
//this.item_changed(npc, true);
|
||||
}
|
||||
this.on_enter = function (me) {
|
||||
me.die = this.on_die1;
|
||||
let npc = this.items[0];
|
||||
if (npc && !npc.is_player) {
|
||||
me.send(npc.name + ':这位' + me.call() + ",请了。");
|
||||
// me.clear_status();
|
||||
npc.do_kill(me);
|
||||
}
|
||||
}
|
||||
|
||||
this.on_die1 = function (me) {
|
||||
if (this.on_die && this.on_die(me) == false) {
|
||||
this.hp = 1;
|
||||
return false;
|
||||
}
|
||||
var level = this.query_temp("wd_level", 0) + 1;
|
||||
if (level >= 90) {
|
||||
this.hp = this.max_hp;
|
||||
this.mp = this.max_mp;
|
||||
var npc = this.environment.find_by_path("pub/wudao");
|
||||
npc && npc.destroy();
|
||||
this.moveto('wudao/men');
|
||||
this.notify("<hir>你的挑战失败了。</hir>");
|
||||
} else {
|
||||
this.hp = 1;
|
||||
this.notify("<hir>你的挑战失败了。</hir>");
|
||||
var npc = this.environment.find_by_path("pub/wudao");
|
||||
if (npc) {
|
||||
npc.end_fight();
|
||||
npc.full();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.on_die_boss = function (me) {
|
||||
me.notify("<hig>恭喜你战胜了" + this.name + "。</hig>");
|
||||
this.on_reward(me);
|
||||
const count = me.query_temp('wd_s', 0) + 99;
|
||||
const max = WORLD.DATA.query_temp("wudao_max", 0);
|
||||
if (count > max) {
|
||||
WORLD.DATA.set_temp("wudao_max", count);
|
||||
WORLD.DATA.set_temp("wudao_max_user", me.name);
|
||||
COMMAND.DO("rumor", "听说" + me.name + "战胜了" + this.name + "。");
|
||||
me.environment.parent.notify_update();
|
||||
}
|
||||
me.environment.item_changed(this, false, this.name + "离开了。");
|
||||
}
|
||||
this.on_die2 = function (me) {
|
||||
me.notify("<hig>恭喜你战胜了武道塔守护者,你现在可以进入下一层。</hig>");
|
||||
|
||||
USERTASK.GET('wudao').on_finish(me);
|
||||
const count = me.add_temp("wd_level", 1);
|
||||
me.notify("<hic>你挑战的最高纪录更新到" + count + "层。</hic>");
|
||||
const max = WORLD.DATA.query_temp("wudao_max", 0);
|
||||
if (count > max) {
|
||||
WORLD.DATA.set_temp("wudao_max", count);
|
||||
WORLD.DATA.set_temp("wudao_max_user", me.name);
|
||||
COMMAND.DO("rumor", "听说" + me.name + "战胜了武道塔" + UTIL.to_c(count) + "层的守护者。");
|
||||
|
||||
me.environment.parent.notify_update();
|
||||
if (count > 60) {
|
||||
let speed = me.add_temp('wd_lim', 1, 120000);
|
||||
if (speed >= 3) {
|
||||
me.is_busy = 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
me.environment.item_changed(this, false, this.name + "离开了。");
|
||||
me.environment.reward(me, count);
|
||||
|
||||
if (count === 1) {
|
||||
me.set_temp('wd_tm', Math.floor(Date.now() / 100000));
|
||||
me.send('\n<hic>你首次战胜了武道塔守护者,守门人视你为武道新星,每天可从任务栏领取奖励。</hic>');
|
||||
}
|
||||
|
||||
}
|
||||
this.reward = function (me, count) {
|
||||
if (count > 100) count = 100;
|
||||
var lv = 1000 + count * 100;
|
||||
me.add_exp(lv, lv);
|
||||
var items = [];
|
||||
|
||||
items.push({
|
||||
obj: ["book/bc#" + FAMILIES.NONE.query_skill(this.random(count / 20) + 1).id],
|
||||
odds: 2000
|
||||
});
|
||||
|
||||
items = OBJ.create_by_odds(items);
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
var item = me.add_obj(items[i]);
|
||||
count = items[i].count || 1;
|
||||
if (item) {
|
||||
me.send("你获得了" + UTIL.to_c(count) + item.unit + item.color_name + "。");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.reward3 = function (me, count) {
|
||||
|
||||
var items = [];
|
||||
if (count > 100) count = 100;
|
||||
|
||||
var lv = 10000 + count * 1000;
|
||||
me.add_exp(lv, lv);
|
||||
|
||||
items.push({
|
||||
obj: ["st/xuanjing"],
|
||||
count: 10
|
||||
});
|
||||
items.push({
|
||||
obj: ["st/st_gre#2", "st/st_red#2", "st/st_yel#2", "st/st_blu#2"]
|
||||
});
|
||||
|
||||
items = OBJ.create_by_odds(items);
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
var item = me.add_obj(items[i]);
|
||||
count = items[i].count || 1;
|
||||
if (item) {
|
||||
me.send("你获得了" + UTIL.to_c(count) + item.unit + item.color_name + "。");
|
||||
}
|
||||
}
|
||||
}
|
||||
this.on_leave = function (me, dir) {
|
||||
var level = me.query_temp("wd_level", 0) + 1;
|
||||
if (me.query_temp('wudao_o')) level = 100;
|
||||
var npc = this.find_by_path(level == 100 ? "pub/wudao_boss" : "pub/wudao");
|
||||
if (dir == "up") {
|
||||
if (npc) {
|
||||
// if (level < 100) {
|
||||
return me.notify_fail(npc.name + "对你说道:打败我,你就可以上去。");
|
||||
// }
|
||||
|
||||
// var ws = me.query_temp('wudao_s', 0);
|
||||
// var wd = me.query_temp('wd', 0);
|
||||
// if (!ws || !wd) return me.notify_fail(npc.name + "对你说道:打败我,你就可以上去。");
|
||||
|
||||
// if ((wd - ws > 0))
|
||||
// return me.notify_fail(npc.name + "对你说道:打败我,你就可以上去。");
|
||||
// else {
|
||||
// me.moveto('wudao/ding');
|
||||
// me.notify_fail(npc.name + "对你说道:你可以上去。");
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
if (this.items.length > 1) {
|
||||
let npcs = [];
|
||||
for (let item of this.items) {
|
||||
if (!item.is_player) {
|
||||
npcs.push(item);
|
||||
}
|
||||
}
|
||||
for (let item of npcs) {
|
||||
item.destroy();
|
||||
}
|
||||
}
|
||||
// if (level === 100) {
|
||||
// return me.notify_fail('暂未开放。');
|
||||
// }
|
||||
if (level >= 100) {
|
||||
me.moveto('wudao/ding');
|
||||
} else {
|
||||
me.moveto('wudao/ta');
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
if (npc) this.items.remove(npc);
|
||||
me.die = USER.prototype.die;
|
||||
}
|
||||
}
|
||||
94
world/map/wudao/ta2.js
Normal file
94
world/map/wudao/ta2.js
Normal file
@@ -0,0 +1,94 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "武道塔"
|
||||
this.desc = "这里是武道塔的内部,塔身已经石迹斑驳,但是仍然耸立挺拔。四周都是坚固的石壁,不知道什么原因留下一些横七竖八的刀刻剑痕,你想细看却觉得眼睛被刺得发疼。";
|
||||
this.exits = { "up": "wudao/up", "out": "wudao/ding" };
|
||||
this.max_item_count = 1;
|
||||
this.on_before_enter = function (me) {
|
||||
var level = (me.query_temp("wd_level", 0)) + 1 - 100;
|
||||
this.name = "上" + UTIL.to_c(level) + "层";
|
||||
if (level > 5) return
|
||||
var npc = NPC.CLONE("pub/wudao_boss");
|
||||
|
||||
npc.die = this.on_die_boss;
|
||||
npc.init_from(me, level);
|
||||
|
||||
npc.environment = this;
|
||||
this.items.length = 0;
|
||||
this.items.push(npc);
|
||||
this.refresh();
|
||||
}
|
||||
this.on_enter = function (me) {
|
||||
me.die = this.on_die1;
|
||||
let npc = this.items[0];
|
||||
if (npc && !npc.is_player) {
|
||||
// me.send(npc.name + ':这位' + me.call() + ",请了。");
|
||||
me.do_kill(npc);
|
||||
npc.on_kill(me);
|
||||
}
|
||||
}
|
||||
|
||||
this.on_die1 = function (me) {
|
||||
if (this.on_die && this.on_die(me) == false) {
|
||||
this.hp = 1;
|
||||
return false;
|
||||
}
|
||||
this.hp = this.max_hp;
|
||||
this.mp = this.max_mp;
|
||||
var npc = this.environment.find_by_path("pub/wudao");
|
||||
npc && npc.destroy();
|
||||
this.moveto('wudao/ding');
|
||||
this.notify("<hir>你的挑战失败了。</hir>");
|
||||
}
|
||||
|
||||
this.on_die_boss = function (me) {
|
||||
me.notify("<hig>恭喜你战胜了" + this.name + "。</hig>");
|
||||
let count = me.query_temp('wd_level', 0);
|
||||
if (count > 105) {
|
||||
//塔主
|
||||
return;
|
||||
}
|
||||
count = me.add_temp('wd_level', 1);
|
||||
|
||||
this.on_reward(me, count);//npc的
|
||||
const max = WORLD.DATA.query_temp("wudao_max", 0);
|
||||
if (count > max) {
|
||||
WORLD.DATA.set_temp("wudao_max", count);
|
||||
WORLD.DATA.set_temp("wudao_max_user", me.name);
|
||||
COMMAND.DO("rumor", "听说" + me.name + "战胜了" + this.name + "。");
|
||||
me.environment.parent.notify_update();
|
||||
}
|
||||
me.environment.item_changed(this, false, this.name + "离开了。");
|
||||
}
|
||||
this.on_reward = function (me, lv) {
|
||||
|
||||
}
|
||||
this.on_leave = function (me, dir) {
|
||||
|
||||
var npc = this.find_by_path("pub/wudao_boss");
|
||||
if (dir == "up") {
|
||||
if (npc) {
|
||||
return me.notify_fail(npc.name + "对你说道:打败我,你就可以上去。");
|
||||
}
|
||||
if (this.items.length > 1) {
|
||||
let npcs = [];
|
||||
for (let item of this.items) {
|
||||
if (!item.is_player) {
|
||||
npcs.push(item);
|
||||
}
|
||||
}
|
||||
for (let item of npcs) {
|
||||
item.destroy();
|
||||
}
|
||||
}
|
||||
if (me.query_temp('wd_level', 0) >= 105) {
|
||||
return me.notify_fail('暂未开放。');
|
||||
}
|
||||
me.moveto('wudao/ta2');
|
||||
|
||||
return false;
|
||||
} else {
|
||||
if (npc) this.items.remove(npc);
|
||||
me.die = USER.prototype.die;
|
||||
}
|
||||
}
|
||||
|
||||
6
world/map/wudao/up.js
Normal file
6
world/map/wudao/up.js
Normal file
@@ -0,0 +1,6 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "台阶"
|
||||
this.desc = "这里是武道塔的内部,塔身已经石迹斑驳,但是仍然耸立挺拔。四周都是坚固的石壁,不知道怎的留下一些横七竖八的刀刻剑痕,你想仔细看却觉得刺得眼睛发疼。";
|
||||
|
||||
this.max_item_count = 1;
|
||||
this.is_shadow = true;
|
||||
22
world/map/wudao/west.js
Normal file
22
world/map/wudao/west.js
Normal file
@@ -0,0 +1,22 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "白虎台"
|
||||
this.desc = "这里是武道塔顶部的东面平台,一座白虎的雕塑凭空而立,传说中的四大守护神兽之一。";
|
||||
this.exits = { "east": "wudao/ding" };
|
||||
this.max_item_count = 1;
|
||||
this.is_shadow = true;
|
||||
this.no_relive = true;
|
||||
// this.add_action('biguan', '聚魂', function (me) {
|
||||
// WORLD.COMMANDS['wsxl'].enter(me);
|
||||
// });
|
||||
this.on_enter = function (me) {
|
||||
let npc = NPC.CLONE('pub/wudao_ss');
|
||||
npc.init_from(me, 1);
|
||||
|
||||
this.item_changed(npc, true);
|
||||
npc.do_kill(me);
|
||||
}
|
||||
this.on_leave = function (me) {
|
||||
let npc = this.find_obj_bypath('pub/wudao_ss');
|
||||
if (npc) npc.destroy();
|
||||
me.remove_status('ss');
|
||||
}
|
||||
Reference in New Issue
Block a user