From f31d7da364634813374d0ab7cbba660aeef897e5 Mon Sep 17 00:00:00 2001
From: Juris <jurchiks101@gmail.com>
Date: Thu, 25 Dec 2014 00:19:13 +0200
Subject: [PATCH] Fix for
 http://www.l2jserver.com/forum/viewtopic.php?f=77&t=30681 The error occurs
 because Q211 and Q212 save the value as boolean, while all other quests store
 it as integer.

---
 .../Q00211_TrialOfTheChallenger.java                      | 8 ++++----
 .../quests/Q00212_TrialOfDuty/Q00212_TrialOfDuty.java     | 4 ++--
 L2J_DataPack/dist/sql/game/updates/20141224update.sql     | 1 +
 3 files changed, 7 insertions(+), 6 deletions(-)
 create mode 100644 L2J_DataPack/dist/sql/game/updates/20141224update.sql

diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00211_TrialOfTheChallenger/Q00211_TrialOfTheChallenger.java b/L2J_DataPack/dist/game/data/scripts/quests/Q00211_TrialOfTheChallenger/Q00211_TrialOfTheChallenger.java
index f878b10104..4038e39b11 100644
--- a/L2J_DataPack/dist/game/data/scripts/quests/Q00211_TrialOfTheChallenger/Q00211_TrialOfTheChallenger.java
+++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00211_TrialOfTheChallenger/Q00211_TrialOfTheChallenger.java
@@ -111,10 +111,10 @@ public final class Q00211_TrialOfTheChallenger extends Quest
 				if (qs.isCreated())
 				{
 					final PlayerVariables vars = player.getVariables();
-					if (!vars.getBoolean("2ND_CLASS_DIAMOND_REWARD", false))
+					if (vars.getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
 					{
 						giveItems(player, DIMENSIONAL_DIAMONDS);
-						vars.set("2ND_CLASS_DIAMOND_REWARD", true);
+						vars.set("2ND_CLASS_DIAMOND_REWARD", 1);
 						htmltext = event;
 					}
 					else
@@ -339,10 +339,10 @@ public final class Q00211_TrialOfTheChallenger extends Quest
 						
 						// redundant retail check - already rewarded at beginning of quest
 						final PlayerVariables vars = talker.getVariables();
-						if (!vars.getBoolean("2ND_CLASS_DIAMOND_REWARD", false))
+						if (vars.getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
 						{
 							giveItems(talker, DIMENSIONAL_DIAMONDS);
-							vars.set("2ND_CLASS_DIAMOND_REWARD", true);
+							vars.set("2ND_CLASS_DIAMOND_REWARD", 1);
 						}
 						
 						talker.sendPacket(new SocialAction(talker.getObjectId(), 3));
diff --git a/L2J_DataPack/dist/game/data/scripts/quests/Q00212_TrialOfDuty/Q00212_TrialOfDuty.java b/L2J_DataPack/dist/game/data/scripts/quests/Q00212_TrialOfDuty/Q00212_TrialOfDuty.java
index 8f9b442e17..b5a0b58d87 100644
--- a/L2J_DataPack/dist/game/data/scripts/quests/Q00212_TrialOfDuty/Q00212_TrialOfDuty.java
+++ b/L2J_DataPack/dist/game/data/scripts/quests/Q00212_TrialOfDuty/Q00212_TrialOfDuty.java
@@ -570,7 +570,7 @@ public final class Q00212_TrialOfDuty extends Quest
 	{
 		final PlayerVariables vars = player.getVariables();
 		
-		if (!vars.getBoolean("2ND_CLASS_DIAMOND_REWARD", false))
+		if (vars.getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
 		{
 			if (player.getClassId() == ClassId.knight)
 			{
@@ -581,7 +581,7 @@ public final class Q00212_TrialOfDuty extends Quest
 				rewardItems(player, DIMENSIONAL_DIAMOND, 61);
 			}
 			
-			vars.set("2ND_CLASS_DIAMOND_REWARD", true);
+			vars.set("2ND_CLASS_DIAMOND_REWARD", 1);
 			return true;
 		}
 		return false;
diff --git a/L2J_DataPack/dist/sql/game/updates/20141224update.sql b/L2J_DataPack/dist/sql/game/updates/20141224update.sql
new file mode 100644
index 0000000000..7a591cea80
--- /dev/null
+++ b/L2J_DataPack/dist/sql/game/updates/20141224update.sql
@@ -0,0 +1 @@
+UPDATE `character_quests` SET `value` = '1' WHERE `var` = '2ND_CLASS_DIAMOND_REWARD' AND `value` = 'true';
\ No newline at end of file
-- 
GitLab