Fixed issue with level rewards. Added new Golden Ticket event.

This commit is contained in:
Cekis
2018-03-23 15:57:04 -07:00
committed by CekisSWG
parent 2bf54f0038
commit ffab447904
4 changed files with 174 additions and 8 deletions
@@ -492,6 +492,7 @@ public class base_player extends script.base_script
return SCRIPT_CONTINUE;
}
public void grantLevelSpecificRewards(obj_id player, int newCombatLevel) throws InterruptedException{
if(hasObjVar(player, "level.reward." + newCombatLevel)) return;
obj_id inv = utils.getInventoryContainer(player);
switch(newCombatLevel){
case 20:
@@ -508,6 +509,7 @@ public class base_player extends script.base_script
String playerName = getName(player);
obj_id reward = createObjectInInventoryAllowOverload(template, player);
if(isIdValid(reward)){
setObjVar(player, "level.reward." + level, true);
sendSystemMessage(player, "A " + name + " has been placed in your inventory.", null);
CustomerServiceLog("LevelItemRewards", "Player " + playerName + " (" + player + ") has been awarded the " + name + " for reaching Level " + level + ".");
}
@@ -12643,6 +12645,19 @@ public class base_player extends script.base_script
}
return SCRIPT_CONTINUE;
}
public int setupLotteryListener(obj_id self, dictionary params) throws InterruptedException{
listenToMessage(getObjIdObjVar(self, "lottery.broker"), "updateLotteryStatus");
return SCRIPT_CONTINUE;
}
public int removeLotteryListener(obj_id self, dictionary params) throws InterruptedException{
stopListeningToMessage(getObjIdObjVar(self, "lottery.broker"), "updateLotteryStatus");
return SCRIPT_CONTINUE;
}
public int updateLotteryStatus(obj_id self, dictionary params) throws InterruptedException
{
setObjVar(self, "lottery.availableTickets", params.getInt("available"));
return SCRIPT_CONTINUE;
}
public boolean blog(String txt) throws InterruptedException
{
if (LOGGING_ON)