From d689201d7b42d26948f5013b6985ec2c4e5beac3 Mon Sep 17 00:00:00 2001 From: panikon Date: Sat, 10 May 2014 15:46:32 -0300 Subject: Changed set_reg behavior on pc_setparam failure, now it won't simply END the script, if a dialog window is open it'll also CLOSE it. Corrected Zeny formula in THQS --- npc/custom/quests/thq/THQS_TTShop.txt | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'npc') diff --git a/npc/custom/quests/thq/THQS_TTShop.txt b/npc/custom/quests/thq/THQS_TTShop.txt index f25b09c7b..266a20cb5 100644 --- a/npc/custom/quests/thq/THQS_TTShop.txt +++ b/npc/custom/quests/thq/THQS_TTShop.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= Fredzilla //===== Current Version: ===================================== -//= 1.1 +//= 1.2a //===== Description: ========================================= //= Start for Treasure hunter quests //===== Additional Comments: ================================= @@ -13,6 +13,7 @@ //= 1.1 - balanced some prices, fixed 1 missing label //= removed Executioner&Mysteltain swords [Lupus] //= 1.2 - Optmized and fixed small error [Panikon] +//= 1.2a - Fixed zeny formula [Panikon] //============================================================ prt_in,159,172,0 warp thqwrp 3,3,yuno_in01,123,155 @@ -60,21 +61,30 @@ OnInit: // Trades tokens // getarg(0) - number of tokens to be traded function script thqs_trade_token { - .@type = getarg(0); - if( .@type == 4 ) + @type = getarg(0); + if( @type == 4 ) close; + + // 10^0, 10^1, 10^2 + @type -= 1; + @price = pow(10, @type); + // 10^3, 10^4, 10^5 - .@type += 2; // So we can use pow later to determine the qt of Zeny + @type += 3; // So we can use pow later to determine the qt of Zeny + @prize = pow(1000, @type); - if( #Treasure_Token < .@type ) { + if( #Treasure_Token < @price ) { mes "You don't have enough tokens!"; close; } - mes ".@type "+.@type; - - mes "pow(1000,.@type);" + pow(10,.@type); - #Treasure_Token -= .@type; - Zeny += pow(1000,.@type); + + if( Zeny == MAX_ZENY ) { + mes "You can't add more zeny to your character"; + close; + } + + Zeny += @prize; + #Treasure_Token -= @price; close; } -- cgit v1.2.3-60-g2f50