summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-04-29 02:14:28 -0300
committerJesusaves <cpntb1@ymail.com>2020-04-29 02:14:28 -0300
commit3cb0c75f14291646fe5b770c1b01dcb858cdac47 (patch)
tree17034a5a7af255be38fa58d2b7348ba58460c135
parentde4a0b24b19c8d1e1782298579fa47471ff380e1 (diff)
downloadserverdata-3cb0c75f14291646fe5b770c1b01dcb858cdac47.tar.gz
serverdata-3cb0c75f14291646fe5b770c1b01dcb858cdac47.tar.bz2
serverdata-3cb0c75f14291646fe5b770c1b01dcb858cdac47.tar.xz
serverdata-3cb0c75f14291646fe5b770c1b01dcb858cdac47.zip
Kamelot Cells can now be open from outside (per Micksha's request)
-rw-r--r--npc/042-3/jail.txt20
-rw-r--r--npc/functions/captcha.txt9
2 files changed, 20 insertions, 9 deletions
diff --git a/npc/042-3/jail.txt b/npc/042-3/jail.txt
index 7e3a1f5b9..70df69b95 100644
--- a/npc/042-3/jail.txt
+++ b/npc/042-3/jail.txt
@@ -27,14 +27,14 @@ OnKillSlime:
getitem Lockpicks, 1;
getitem TreasureKey, 1;
end;
-
}
// Lockpicks functions
function script KamelotLockpick {
- // Args: x, y. Needs player attached
+ // Args: x, y, name. Needs player attached
.@x=getarg(0);
.@y=getarg(1);
+ .@name$=getarg(2);
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());
@@ -44,9 +44,9 @@ function script KamelotLockpick {
// You broke free!
if (.@s) {
- dispbottom l("You're finally free!");
- slide .@x, .@y+1;
- @lockpicks=true;
+ .@label$=instance_npcname(.@name$)+"::OnKamelotSlide";
+ addtimer 10, .@label$;
+ areatimer getmap(), .@x-1, .@y-1, .@x+1, .@y, 10, .@label$;
return;
}
mes l("What's this dark magic, the password has changed!");
@@ -66,12 +66,20 @@ function script KamelotLockpick {
// Cell Doors
042-3,33,137,0 script Cell Door#K01 NPC_NO_SPRITE,{
- KamelotLockpick(.x, .y);
+ KamelotLockpick(.x, .y, .name$);
close;
OnInit:
OnInstanceInit:
.distance=2;
end;
+
+OnKamelotSlide:
+ .@label$=instance_npcname(.name$)+"::OnKamelotSlide";
+ deltimer .@label$;
+ dispbottom l("You're finally free!");
+ slide .x, .y+1;
+ @lockpicks=true;
+ end;
}
// Duplication of doors
diff --git a/npc/functions/captcha.txt b/npc/functions/captcha.txt
index cab6f869e..9b69ad422 100644
--- a/npc/functions/captcha.txt
+++ b/npc/functions/captcha.txt
@@ -46,6 +46,7 @@ function script CaptchName {
// MakeCaptch, makes a captcha and saves it
function script MakeCaptch {
CAPTCHA_TIME=gettimetick(2);
+ CAPTCHA_OK=CAPTCHA_TIME;
CAPTCHA_1=rand2(21);
CAPTCHA_2=rand2(20);
// select a operation
@@ -136,14 +137,14 @@ OnInit:
// Pick a random target for captcha checks
OnTimer5000:
- if ($@BOTCHECK_TARGET) captchaProbe();
-
// Script disabled by admins
if (!$CAPTCHA) {
initnpctimer;
end;
}
+ if ($@BOTCHECK_TARGET) captchaProbe();
+
// Maybe we will conduct a captcha
if (rand2(10) < 3) {
// This can be slow, beware
@@ -156,6 +157,8 @@ OnTimer5000:
// Okay, lets do it
attachrid(.@players[.@i]);
+ // TODO: What about jailed players?
+
// 1. Player in immunity, who is next one
if (CAPTCHA_OK > gettimetick(2)) {
detachrid();
@@ -226,7 +229,7 @@ function captchaProbe {
}
// Timer expired? Ban hammer
- if (CAPTCHA_TIME+.thr > gettimetick(2)) {
+ if (CAPTCHA_TIME+.thr > gettimetick(2) && CAPTCHA_OK <= CAPTCHA_TIME) {
atcommand("@jailfor 30mn "+strcharinfo(0));
dispbottom l("You failed to reply captcha in time and was arrested for AFK Botting. You can use @jailtime to keep track of time left.");
CaptchExample(true);