From ce3196b12299cc11e062b388680b5240ca0aa2c2 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 15 Jun 2018 14:03:33 -0300 Subject: NPC -> Global var: Coins Rate. Fix a bug. --- npc/001-1/eventmaster.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'npc') diff --git a/npc/001-1/eventmaster.txt b/npc/001-1/eventmaster.txt index 6d55c10dd..324d0a87b 100644 --- a/npc/001-1/eventmaster.txt +++ b/npc/001-1/eventmaster.txt @@ -12,7 +12,7 @@ if (!is_gm()) goto L_Unauthorized; @log_spawns=0; - @log_ratio=.coins_rate; + @log_ratio=$coinsrate; mesn; mes "Tired of walking the whole Aeros to spawn monsters, I was brought to existence."; @@ -33,7 +33,7 @@ L_Unauthorized: L_Close: if (@log_spawns > 0) logmes "spawned "+str(@log_spawns)+" beigns at Aeros.", LOGMES_ATCOMMAND; - if (@log_ratio != .coins_rate) logmes "set aeros ratio from "+str(@log_ratio)+" to "+str(.coins_rate), LOGMES_ATCOMMAND; + if (@log_ratio != $coinsrate) logmes "set aeros ratio from "+str(@log_ratio)+" to "+str($coinsrate), LOGMES_ATCOMMAND; close; L_Spawn: @@ -234,11 +234,11 @@ L_Drop: L_Rate: mes ""; - mes "Current drop rate: " + str(.coins_rate); + mes "Current drop rate: " + str($coinsrate); mes "Insert drop rate (from 0 to 10000, capped at 5000 or 50%). Use -1 to disable."; - input .coins_rate; - if (.coins_rate > 5000) - .coins_rate=5000; + input $coinsrate; + if ($coinsrate > 5000) + $coinsrate=5000; mes ""; mes "Ratio adjusted."; next; @@ -256,16 +256,17 @@ L_EventHandler: close; OnAerosMobDeath: - if (.coinsrate < 0) end; + if ($coinsrate < 0) end; // A level 100 monster can have a 4% drop bonus against a level 0 monster. - // .coins_rate acts stablishing a basic drop value. Advised value: 600 (up to 10% for normal mobs) - if (rand(10000) <= .coins_rate + (atoi(strmobinfo(3,killedrid))*4)) + // $coinsrate acts stablishing a basic drop value. Advised value: 600 (up to 10% for normal mobs) + if (rand(10000) <= $coinsrate + (atoi(strmobinfo(3,killedrid))*4)) getmapxy(.@m$, .@x, .@y, 0); makeitem(StrangeCoin, 1, .@m$, .@x, .@y); end; OnInit: - .coins_rate=600; // Default value is 6% + mob str bonus + if ($coinsrate == 0) + $coinsrate=600; // Default value is 6% + mob str bonus end; } -- cgit v1.2.3-70-g09d2