From f53b74f2cf865b521c3e106a02869f230b8b0153 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 8 Mar 2019 13:34:09 +0000 Subject: Make Alan's Wood Breaking pseudo-random. This means you have a fixed amount of fails, and likewise, you cannot fail more than a certain amount of times. These values are min 10 fails and max 30 fails per @Micksha request. They can be tweaked at will. The code behind fake radomness is fairly simple ^.^ --- npc/008-1/jack.txt | 2 +- npc/008-2-6/alan.txt | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'npc') diff --git a/npc/008-1/jack.txt b/npc/008-1/jack.txt index d8f1ff2d..de71c2e5 100644 --- a/npc/008-1/jack.txt +++ b/npc/008-1/jack.txt @@ -9,7 +9,7 @@ // [1] 4 - alan asks to find wood // [1] 5 - found perfect wood // [1] 6 - got the bow -// [2] unused +// [2] fail count // [3] unused // [t] unused // Quest states (wooden shield): diff --git a/npc/008-2-6/alan.txt b/npc/008-2-6/alan.txt index 35d75437..92262ebf 100644 --- a/npc/008-2-6/alan.txt +++ b/npc/008-2-6/alan.txt @@ -1,8 +1,20 @@ // Evol scripts. // Author: +// Jesusalva // Micksha // Description: // Alan the bow-maker. +// Quest states (forest bow): +// [1] 0 - cannot do the quest +// [1] 1 - can do the quest +// [1] 2 - alan wants to ask jack +// [1] 3 - jack explained problem +// [1] 4 - alan asks to find wood +// [1] 5 - found perfect wood +// [1] 6 - got the bow +// [2] fail count +// [3] unused +// [t] unused 008-2-6,31,26,0 script Alan NPC_YOUNG_MAN_KFAHR,{ @@ -190,7 +202,8 @@ narrator(4, l("Alan bends the log over his knee.")); - if (rand(.success_rate) == 0) + .@fails=getq2(.quest_bow); + if (rand(.minfail, .maxfail) - .@fails <= 0) { narrator(4 | 8, l("Alan tries as hard as he can but the log won't bend.")); @@ -210,6 +223,7 @@ bow_make; end; } + setq2(.quest_bow, .@fails+1); narrator(4 | 8, l("The log breaks with a loud crack.")); @@ -282,7 +296,10 @@ OnInit: .req_esp = 10000; // amount of Esperin required to make the bow .reward_item = ForestBow; // quest reward (item) .reward_exp = 500; // quest reward (exp) - .success_rate = 20; // one in X chances to get a perfect log + + // one in X chances to get a perfect log + .minfail = 10; + .maxfail = 30; .quest_bow = HurnscaldQuests_ForestBow; .quest_shield = HurnscaldQuests_WoodenShield; -- cgit v1.2.3-70-g09d2