summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/042-3/jail.txt70
-rw-r--r--npc/functions/lockpicks.txt3
-rw-r--r--npc/functions/util.txt1
3 files changed, 70 insertions, 4 deletions
diff --git a/npc/042-3/jail.txt b/npc/042-3/jail.txt
index 23baed06a..da738121d 100644
--- a/npc/042-3/jail.txt
+++ b/npc/042-3/jail.txt
@@ -3,20 +3,84 @@
// Jesusalva
// Micksha
// Description:
-// Controls jails
-// Controls lockpicks
+// Controls jails and lockpicks
+// TODO: Spawn slime as players are warped, so they always have the chance
+// TODO: Stationary guards outside the cells (can be spawn with player)
+// We can set their speed to nil, after all. Make them all archers :3
042-3,0,0,0 script #KSlimeSpawn NPC_HIDDEN,{
end;
OnKillSlime:
+ .@label$=instance_npcname(.name$)+"::OnKillSlime";
if (@lockpicks)
end;
- if (rand2(10000) > 1000)
+ if (rand2(10000) > 1000) {
+ getmapxy(.@m$, .@x, .@y, 0);
+ .@mob=monster(.@m$, .@x, .@y, strmobinfo(1, CopperSlime), CopperSlime, .@label$);
+ // This should wipe the monster experience value
+ setunitdata(.@mob, UDT_LEVEL, BaseLevel);
end;
+ }
@lockpicks=true;
getitem Lockpicks, 1;
getitem TreasureKey, 1;
end;
+
+}
+
+// Lockpicks functions
+function script KamelotLockpick {
+ // Args: x, y. Needs player attached
+ .@x=getarg(0);
+ .@y=getarg(1);
+ mes l("A complex lock seems to be posing a threat to you.");
+ next;
+ mes l("But thanks to your %s skills, maybe you can pry this open.", thiefrank());
+ next;
+
+ .@s=LockPicking(3, 5, false);
+
+ // You broke free!
+ if (.@s) {
+ dispbottom l("You're finally free!");
+ slide .@x, .@y+1;
+ @lockpicks=true;
+ return;
+ }
+
+ // Give player a easy way to get lockpicks for this
+ // (Overrides original .@x/.@y variables)
+ if (!countitem(Lockpicks)) {
+ @lockpicks=false;
+ getmapxy(.@m$, .@x, .@y, 0);
+ .@mob=monster(.@m$, .@x, .@y, strmobinfo(1, CopperSlime), CopperSlime, .@label$);
+ // This should wipe the monster experience value
+ setunitdata(.@mob, UDT_LEVEL, BaseLevel);
+ }
+ return;
}
+// Cell Doors
+042-3,33,135,0 script Cell Door#K01 NPC_NO_SPRITE,{
+ KamelotLockpick(.x, .y);
+ close;
+OnInit:
+ .distance=1;
+ end;
+}
+
+// Duplication of doors
+042-3,84,127,0 duplicate(Cell Door#K01) Cell Door#K02 NPC_NO_SPRITE
+042-3,41,119,0 duplicate(Cell Door#K01) Cell Door#K03 NPC_NO_SPRITE
+042-3,74,107,0 duplicate(Cell Door#K01) Cell Door#K04 NPC_NO_SPRITE
+042-3,36,96,0 duplicate(Cell Door#K01) Cell Door#K05 NPC_NO_SPRITE
+042-3,57,84,0 duplicate(Cell Door#K01) Cell Door#K06 NPC_NO_SPRITE
+042-3,79,63,0 duplicate(Cell Door#K01) Cell Door#K07 NPC_NO_SPRITE
+042-3,43,67,0 duplicate(Cell Door#K01) Cell Door#K08 NPC_NO_SPRITE
+042-3,24,67,0 duplicate(Cell Door#K01) Cell Door#K09 NPC_NO_SPRITE
+042-3,86,22,0 duplicate(Cell Door#K01) Cell Door#K10 NPC_NO_SPRITE
+042-3,59,49,0 duplicate(Cell Door#K01) Cell Door#K11 NPC_NO_SPRITE
+042-3,38,27,0 duplicate(Cell Door#K01) Cell Door#K12 NPC_NO_SPRITE
+
+
diff --git a/npc/functions/lockpicks.txt b/npc/functions/lockpicks.txt
index ddb14cbd2..0933d0c35 100644
--- a/npc/functions/lockpicks.txt
+++ b/npc/functions/lockpicks.txt
@@ -114,7 +114,8 @@ function script LockPicking {
} while (true);
// Failed
- THIEF_EXP += 1;
+ if (THIEF_RANK)
+ THIEF_EXP += 1;
return 0;
}
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 5717c8600..76caaff6a 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -830,6 +830,7 @@ function script thiefrank {
case 3: return l("Rogue");
case 2: return l("Bandit");
case 1: return l("Thief");
+ case 0: return l("Citzen");
default: return l("Error");
}
}