From 99a7d6266ff2f40a602df2355928b040d19ec632 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 18 May 2024 16:35:44 -0300 Subject: Botter's Syndrome: Allow other players to treat each other (not explained) --- npc/005-7/nurse.txt | 11 +++--- npc/026-7/boss.txt | 3 +- npc/functions/captcha.txt | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 5 deletions(-) diff --git a/npc/005-7/nurse.txt b/npc/005-7/nurse.txt index 4c27c5e78..1bd0c4303 100644 --- a/npc/005-7/nurse.txt +++ b/npc/005-7/nurse.txt @@ -51,22 +51,25 @@ L_Help: setq CandorQuest_Nurse, 1; close; } - if (getq(CandorQuest_Nurse) == 1) + else if (getq(CandorQuest_Nurse) == 1) { getexp 11,0; Zeny = Zeny + 100; setq CandorQuest_Nurse, 2; close; } - if (getq(CandorQuest_Nurse) == 2) + else if (getq(CandorQuest_Nurse) == 2) { getexp 6,0; Zeny = Zeny + 50; setq CandorQuest_Nurse, 3; close; } - getexp 5,0; - Zeny = Zeny + 25; + else + { + getexp 5,0; + Zeny = Zeny + 25; + } close; L_Heal: diff --git a/npc/026-7/boss.txt b/npc/026-7/boss.txt index 4832354b3..4e287b644 100644 --- a/npc/026-7/boss.txt +++ b/npc/026-7/boss.txt @@ -339,7 +339,8 @@ OnTimer10000: unittalk(.MK, "Death touch!"); maptimer2("026-7", 10, "Impregnable#B7F::OnDeathTouch"); .mana += 5; // Replenish the skill mana cost - .start_time = gettimetick(2) + 180 + 60; // This only happens once + // The next touch is in a minute, but in a Judgement Day, every 10s + .start_time = gettimetick(2) + 180 + 64 - ($@MK_CHALLENGE * 4); monster("026-7", 39, 34, "Summoned Reaper", Reaper, 1); } } diff --git a/npc/functions/captcha.txt b/npc/functions/captcha.txt index 3635ff67e..d7dc45aae 100644 --- a/npc/functions/captcha.txt +++ b/npc/functions/captcha.txt @@ -17,6 +17,7 @@ // 2 - Display warnings (@captcha_lastwarning/@captcha_lastwarningt) // 4 - Botter Syndrome enabled // 8 - Disable during events +// 16 - Allow players to treat each other // CaptchName, names the number function script CaptchName { @@ -133,11 +134,97 @@ OnCall: } end; +OnClinic: + // Syndrome disabled, ignore + if (!$CAPTCHA & 4) + end; + // Command disabled, ignore + if (!$CAPTCHA & 16) + end; + // You haven't learned how to treat anyone + if (getq(General_Narrator) < 1 && !getq(CandorQuest_Nurse)) + end; + // You cannot treat anyone + if (array_find($CAPTCHA_BLIST, getcharid(3)) >= 0) + end; + // Verify the target + .@request$ = ""; + .@request$ += implode(.@atcmd_parameters$, " "); + // TODO: Quest - Treat a NPC with Botter's Syndrome (Trainer?) + // Player is not attached or is yourself + .@id = getcharid(3, .@request$); + if (!.@id) { + Exception("Player not found.", RB_ISFATAL|RB_DISPBOTTOM); + } else if (.@id == getcharid(3)) { + Exception("You cannot treat yourself.", RB_ISFATAL|RB_DISPBOTTOM); + } + // You already treated someone recently + if (CHAREG_CLEANUP+300 > gettimetick(2)) + Exception(sprintf("You need to be online for longer than %d minute(s) to treat someone.", 5), RB_ISFATAL|RB_DISPBOTTOM); + if (@treatcaptcha+300 > gettimetick(2)) + Exception(sprintf("You need to wait %s before treat someone else again.", FuzzyTime(@treatcaptcha+300)), RB_ISFATAL|RB_DISPBOTTOM); + // Treatment confirmation + mes ".:: " + l("Treatment") + " ::."; + mes l("Botter Syndrome is a common ailment which, while it mostly affect bots, even regular adventurers and NPCs may contract."); + mes l("If you believe \"%s\" is ##Bnot##b botting, then you may treat them yourself."); + mes ""; + mes l("- Treating a nearby player will almost always succeed."); + mes l("- Treating a player in the same map has <70%% chance of succeeding."); + mes l("- Treating a player in another map has <30%% chance of succeeding."); + mes l("- Treating a bot may result in the Alliance confiscating your treatment kit."); + mes l("- Treating yourself via an alt may also result in a %s for one of your accounts.", b(l("permanent ban"))); + mes ""; + mes l("It takes %d minute(s) to treat someone else after this.", 5); + next; + mesc ("Do you want to treat \"%s\"?", b(.@request$)), 1; + if (askyesno() == ASK_NO) { + closeclientdialog; + end; + } + // Regardless of whatever happens now, the treatment was attempted + .@m1$ = getmap(); + .@caster = getcharid(3); + .@chance = 30; + .@benef$ = strcharinfo(0); + @treatcaptcha = gettimetick(2); + closeclientdialog; + // Attach the one you intend to heal + if (attachplayer(.@id)) { + // Not infected, so do nothing + if (!getstatus(SC_BOTTER_SYNDROME)) + end; + // Same map check + getmapxy(.@m$, .@x, .@y, 0); + if (.@m$ == .@m1$) { + .@chance = 70; + // Check if caster and treated are visible + .@c=getunits(BL_PC, .@pcs, MAX_CYCLE_PC, .@m$, .@x-14, .@y-14, .@x+14, .@y+14); + for (.@i = 0; .@i < .@c; .@i++) { + if (.@pcs[.@i] == .@caster) { + .@chance = 100; + break; + } // Caster loop + } // for loop + } // Map loop + // The chance is further modified by how intense the syndrome is + // Every 5% effect steals 1% of treatment chance + .@chance -= limit(0, getstatus(SC_BOTTER_SYNDROME, 1) / 5, 25); + // Now we have .@chance, so decide if treatment worked + if (rand2(100) < .@chance) { + sc_end SC_BOTTER_SYNDROME; + dispbottom l("Your %s was treated by %s.", b(l("Botter's Syndrome")),.@benef$); + } else { + dispbottom l("%s tried to treat your syndrome, but was NOT successful.", .@benef$); + } + } // attachplayer() + end; + OnInit: .thr=180; // Seconds to reply .cooldown=3600; // Captcha Immunity .antiflood=18; // Seconds between captcha failed attempts bindatcmd "captcha", "@captcha::OnCall", 0, 0, 0; + bindatcmd "treat", "@captcha::OnClinic", 0, 0, 0; initnpctimer; end; -- cgit v1.2.3-70-g09d2