Adjustments and fixes for the new player reward system.

Contributed by altronrain.
This commit is contained in:
MobiusDevelopment
2022-06-30 21:51:59 +00:00
parent 8ea779a767
commit 915bb9e455
30 changed files with 244 additions and 66 deletions

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q101_SwordOfSolidarity extends Quest public class Q101_SwordOfSolidarity extends Quest
@@ -86,18 +87,22 @@ public class Q101_SwordOfSolidarity extends Quest
st.takeItems(BROKEN_SWORD_HANDLE, 1); st.takeItems(BROKEN_SWORD_HANDLE, 1);
st.giveItems(SWORD_OF_SOLIDARITY, 1); st.giveItems(SWORD_OF_SOLIDARITY, 1);
st.giveItems(LESSER_HEALING_POT, 100); st.giveItems(LESSER_HEALING_POT, 100);
if (player.isNewbie()) // Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
st.giveItems(ECHO_BATTLE, 10); st.giveItems(ECHO_BATTLE, 10);

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q102_SeaOfSporesFever extends Quest public class Q102_SeaOfSporesFever extends Quest
@@ -54,6 +55,9 @@ public class Q102_SeaOfSporesFever extends Quest
private static final int ECHO_SOLITUDE = 4414; private static final int ECHO_SOLITUDE = 4414;
private static final int ECHO_FEAST = 4415; private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416; private static final int ECHO_CELEBRATION = 4416;
// Newbie Rewards
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
public Q102_SeaOfSporesFever() public Q102_SeaOfSporesFever()
{ {
@@ -155,6 +159,25 @@ public class Q102_SeaOfSporesFever extends Quest
st.rewardItems(SOULSHOT_NO_GRADE, 1000); st.rewardItems(SOULSHOT_NO_GRADE, 1000);
} }
// Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{
st.showQuestionMark(26);
if (player.isMageClass())
{
st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
}
else
{
st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
}
}
st.giveItems(LESSER_HEALING_POT, 100); st.giveItems(LESSER_HEALING_POT, 100);
st.giveItems(ECHO_BATTLE, 10); st.giveItems(ECHO_BATTLE, 10);
st.giveItems(ECHO_LOVE, 10); st.giveItems(ECHO_LOVE, 10);

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q103_SpiritOfCraftsman extends Quest public class Q103_SpiritOfCraftsman extends Quest
@@ -134,19 +135,22 @@ public class Q103_SpiritOfCraftsman extends Quest
{ {
st.giveItems(SOULSHOT_NO_GRADE, 1000); st.giveItems(SOULSHOT_NO_GRADE, 1000);
} }
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }

View File

