Overhauled itemBonuses to actually work. Have yet to test timed bonuses, I think they use auxdata for number of hours left. Wood essence also introduced.
This commit is contained in:
@@ -22,6 +22,8 @@ import mod.sin.armour.SpectralHide;
|
||||
import mod.sin.creatures.Reaper;
|
||||
import mod.sin.creatures.SpectralDrake;
|
||||
import mod.sin.items.AffinityOrb;
|
||||
import mod.sin.items.EnchantersCrystal;
|
||||
import mod.sin.items.TreasureBox;
|
||||
import mod.sin.items.caches.RiftCache;
|
||||
import mod.sin.items.caches.TitanCache;
|
||||
import mod.sin.kingdomoffices.ItemCreator;
|
||||
@@ -112,7 +114,19 @@ public class PlayerBounty {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void rewardRareLoot(Player player, Creature mob) {
|
||||
try {
|
||||
double fightskill = player.getFightingSkill().getKnowledge();
|
||||
int quality = random.nextInt((int)fightskill);
|
||||
Item crystal = ItemFactory.createItem(TreasureBox.templateId, quality, (random.nextInt((int)fightskill) < 20 ? (byte)0:(byte)1), "");
|
||||
player.getInventory().insertItem(crystal);
|
||||
player.getCommunicator().sendNormalServerMessage("You find something in your inventory!");
|
||||
} catch (FailedException | NoSuchTemplateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
;
|
||||
public static void checkPlayerReward(Player player, Creature mob){
|
||||
try{
|
||||
if(mob.isReborn() || mob.isBred()){
|
||||
@@ -145,6 +159,7 @@ public class PlayerBounty {
|
||||
if(RareSpawns.isRareCreature(mob)){
|
||||
Item riftCache = ItemFactory.createItem(RiftCache.templateId, 50f+(30f*Server.rand.nextFloat()), mob.getName());
|
||||
player.getInventory().insertItem(riftCache, true);
|
||||
rewardRareLoot(player, mob);
|
||||
}
|
||||
if(Titans.isTitan(mob)){
|
||||
player.addTitle(Title.getTitle(700));
|
||||
|
||||
Reference in New Issue
Block a user