diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-03-08 13:34:09 +0000 |
---|---|---|
committer | Micksha <ms-shaman@gmx.de> | 2019-03-08 13:34:09 +0000 |
commit | f53b74f2cf865b521c3e106a02869f230b8b0153 (patch) | |
tree | 49f78e4b6631d5111950be943fe6784a685e8f44 /npc | |
parent | eb19bdb1c12303d17923614bedc641e48ad5e02c (diff) | |
download | serverdata-f53b74f2cf865b521c3e106a02869f230b8b0153.tar.gz serverdata-f53b74f2cf865b521c3e106a02869f230b8b0153.tar.bz2 serverdata-f53b74f2cf865b521c3e106a02869f230b8b0153.tar.xz serverdata-f53b74f2cf865b521c3e106a02869f230b8b0153.zip |
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 ^.^
Diffstat (limited to 'npc')
-rw-r--r-- | npc/008-1/jack.txt | 2 | ||||
-rw-r--r-- | npc/008-2-6/alan.txt | 21 |
2 files changed, 20 insertions, 3 deletions
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; |