@@ -23,6 +23,7 @@ import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q104_SpiritOfMirrors extends Quest public class Q104_SpiritOfMirrors extends Quest
@@ -139,19 +140,22 @@ public class Q104_SpiritOfMirrors extends Quest
{ {
st.giveItems(SOULSHOT_NO_GRADE, 1000); st.giveItems(SOULSHOT_NO_GRADE, 1000);
} }
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q105_SkirmishWithTheOrcs extends Quest public class Q105_SkirmishWithTheOrcs extends Quest
@@ -51,6 +52,7 @@ public class Q105_SkirmishWithTheOrcs extends Quest
private static final int SOULSHOT_FOR_BEGINNERS = 5789; private static final int SOULSHOT_FOR_BEGINNERS = 5789;
private static final int RED_SUNSET_STAFF = 754; private static final int RED_SUNSET_STAFF = 754;
private static final int RED_SUNSET_SWORD = 981; private static final int RED_SUNSET_SWORD = 981;
private static final int LESSER_HEALING_POT = 1060;
private static final int ECHO_BATTLE = 4412; private static final int ECHO_BATTLE = 4412;
private static final int ECHO_LOVE = 4413; private static final int ECHO_LOVE = 4413;
private static final int ECHO_SOLITUDE = 4414; private static final int ECHO_SOLITUDE = 4414;
@@ -153,22 +155,26 @@ public class Q105_SkirmishWithTheOrcs extends Quest
{ {
st.giveItems(RED_SUNSET_SWORD, 1); st.giveItems(RED_SUNSET_SWORD, 1);
} }
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
st.rewardItems(LESSER_HEALING_POT, 100);
st.giveItems(ECHO_BATTLE, 10); st.giveItems(ECHO_BATTLE, 10);
st.giveItems(ECHO_LOVE, 10); st.giveItems(ECHO_LOVE, 10);
st.giveItems(ECHO_SOLITUDE, 10); st.giveItems(ECHO_SOLITUDE, 10);

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q106_ForgottenTruth extends Quest public class Q106_ForgottenTruth extends Quest
@@ -138,19 +139,22 @@ public class Q106_ForgottenTruth extends Quest
{ {
st.giveItems(SOULSHOT_NO_GRADE, 1000); st.giveItems(SOULSHOT_NO_GRADE, 1000);
} }
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q107_MercilessPunishment extends Quest public class Q107_MercilessPunishment extends Quest
@@ -38,7 +39,6 @@ public class Q107_MercilessPunishment extends Quest
private static final int LETTER_TO_ELF = 1558; private static final int LETTER_TO_ELF = 1558;
// Rewards // Rewards
private static final int BUTCHER_SWORD = 1510; private static final int BUTCHER_SWORD = 1510;
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789; private static final int SOULSHOT_FOR_BEGINNERS = 5789;
private static final int ECHO_BATTLE = 4412; private static final int ECHO_BATTLE = 4412;
private static final int ECHO_LOVE = 4413; private static final int ECHO_LOVE = 4413;
@@ -162,20 +162,14 @@ public class Q107_MercilessPunishment extends Quest
st.giveItems(BUTCHER_SWORD, 1); st.giveItems(BUTCHER_SWORD, 1);
st.giveItems(LESSER_HEALING_POTION, 100); st.giveItems(LESSER_HEALING_POTION, 100);
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass())
{
st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
}
else
{
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
} player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
st.giveItems(ECHO_BATTLE, 10); st.giveItems(ECHO_BATTLE, 10);

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q108_JumbleTumbleDiamondFuss extends Quest public class Q108_JumbleTumbleDiamondFuss extends Quest
@@ -184,19 +185,22 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
st.takeItems(STAR_DIAMOND, -1); st.takeItems(STAR_DIAMOND, -1);
st.giveItems(SILVERSMITH_HAMMER, 1); st.giveItems(SILVERSMITH_HAMMER, 1);
st.giveItems(LESSER_HEALING_POTION, 100); st.giveItems(LESSER_HEALING_POTION, 100);
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }

View File

