mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 02:04:44 +02:00
Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable
This commit is contained in:
@ -112,21 +112,21 @@ public class SalvageManager extends SkillManager {
|
||||
//Lottery on Salvageable Amount
|
||||
|
||||
int lotteryResults = 1;
|
||||
int chanceOfSuccess = 80;
|
||||
int chanceOfSuccess = 99;
|
||||
|
||||
for(int x = 1; x < salvageableAmount-1; x++) {
|
||||
for(int x = 0; x < salvageableAmount-1; x++) {
|
||||
|
||||
if(RandomChanceUtil.rollDice(chanceOfSuccess, 100)) {
|
||||
chanceOfSuccess-=20;
|
||||
Math.max(chanceOfSuccess, 33);
|
||||
chanceOfSuccess-=2;
|
||||
Math.max(chanceOfSuccess, 95);
|
||||
|
||||
lotteryResults+=1;
|
||||
}
|
||||
}
|
||||
|
||||
if(lotteryResults == salvageableAmount) {
|
||||
if(lotteryResults == salvageableAmount && salvageableAmount != 1) {
|
||||
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Perfect", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
} else if(RankUtils.isPlayerMaxRankInSubSkill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE)) {
|
||||
} else if(RankUtils.isPlayerMaxRankInSubSkill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE) || salvageableAmount == 1) {
|
||||
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Normal", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
} else {
|
||||
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
|
@ -10,6 +10,7 @@ import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
|
||||
import com.gmail.nossr50.listeners.InteractionManager;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.runnables.skills.SkillUnlockNotificationTask;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
||||
@ -39,6 +40,10 @@ public class RankUtils {
|
||||
if (innerMap == null || innerMap.get(playerRankInSkill) == null)
|
||||
continue;
|
||||
|
||||
//Don't send notifications if the player lacks the permission node
|
||||
if(!Permissions.isSubSkillEnabled(mcMMOPlayer.getPlayer(), subSkillType))
|
||||
continue;
|
||||
|
||||
//The players level is the exact level requirement for this skill
|
||||
if (newLevel == innerMap.get(playerRankInSkill)) {
|
||||
SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel);
|
||||
|
Reference in New Issue
Block a user