Added level specific reward mechanism and adjusted some awards to be unique and/or no trade.

This commit is contained in:
Cekis
2018-03-23 15:45:39 -07:00
committed by CekisSWG
parent c77fbd0c44
commit 48db89af9e
2 changed files with 26 additions and 1 deletions
+25
View File
@@ -487,9 +487,34 @@ public class base_player extends script.base_script
expertise.autoAllocateExpertiseByLevel(self, true);
}
recomputeCommandSeries(self);
grantLevelSpecificRewards(self, newCombatLevel);
skill.sendlevelUpStatChangeSystemMessages(self, oldCombatLevel, newCombatLevel);
return SCRIPT_CONTINUE;
}
public void grantLevelSpecificRewards(obj_id player, int newCombatLevel) throws InterruptedException{
obj_id inv = utils.getInventoryContainer(player);
switch(newCombatLevel){
case 20:
// create the Level 20 reward Flash Speeder (stella)
createLevelReward("Flash Speeder deed", "object/tangible/deed/vehicle_deed/speederbike_flash_deed.iff", newCombatLevel, player);
break;
case 70:
createLevelReward("Lava Flea deed", "object/tangible/veteran_reward/mount_lava_flea.iff", newCombatLevel, player);
// create the Level 70 reward Lava Flea (stella)
break;
}
}
public void createLevelReward(String name, String template, int level, obj_id player) throws InterruptedException{
String playerName = getName(player);
obj_id reward = createObjectInInventoryAllowOverload(template, player);
if(isIdValid(reward)){
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 + ".");
}
else{
CustomerServiceLog("LevelItemRewards", "Unable to create " + name + " reward for Player " + playerName + " (" + player + ")");
}
}
public int updateGCWStanding(obj_id self, dictionary params) throws InterruptedException
{
int intScore = params.getInt("intScore");