@@ -16,11 +16,13 @@
*/ */
package quests.Q257_TheGuardIsBusy; package quests.Q257_TheGuardIsBusy;
import org.l2jmobius.gameserver.enums.Race;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q257_TheGuardIsBusy extends Quest public class Q257_TheGuardIsBusy extends Quest
{ {
@@ -109,21 +111,24 @@ public class Q257_TheGuardIsBusy extends Quest
} }
st.rewardItems(57, reward); st.rewardItems(57, reward);
// Give newbie reward if player is eligible
if (player.isNewbie() && (st.getInt("Reward") == 0)) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
st.set("Reward", "1"); st.set("Reward", "1");
if (player.isMageClass()) if (player.isMageClass() && (player.getRace() != Race.ORC))
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q260_HuntTheOrcs extends Quest public class Q260_HuntTheOrcs extends Quest
{ {
@@ -37,6 +38,9 @@ public class Q260_HuntTheOrcs extends Quest
// Items // Items
private static final int ORC_AMULET = 1114; private static final int ORC_AMULET = 1114;
private static final int ORC_NECKLACE = 1115; private static final int ORC_NECKLACE = 1115;
// Newbie Items
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
public Q260_HuntTheOrcs() public Q260_HuntTheOrcs()
{ {
@@ -113,6 +117,26 @@ public class Q260_HuntTheOrcs extends Quest
st.takeItems(ORC_AMULET, -1); st.takeItems(ORC_AMULET, -1);
st.takeItems(ORC_NECKLACE, -1); st.takeItems(ORC_NECKLACE, -1);
st.rewardItems(57, (amulet * 5) + (necklace * 15)); st.rewardItems(57, (amulet * 5) + (necklace * 15));
// Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{
st.showQuestionMark(26);
st.set("Reward", "1");
if (player.isMageClass())
{
st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
}
else
{
st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
}
}
} }
break; break;
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q265_ChainsOfSlavery extends Quest public class Q265_ChainsOfSlavery extends Quest
{ {
@@ -109,8 +110,9 @@ public class Q265_ChainsOfSlavery extends Quest
htmltext = "30357-05.htm"; htmltext = "30357-05.htm";
st.takeItems(SHACKLE, -1); st.takeItems(SHACKLE, -1);
st.rewardItems(57, reward); st.rewardItems(57, reward);
// Give newbie reward if player is eligible
if (player.isNewbie() && (st.getInt("Reward") == 0)) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
st.set("Reward", "1"); st.set("Reward", "1");
@@ -119,11 +121,13 @@ public class Q265_ChainsOfSlavery extends Quest
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q273_InvadersOfTheHolyLand extends Quest public class Q273_InvadersOfTheHolyLand extends Quest
{ {
@@ -114,11 +115,14 @@ public class Q273_InvadersOfTheHolyLand extends Quest
st.takeItems(BLACK_SOULSTONE, -1); st.takeItems(BLACK_SOULSTONE, -1);
st.takeItems(RED_SOULSTONE, -1); st.takeItems(RED_SOULSTONE, -1);
st.rewardItems(57, reward); st.rewardItems(57, reward);
if (player.isNewbie() && (st.getInt("Reward") == 0)) // Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{ {
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.set("Reward", "1"); st.set("Reward", "1");
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
break; break;

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q293_TheHiddenVeins extends Quest public class Q293_TheHiddenVeins extends Quest
{ {
@@ -149,11 +150,14 @@ public class Q293_TheHiddenVeins extends Quest
st.takeItems(CHRYSOLITE_ORE, -1); st.takeItems(CHRYSOLITE_ORE, -1);
st.takeItems(HIDDEN_VEIN_MAP, -1); st.takeItems(HIDDEN_VEIN_MAP, -1);
st.rewardItems(57, reward); st.rewardItems(57, reward);
if (player.isNewbie() && (st.getInt("Reward") == 0)) // Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{ {
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.set("Reward", "1"); st.set("Reward", "1");
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
break; break;

View File

@@ -543,6 +543,7 @@ public class Player extends Playable
if (Config.ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE) if (Config.ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE)
{ {
player.setNewbie(true); player.setNewbie(true);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
} }
// Add the player in the characters table of the database // Add the player in the characters table of the database

View File

@@ -38,6 +38,9 @@ public class PlayerVariables extends AbstractVariables
private static final String DELETE_QUERY = "DELETE FROM character_variables WHERE charId = ?"; private static final String DELETE_QUERY = "DELETE FROM character_variables WHERE charId = ?";
private static final String INSERT_QUERY = "INSERT INTO character_variables (charId, var, val) VALUES (?, ?, ?)"; private static final String INSERT_QUERY = "INSERT INTO character_variables (charId, var, val) VALUES (?, ?, ?)";
// Public variable names
public static final String NEW_PLAYERS_REWARDS_RECEIVED = "NEW_PLAYERS_REWARDS_RECEIVED";
private final int _objectId; private final int _objectId;
public PlayerVariables(int objectId) public PlayerVariables(int objectId)

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q101_SwordOfSolidarity extends Quest public class Q101_SwordOfSolidarity extends Quest
@@ -86,18 +87,22 @@ public class Q101_SwordOfSolidarity extends Quest
st.takeItems(BROKEN_SWORD_HANDLE, 1); st.takeItems(BROKEN_SWORD_HANDLE, 1);
st.giveItems(SWORD_OF_SOLIDARITY, 1); st.giveItems(SWORD_OF_SOLIDARITY, 1);
st.giveItems(LESSER_HEALING_POT, 100); st.giveItems(LESSER_HEALING_POT, 100);
if (player.isNewbie()) // Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
st.giveItems(ECHO_BATTLE, 10); st.giveItems(ECHO_BATTLE, 10);

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q102_SeaOfSporesFever extends Quest public class Q102_SeaOfSporesFever extends Quest
@@ -54,6 +55,9 @@ public class Q102_SeaOfSporesFever extends Quest
private static final int ECHO_SOLITUDE = 4414; private static final int ECHO_SOLITUDE = 4414;
private static final int ECHO_FEAST = 4415; private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416; private static final int ECHO_CELEBRATION = 4416;
// Newbie Rewards
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
public Q102_SeaOfSporesFever() public Q102_SeaOfSporesFever()
{ {
@@ -155,6 +159,25 @@ public class Q102_SeaOfSporesFever extends Quest
st.rewardItems(SOULSHOT_NO_GRADE, 1000); st.rewardItems(SOULSHOT_NO_GRADE, 1000);
} }
// Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{
st.showQuestionMark(26);
if (player.isMageClass())
{
st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
}
else
{
st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
}
}
st.giveItems(LESSER_HEALING_POT, 100); st.giveItems(LESSER_HEALING_POT, 100);
st.giveItems(ECHO_BATTLE, 10); st.giveItems(ECHO_BATTLE, 10);
st.giveItems(ECHO_LOVE, 10); st.giveItems(ECHO_LOVE, 10);

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q103_SpiritOfCraftsman extends Quest public class Q103_SpiritOfCraftsman extends Quest
@@ -134,19 +135,22 @@ public class Q103_SpiritOfCraftsman extends Quest
{ {
st.giveItems(SOULSHOT_NO_GRADE, 1000); st.giveItems(SOULSHOT_NO_GRADE, 1000);
} }
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }

View File

@@ -23,6 +23,7 @@ import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q104_SpiritOfMirrors extends Quest public class Q104_SpiritOfMirrors extends Quest
@@ -139,19 +140,22 @@ public class Q104_SpiritOfMirrors extends Quest
{ {
st.giveItems(SOULSHOT_NO_GRADE, 1000); st.giveItems(SOULSHOT_NO_GRADE, 1000);
} }
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q105_SkirmishWithTheOrcs extends Quest public class Q105_SkirmishWithTheOrcs extends Quest
@@ -51,6 +52,7 @@ public class Q105_SkirmishWithTheOrcs extends Quest
private static final int SOULSHOT_FOR_BEGINNERS = 5789; private static final int SOULSHOT_FOR_BEGINNERS = 5789;
private static final int RED_SUNSET_STAFF = 754; private static final int RED_SUNSET_STAFF = 754;
private static final int RED_SUNSET_SWORD = 981; private static final int RED_SUNSET_SWORD = 981;
private static final int LESSER_HEALING_POT = 1060;
private static final int ECHO_BATTLE = 4412; private static final int ECHO_BATTLE = 4412;
private static final int ECHO_LOVE = 4413; private static final int ECHO_LOVE = 4413;
private static final int ECHO_SOLITUDE = 4414; private static final int ECHO_SOLITUDE = 4414;
@@ -153,22 +155,26 @@ public class Q105_SkirmishWithTheOrcs extends Quest
{ {
st.giveItems(RED_SUNSET_SWORD, 1); st.giveItems(RED_SUNSET_SWORD, 1);
} }
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
st.rewardItems(LESSER_HEALING_POT, 100);
st.giveItems(ECHO_BATTLE, 10); st.giveItems(ECHO_BATTLE, 10);
st.giveItems(ECHO_LOVE, 10); st.giveItems(ECHO_LOVE, 10);
st.giveItems(ECHO_SOLITUDE, 10); st.giveItems(ECHO_SOLITUDE, 10);

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q106_ForgottenTruth extends Quest public class Q106_ForgottenTruth extends Quest
@@ -138,19 +139,22 @@ public class Q106_ForgottenTruth extends Quest
{ {
st.giveItems(SOULSHOT_NO_GRADE, 1000); st.giveItems(SOULSHOT_NO_GRADE, 1000);
} }
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q107_MercilessPunishment extends Quest public class Q107_MercilessPunishment extends Quest
@@ -38,7 +39,6 @@ public class Q107_MercilessPunishment extends Quest
private static final int LETTER_TO_ELF = 1558; private static final int LETTER_TO_ELF = 1558;
// Rewards // Rewards
private static final int BUTCHER_SWORD = 1510; private static final int BUTCHER_SWORD = 1510;
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789; private static final int SOULSHOT_FOR_BEGINNERS = 5789;
private static final int ECHO_BATTLE = 4412; private static final int ECHO_BATTLE = 4412;
private static final int ECHO_LOVE = 4413; private static final int ECHO_LOVE = 4413;
@@ -162,20 +162,14 @@ public class Q107_MercilessPunishment extends Quest
st.giveItems(BUTCHER_SWORD, 1); st.giveItems(BUTCHER_SWORD, 1);
st.giveItems(LESSER_HEALING_POTION, 100); st.giveItems(LESSER_HEALING_POTION, 100);
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass())
{
st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
}
else
{
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
} player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
st.giveItems(ECHO_BATTLE, 10); st.giveItems(ECHO_BATTLE, 10);

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction; import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q108_JumbleTumbleDiamondFuss extends Quest public class Q108_JumbleTumbleDiamondFuss extends Quest
@@ -184,19 +185,22 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
st.takeItems(STAR_DIAMOND, -1); st.takeItems(STAR_DIAMOND, -1);
st.giveItems(SILVERSMITH_HAMMER, 1); st.giveItems(SILVERSMITH_HAMMER, 1);
st.giveItems(LESSER_HEALING_POTION, 100); st.giveItems(LESSER_HEALING_POTION, 100);
// Give newbie reward if player is eligible
if (player.isNewbie()) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
if (player.isMageClass()) if (player.isMageClass())
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }

View File

@@ -16,11 +16,13 @@
*/ */
package quests.Q257_TheGuardIsBusy; package quests.Q257_TheGuardIsBusy;
import org.l2jmobius.gameserver.enums.Race;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q257_TheGuardIsBusy extends Quest public class Q257_TheGuardIsBusy extends Quest
{ {
@@ -109,21 +111,24 @@ public class Q257_TheGuardIsBusy extends Quest
} }
st.rewardItems(57, reward); st.rewardItems(57, reward);
// Give newbie reward if player is eligible
if (player.isNewbie() && (st.getInt("Reward") == 0)) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
st.set("Reward", "1"); st.set("Reward", "1");
if (player.isMageClass()) if (player.isMageClass() && (player.getRace() != Race.ORC))
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q260_HuntTheOrcs extends Quest public class Q260_HuntTheOrcs extends Quest
{ {
@@ -37,6 +38,9 @@ public class Q260_HuntTheOrcs extends Quest
// Items // Items
private static final int ORC_AMULET = 1114; private static final int ORC_AMULET = 1114;
private static final int ORC_NECKLACE = 1115; private static final int ORC_NECKLACE = 1115;
// Newbie Items
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
public Q260_HuntTheOrcs() public Q260_HuntTheOrcs()
{ {
@@ -113,6 +117,26 @@ public class Q260_HuntTheOrcs extends Quest
st.takeItems(ORC_AMULET, -1); st.takeItems(ORC_AMULET, -1);
st.takeItems(ORC_NECKLACE, -1); st.takeItems(ORC_NECKLACE, -1);
st.rewardItems(57, (amulet * 5) + (necklace * 15)); st.rewardItems(57, (amulet * 5) + (necklace * 15));
// Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{
st.showQuestionMark(26);
st.set("Reward", "1");
if (player.isMageClass())
{
st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
}
else
{
st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
}
}
} }
break; break;
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q265_ChainsOfSlavery extends Quest public class Q265_ChainsOfSlavery extends Quest
{ {
@@ -109,8 +110,9 @@ public class Q265_ChainsOfSlavery extends Quest
htmltext = "30357-05.htm"; htmltext = "30357-05.htm";
st.takeItems(SHACKLE, -1); st.takeItems(SHACKLE, -1);
st.rewardItems(57, reward); st.rewardItems(57, reward);
// Give newbie reward if player is eligible
if (player.isNewbie() && (st.getInt("Reward") == 0)) int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{ {
st.showQuestionMark(26); st.showQuestionMark(26);
st.set("Reward", "1"); st.set("Reward", "1");
@@ -119,11 +121,13 @@ public class Q265_ChainsOfSlavery extends Quest
{ {
st.playTutorialVoice("tutorial_voice_027"); st.playTutorialVoice("tutorial_voice_027");
st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000); st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
else else
{ {
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
} }

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q273_InvadersOfTheHolyLand extends Quest public class Q273_InvadersOfTheHolyLand extends Quest
{ {
@@ -114,11 +115,14 @@ public class Q273_InvadersOfTheHolyLand extends Quest
st.takeItems(BLACK_SOULSTONE, -1); st.takeItems(BLACK_SOULSTONE, -1);
st.takeItems(RED_SOULSTONE, -1); st.takeItems(RED_SOULSTONE, -1);
st.rewardItems(57, reward); st.rewardItems(57, reward);
if (player.isNewbie() && (st.getInt("Reward") == 0)) // Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{ {
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.set("Reward", "1"); st.set("Reward", "1");
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
break; break;

View File

@@ -22,6 +22,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State; import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
public class Q293_TheHiddenVeins extends Quest public class Q293_TheHiddenVeins extends Quest
{ {
@@ -149,11 +150,14 @@ public class Q293_TheHiddenVeins extends Quest
st.takeItems(CHRYSOLITE_ORE, -1); st.takeItems(CHRYSOLITE_ORE, -1);
st.takeItems(HIDDEN_VEIN_MAP, -1); st.takeItems(HIDDEN_VEIN_MAP, -1);
st.rewardItems(57, reward); st.rewardItems(57, reward);
if (player.isNewbie() && (st.getInt("Reward") == 0)) // Give newbie reward if player is eligible
int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
if (player.isNewbie() && (st.getInt("Reward") == 0) && (newPlayerRewardsReceived < 2))
{ {
st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000); st.giveItems(SOULSHOT_FOR_BEGINNERS, 6000);
st.playTutorialVoice("tutorial_voice_026"); st.playTutorialVoice("tutorial_voice_026");
st.set("Reward", "1"); st.set("Reward", "1");
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, ++newPlayerRewardsReceived);
} }
} }
break; break;

View File

@@ -557,6 +557,7 @@ public class Player extends Playable
if (Config.ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE) if (Config.ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE)
{ {
player.setNewbie(true); player.setNewbie(true);
player.getVariables().set(PlayerVariables.NEW_PLAYERS_REWARDS_RECEIVED, 0);
} }
// Add the player in the characters table of the database // Add the player in the characters table of the database

View File

@@ -38,6 +38,9 @@ public class PlayerVariables extends AbstractVariables
private static final String DELETE_QUERY = "DELETE FROM character_variables WHERE charId = ?"; private static final String DELETE_QUERY = "DELETE FROM character_variables WHERE charId = ?";
private static final String INSERT_QUERY = "INSERT INTO character_variables (charId, var, val) VALUES (?, ?, ?)"; private static final String INSERT_QUERY = "INSERT INTO character_variables (charId, var, val) VALUES (?, ?, ?)";
// Public variable names
public static final String NEW_PLAYERS_REWARDS_RECEIVED = "NEW_PLAYERS_REWARDS_RECEIVED";
private final int _objectId; private final int _objectId;
public PlayerVariables(int objectId) public PlayerVariables(int objectId)