From 285c3820a753982afc30e20286565e74be9b3008 Mon Sep 17 00:00:00 2001 From: brianluau Date: Tue, 24 May 2011 07:59:43 +0000 Subject: - Fixed a possible exploit in guild castle investment. (bugreport:4929, topic:272783) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14833 54d463be-8e91-2dee-dedb-b68131a5f0ec --- npc/guild/agit_template.txt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'npc/guild') diff --git a/npc/guild/agit_template.txt b/npc/guild/agit_template.txt index f43536978..68e9e7f3a 100644 --- a/npc/guild/agit_template.txt +++ b/npc/guild/agit_template.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= L0ne_W0lf //===== Current Version: ===================================== -//= 1.7 +//= 1.8 //===== Compatible With: ===================================== //= eAthena SVN //===== Description: ========================================= @@ -49,6 +49,7 @@ //= 1.6b Moved where investments are added to eco/def. [L0ne_W0lf] //= 1.7 Updated Agitbreak announcements, added bc_woe [L0ne_W0lf] //= and added extended anouncement format for mapannounce. +//= 1.8 Fixed a possible exploit in guild castle investment. [Brian] //============================================================ // AGIT Manager Template @@ -525,7 +526,7 @@ OnRecvCastle: mes "^ff0000But the commercial growth level of our castle is peaked at 100%. It doesn't need any more investment. As I expected you have a great acumen, Master.^000000"; close; } - if (GetCastleData(strnpcinfo(2),4) == 2) { + if (GetCastleData(strnpcinfo(2),4) >= 2) { mes "^ff0000But you already invested twice today so you cannot invest any more.^000000 I expect our riches to increase in growth level."; close; } @@ -538,6 +539,11 @@ OnRecvCastle: next; switch(select("Invest in commercial growth:Cancel")) { case 1: + if (GetCastleData(strnpcinfo(2),4) >= 2) { + mes "[ Steward " + .@name$ + " ]"; + mes "I'm sorry but you already invested twice today so you cannot invest any more."; + close; + } if (Zeny < .@eco_invest) { mes "[ Steward " + .@name$ + " ]"; mes "I'm sorry but there is not enough zeny to invest. You will have to try again when you have the funds, Master."; @@ -588,7 +594,7 @@ OnRecvCastle: mes "^ff0000But the safeguard level of our castle is peaked at 100%. It doesn't need any more investment. As I expected you have a great acumen, Master.^000000"; close; } - if (GetCastleData(strnpcinfo(2),5) == 2) { + if (GetCastleData(strnpcinfo(2),5) >= 2) { mes "^ff0000But you already invested twice today so you cannot invest any more.^000000 I expect our riches to increase in growth level."; close; } @@ -601,6 +607,11 @@ OnRecvCastle: next; switch(select("Invest in safeguard.:Cancel")) { case 1: + if (GetCastleData(strnpcinfo(2),5) >= 2) { + mes "[ Steward " + .@name$ + " ]"; + mes "I'm sorry but you already invested twice today so you cannot invest any more."; + close; + } if (Zeny < .@def_invest) { mes "[ Steward " + .@name$ + " ]"; mes "I'm sorry but there is not enough zeny to invest. You will have to try again when you have the funds, Master."; -- cgit v1.2.3-60-g2f50