init: add workspace files
This commit is contained in:
106
world/npc/yz/hy/jiaotu.js
Normal file
106
world/npc/yz/hy/jiaotu.js
Normal file
@@ -0,0 +1,106 @@
|
||||
this.inherits(NPC);
|
||||
this.set({
|
||||
name: "黑鹰教徒",
|
||||
desc: "他们身穿黑袍,持长刀,动作整齐划一",
|
||||
gender: 1,
|
||||
age: 32,
|
||||
per: 22,
|
||||
mp: 1500,
|
||||
max_mp: 1500,
|
||||
hp: 1500,
|
||||
max_hp: 1500
|
||||
});
|
||||
this.no_refresh = true;
|
||||
this.on_heart_beat = function () {
|
||||
let exits = this.environment.move_exits;
|
||||
if (!exits || !exits.length) return;
|
||||
this.do_command('go', exits.random());
|
||||
for (let item of this.environment.items) {
|
||||
if (item.is_player) {
|
||||
this.send_room("$N喊道:这里有个小毛贼!");
|
||||
return this.do_kill(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.on_enter = function (me) {
|
||||
if (me.is_player && !this.fight_type) {
|
||||
this.send_room("$N喝道:" + me.call(true) + ",哪里来的小毛贼!");
|
||||
this.do_kill(me);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var DIE_MSG = ["\n$N扑在地上挣扎了几下,腿一伸,口中喷出几口<HIR>鲜血</HIR>,死了!\n",
|
||||
"\n$N大叫一声倒在地上,挣扎了几下,<HIR>死了</HIR>!\n",
|
||||
"\n$N口中喷出几口<HIR>鲜血</HIR>,倒在地上,死了!\n"];
|
||||
this.die = function (killer) {
|
||||
if (!this.environment) return;
|
||||
if (this.on_die && this.on_die(killer) == false) {
|
||||
this.hp = 1;
|
||||
return false;
|
||||
}
|
||||
this.hp = 0;
|
||||
this.clear_status();
|
||||
this.send_room(DIE_MSG.random());
|
||||
var corpse = new CORPSE();
|
||||
|
||||
var isinfb = this.environment.is_fb();
|
||||
corpse.init(this, isinfb);
|
||||
this.die_room = this.environment;
|
||||
this.environment.item_changed(corpse, true);
|
||||
this.environment.item_changed(this, false);
|
||||
// this.call_out(this.relive, 120000);
|
||||
this.on_died && this.on_died(killer, corpse);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.on_died = function (me, corpse) {
|
||||
let eny = this.enemy[0];
|
||||
if (eny && eny.hp > 0 && eny.environment === this.die_room) {
|
||||
let count = eny.query_temp('hy_ct', 0);
|
||||
if (count > 0) {
|
||||
eny.add_exp(0, 10000);
|
||||
eny.add_temp('hy_ct', -1);
|
||||
for (let item of corpse.items) {
|
||||
eny.send('你得到了' + item.unit_name() + "。");
|
||||
eny.add_obj(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
corpse.items = null;
|
||||
}
|
||||
const rooms = ['yz/hy/jiaochang1', 'yz/hy/jiaochang3',
|
||||
'yz/hy/jiaochang4', 'yz/hy/jiaochang5'];
|
||||
this.relive = function () {
|
||||
if (!this.die_room) return;
|
||||
var room = ROOM.Get(rooms.random());
|
||||
|
||||
obj = NPC.CLONE(this.path);
|
||||
room.item_changed(obj, true);
|
||||
this.die_room = null;
|
||||
this.equipment = null;
|
||||
this.items = null;
|
||||
this.skills = null;
|
||||
}
|
||||
this.skill_map(
|
||||
["unarmed", 150],
|
||||
["dodge", 150],
|
||||
["force", 150],
|
||||
["parry", 150],
|
||||
["blade", 150],
|
||||
["heilongxinfa", 150, "force"],
|
||||
["wuhuduanmendao", 150, "blade"]);
|
||||
this.set_objects(
|
||||
["eq/lv0/cloth", 1, 1],
|
||||
["eq/lv1/dandao", 1, 1]
|
||||
);
|
||||
|
||||
this.set_drop({
|
||||
obj: "st/xuanjing",
|
||||
min: 1,
|
||||
max: 3
|
||||
});
|
||||
78
world/npc/yz/hy/jiaoxi.js
Normal file
78
world/npc/yz/hy/jiaoxi.js
Normal file
@@ -0,0 +1,78 @@
|
||||
this.inherits(NPC);
|
||||
this.set({
|
||||
name: "黑鹰教习",
|
||||
desc: "他身穿黑袍,手持长刀",
|
||||
gender: 1,
|
||||
age: 32,
|
||||
per: 22,
|
||||
mp: 1500,
|
||||
max_mp: 1500,
|
||||
hp: 2500,
|
||||
max_hp: 2500
|
||||
});
|
||||
|
||||
|
||||
this.no_refresh = true;
|
||||
this.skill_map(
|
||||
["unarmed", 180],
|
||||
["dodge", 180],
|
||||
["force", 180],
|
||||
["parry", 180],
|
||||
["blade", 180],
|
||||
["heilongxinfa", 180, "force"],
|
||||
["wuhuduanmendao", 180, "blade"]);
|
||||
this.set_objects(
|
||||
["eq/lv0/cloth", 1, 1],
|
||||
["eq/lv1/dandao", 1, 1]
|
||||
);
|
||||
|
||||
|
||||
|
||||
this.on_kill = function (me) {
|
||||
if (!this.fight_type) {
|
||||
let rooms = ['yz/hy/jiaochang1', 'yz/hy/jiaochang3',
|
||||
'yz/hy/jiaochang4', 'yz/hy/jiaochang5'];
|
||||
this.send_room('$N大声喊道:小的们,来活了!');
|
||||
let list = [];
|
||||
for (let path of rooms) {
|
||||
let room = ROOM.Get(path);
|
||||
for (let item of room.items) {
|
||||
if (!item.fight_type && item.hp > 0 && item.is('yz/hy/jiaotu')) {
|
||||
list.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let item of list) {
|
||||
item.moveto(this.environment, item.name + '冲了过来。');
|
||||
item.do_kill(me);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
this.on_died = function (me, corpse) {
|
||||
let eny = this.enemy[0];
|
||||
if (eny && eny.hp > 0 && eny.environment === this.die_room) {
|
||||
|
||||
let count = eny.query_temp('hy_ct', 0);
|
||||
if (count > 0) {
|
||||
eny.add_exp(0, 10000);
|
||||
eny.add_temp('hy_ct', -1);
|
||||
for (let item of corpse.items) {
|
||||
eny.send('你得到了' + item.unit_name() + "。");
|
||||
eny.add_obj(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
corpse.items = null;
|
||||
}
|
||||
this.set_drop({
|
||||
obj: "st/xuanjing",
|
||||
min: 1,
|
||||
max: 3
|
||||
}, {
|
||||
obj: ['eq/lv1/xk_cloth',
|
||||
'eq/lv1/xk_head',
|
||||
'eq/lv1/xk_shoes'],
|
||||
odds: 3000
|
||||
});
|
||||
81
world/npc/yz/hy/tiehu.js
Normal file
81
world/npc/yz/hy/tiehu.js
Normal file
@@ -0,0 +1,81 @@
|
||||
this.inherits(NPC);
|
||||
this.set({
|
||||
name: "铁虎",
|
||||
title: "黑鹰队长",
|
||||
desc: "他身高近七尺,虎背熊腰,脸上一道从眉骨延伸至下颌的刀疤",
|
||||
gender: 1,
|
||||
age: 32,
|
||||
per: 22,
|
||||
mp: 2500,
|
||||
max_mp: 2500,
|
||||
hp: 3000,
|
||||
max_hp: 3000,
|
||||
prop: {
|
||||
gj: 50
|
||||
}
|
||||
});
|
||||
|
||||
this.no_refresh = true;
|
||||
|
||||
|
||||
this.on_kill = function (me) {
|
||||
if (!this.fight_type) {
|
||||
let rooms = ['yz/hy/jiaochang1', 'yz/hy/jiaochang3',
|
||||
'yz/hy/jiaochang4', 'yz/hy/jiaochang5'];
|
||||
this.send_room('$N道:不知死活!');
|
||||
let list = [];
|
||||
for (let path of rooms) {
|
||||
let room = ROOM.Get(path);
|
||||
for (let item of room.items) {
|
||||
if (item.hp > 0 && item.is('yz/hy/jiaotu')) {
|
||||
list.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let item of list) {
|
||||
item.moveto(this.environment, item.name + '冲了过来。');
|
||||
item.do_kill(me);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
this.on_died = function (me, corpse) {
|
||||
let eny = this.enemy[0];
|
||||
if (eny && eny.hp > 0 && eny.environment === this.die_room) {
|
||||
let count = eny.query_temp('hy_ct', 0);
|
||||
if (count > 0) {
|
||||
eny.add_exp(0, 10000);
|
||||
eny.add_temp('hy_ct', -1);
|
||||
for (let item of corpse.items) {
|
||||
eny.send('你得到了' + item.unit_name() + "。");
|
||||
eny.add_obj(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
corpse.items = null;
|
||||
}
|
||||
|
||||
|
||||
this.skill_map(
|
||||
["unarmed", 200],
|
||||
["dodge", 200],
|
||||
["force", 200],
|
||||
["parry", 200],
|
||||
["blade", 200],
|
||||
["feiyanzoubi", 200, "dodge"],
|
||||
["heilongxinfa", 200, "force"],
|
||||
["wuhuduanmendao", 200, "blade"]);
|
||||
this.set_objects(
|
||||
["eq/lv0/cloth", 1, 1],
|
||||
["eq/lv1/dandao", 1, 1]
|
||||
);
|
||||
|
||||
this.set_drop({
|
||||
obj: "st/xuanjing",
|
||||
min: 10,
|
||||
max: 30
|
||||
}, {
|
||||
obj: ["book/bc#wuhuduanmendao", "eq/lv1/dandao"],
|
||||
odds: 3000
|
||||
});
|
||||
82
world/npc/yz/hy/yin.js
Normal file
82
world/npc/yz/hy/yin.js
Normal file
@@ -0,0 +1,82 @@
|
||||
this.inherits(NPC);
|
||||
this.set({
|
||||
name: "尹小龙",
|
||||
desc: "他本是青木堂的堂主,被黑鹰队所擒",
|
||||
title: "青木堂堂主",
|
||||
gender: 1,
|
||||
age: 55,
|
||||
per: 22,
|
||||
mp: 400,
|
||||
max_mp: 400,
|
||||
hp: 1000,
|
||||
max_hp: 1000,
|
||||
score: 10
|
||||
});
|
||||
this.no_refresh = true;
|
||||
this.set_objects([
|
||||
"eq/lv0/cloth", 1, 1
|
||||
]);
|
||||
this.skill_map(
|
||||
["dodge", 200],
|
||||
["parry", 200],
|
||||
["force", 200],
|
||||
["unarmed", 200],
|
||||
["houquan", 200, "unarmed"],
|
||||
["yunlongshenfa", 200, "dodge"],
|
||||
["yunlongxinfa", 200, "force"]);
|
||||
|
||||
this.set_drop(
|
||||
{
|
||||
obj: ['eq/lv1/xk_cloth',
|
||||
'eq/lv1/xk_shoes'],
|
||||
odds: 5000
|
||||
}, {
|
||||
obj: [
|
||||
'eq/lv1/xk_head',
|
||||
'eq/lv1/qingmu'],
|
||||
odds: 500
|
||||
}
|
||||
);
|
||||
|
||||
this.on_enter = function (me) {
|
||||
if (me.is_player) {
|
||||
this.die();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.on_died = function (killer, corpse) {
|
||||
|
||||
if (killer)
|
||||
corpse.items = null;
|
||||
else {
|
||||
corpse.no_alloc = true;
|
||||
corpse.query_items = this.query_items;
|
||||
corpse.clear_items = this.clear_items;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.query_items = function (eny) {
|
||||
let items = this.items;
|
||||
if (!items || !items.length) return null;
|
||||
if (this.owner) {
|
||||
if (this.owner === eny.id)
|
||||
return items;
|
||||
return null;
|
||||
}
|
||||
let count = eny.query_temp('hy_ct', 0);
|
||||
if (count > 0) {
|
||||
this.owner = eny.id;
|
||||
return items;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
this.clear_items = function (eny) {
|
||||
this.items = null;
|
||||
if (this.owner && this.owner === eny.id && eny.query_temp('hy_ct', 0) > 0) {
|
||||
eny.add_exp(0, 10000);
|
||||
eny.add_temp('hy_ct', -1);
|
||||
this.owner = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user