mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-24 06:01:26 -05:00
NPC respawn logic
This commit is contained in:
+10
-1
@@ -12983,9 +12983,18 @@ function npc_loop() {
|
|||||||
for (var id in npcs) {
|
for (var id in npcs) {
|
||||||
var npc = npcs[id];
|
var npc = npcs[id];
|
||||||
var delay = -npc.delay * npc.d_multiplier;
|
var delay = -npc.delay * npc.d_multiplier;
|
||||||
if (npc.rip) {
|
if (npc.rip && Math.random() < 0.0005) {
|
||||||
|
delete npc.s.block;
|
||||||
|
npc.hp = npc.max_hp;
|
||||||
|
npc.mp = npc.max_mp;
|
||||||
|
npc.rip = false;
|
||||||
|
|
||||||
|
transport_player_to(npc, npc.map, 0, 1);
|
||||||
|
|
||||||
|
resend(npc, "u+cid");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (npc.rip) continue;
|
||||||
var def = G.npcs[npc.ntype] || {};
|
var def = G.npcs[npc.ntype] || {};
|
||||||
if (
|
if (
|
||||||
def &&
|
def &&
|
||||||
|
|||||||
Reference in New Issue
Block a user