summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrazyfefe <admin@tmw2.org>2018-03-09 14:58:23 -0300
committerjesusalva <cpntb1@ymail.com>2018-03-09 14:58:23 -0300
commit9cc22523194b78f0f1edc1f56c5a4f12cba1357e (patch)
tree99c065d10b102a27a3afa9f35be227c013816700
parent3cd809ba8c267d88388375b24780a17ebca0e27e (diff)
downloadserverdata-9cc22523194b78f0f1edc1f56c5a4f12cba1357e.tar.gz
serverdata-9cc22523194b78f0f1edc1f56c5a4f12cba1357e.tar.bz2
serverdata-9cc22523194b78f0f1edc1f56c5a4f12cba1357e.tar.xz
serverdata-9cc22523194b78f0f1edc1f56c5a4f12cba1357e.zip
-rw-r--r--npc/003-1/ishi.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/npc/003-1/ishi.txt b/npc/003-1/ishi.txt
index 7d63c04e7..dd2127010 100644
--- a/npc/003-1/ishi.txt
+++ b/npc/003-1/ishi.txt
@@ -4,8 +4,7 @@
// Jesusalva
//
// Do not add void items to array.
-// note : the rare item system suck. Must be ordered from less rare to most rare.
-// TODO FIXME: Not reading properly from @Rares$ array, no idea how to fix that!
+// note : the rare item system suck.
003-1,97,97,0 script Ishi NPC_PLAYER,{
@@ -29,7 +28,7 @@
"Coal","SnakeSkin","CottonCloth","GrassSeeds","HardSpike","CobaltHerb","GambogeHerb",
"MauveHerb","IronOre","MaggotSlime","RawLog","ScorpionStinger","SilkCocoon","TreasureKey",
"FluffyFur","EmptyBottle","RustyKnife","TolchiArrow","Arrow","IronArrow","BlueCottonDye";
- setarray @Rares$, "BronzeGift", 120, "IronIngot", 70, "BrimedHat", 40;
+ setarray @Rares$, "BrimedHat", 5, "IronIngot", 10, "BronzeGift", 10;
mesn l("Ishi, the Rewards Master");
mesq l("Welcome! I see you have @@ Monster Points. Would you like to exchange some of those for items?", Mobpt);
@@ -122,14 +121,18 @@ L_Items:
goto L_NoPlace;
debugmes "Testing rares";
+ @lucky = rand(10000) + 1;
for (.@b = 0; .@b < getarraysize(@Rares$); .@b=.@b+2) {
- .@lucky = rand(10000); // 0 - 99999
debugmes "Checking "+@Rares$[.@b]+" - b is now "+.@b;
- debugmes l("Check @@ <= @@", .@lucky, @Rares$[.@b+1]);
- if (.@lucky <= atoi(@Rares$[.@b+1])) {
+ debugmes l("Check @@ <= @@", @lucky, @Rares$[.@b+1]);
+ if (.@b == 0)
+ @control = 0;
+ if(@lucky >= (@control + 1) && @lucky <= @control + atoi(@Rares$[.@b+1]))
+ {
.@lucked=1;
.@reward$ = @Rares$[.@b];
}
+ @control = @control + atoi(@Rares$[.@b+1]);
}
debugmes "Setting reward"; // could be if (!.@lucked) but for sanity...