Store last level that mentee was rewarded.
This commit is contained in:
parent
6c8e271323
commit
658da7c898
@ -106,6 +106,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||||
|
private static final String MENTEE_REWARD_LV_VAR = "MENTEE_REWARD_LV";
|
||||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -517,8 +518,9 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if ((amount > 0) && (player.getVariables().getInt(MENTEE_REWARD_LV_VAR, 0) < player.getLevel()))
|
||||||
{
|
{
|
||||||
|
player.getVariables().set(MENTEE_REWARD_LV_VAR, player.getLevel());
|
||||||
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,6 +106,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||||
|
private static final String MENTEE_REWARD_LV_VAR = "MENTEE_REWARD_LV";
|
||||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -517,8 +518,9 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if ((amount > 0) && (player.getVariables().getInt(MENTEE_REWARD_LV_VAR, 0) < player.getLevel()))
|
||||||
{
|
{
|
||||||
|
player.getVariables().set(MENTEE_REWARD_LV_VAR, player.getLevel());
|
||||||
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,6 +106,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||||
|
private static final String MENTEE_REWARD_LV_VAR = "MENTEE_REWARD_LV";
|
||||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -517,8 +518,9 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if ((amount > 0) && (player.getVariables().getInt(MENTEE_REWARD_LV_VAR, 0) < player.getLevel()))
|
||||||
{
|
{
|
||||||
|
player.getVariables().set(MENTEE_REWARD_LV_VAR, player.getLevel());
|
||||||
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,6 +106,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||||
|
private static final String MENTEE_REWARD_LV_VAR = "MENTEE_REWARD_LV";
|
||||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -517,8 +518,9 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if ((amount > 0) && (player.getVariables().getInt(MENTEE_REWARD_LV_VAR, 0) < player.getLevel()))
|
||||||
{
|
{
|
||||||
|
player.getVariables().set(MENTEE_REWARD_LV_VAR, player.getLevel());
|
||||||
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||||
|
private static final String MENTEE_REWARD_LV_VAR = "MENTEE_REWARD_LV";
|
||||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -515,8 +516,9 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if ((amount > 0) && (player.getVariables().getInt(MENTEE_REWARD_LV_VAR, 0) < player.getLevel()))
|
||||||
{
|
{
|
||||||
|
player.getVariables().set(MENTEE_REWARD_LV_VAR, player.getLevel());
|
||||||
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||||
|
private static final String MENTEE_REWARD_LV_VAR = "MENTEE_REWARD_LV";
|
||||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -515,8 +516,9 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if ((amount > 0) && (player.getVariables().getInt(MENTEE_REWARD_LV_VAR, 0) < player.getLevel()))
|
||||||
{
|
{
|
||||||
|
player.getVariables().set(MENTEE_REWARD_LV_VAR, player.getLevel());
|
||||||
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||||
|
private static final String MENTEE_REWARD_LV_VAR = "MENTEE_REWARD_LV";
|
||||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -508,8 +509,9 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if ((amount > 0) && (player.getVariables().getInt(MENTEE_REWARD_LV_VAR, 0) < player.getLevel()))
|
||||||
{
|
{
|
||||||
|
player.getVariables().set(MENTEE_REWARD_LV_VAR, player.getLevel());
|
||||||
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||||
|
private static final String MENTEE_REWARD_LV_VAR = "MENTEE_REWARD_LV";
|
||||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -508,8 +509,9 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if ((amount > 0) && (player.getVariables().getInt(MENTEE_REWARD_LV_VAR, 0) < player.getLevel()))
|
||||||
{
|
{
|
||||||
|
player.getVariables().set(MENTEE_REWARD_LV_VAR, player.getLevel());
|
||||||
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||||
|
private static final String MENTEE_REWARD_LV_VAR = "MENTEE_REWARD_LV";
|
||||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -509,8 +510,9 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if ((amount > 0) && (player.getVariables().getInt(MENTEE_REWARD_LV_VAR, 0) < player.getLevel()))
|
||||||
{
|
{
|
||||||
|
player.getVariables().set(MENTEE_REWARD_LV_VAR, player.getLevel());
|
||||||
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user