Search in sources :

Example 11 with McMMOPlayer

use of com.gmail.nossr50.datatypes.player.McMMOPlayer in project TriggerReactor by wysohn.

the class McMmoSupport method addLevel.

/**
 * add 'levels' to target player's 'skillType'
 *
 * @param player
 * @param skillType
 * @param levels
 */
public void addLevel(Player player, String skillType, int levels) {
    McMMOPlayer mmoPlayer = (McMMOPlayer) player(player.getName());
    if (mmoPlayer == null)
        throw new RuntimeException("Could not find MCMMO info for player " + player.getName());
    SkillType type = SkillType.valueOf(skillType);
    mmoPlayer.addLevels(type, levels);
}
Also used : McMMOPlayer(com.gmail.nossr50.datatypes.player.McMMOPlayer) SkillType(com.gmail.nossr50.datatypes.skills.SkillType)

Example 12 with McMMOPlayer

use of com.gmail.nossr50.datatypes.player.McMMOPlayer in project TriggerReactor by wysohn.

the class McMmoSupport method setLevel.

/**
 * set level of target player's 'skillType' to 'level'
 *
 * @param player
 * @param skillType
 * @param level
 */
public void setLevel(Player player, String skillType, int level) {
    McMMOPlayer mmoPlayer = (McMMOPlayer) player(player.getName());
    if (mmoPlayer == null)
        throw new RuntimeException("Could not find MCMMO info for player " + player.getName());
    SkillType type = SkillType.valueOf(skillType);
    mmoPlayer.modifySkill(type, level);
}
Also used : McMMOPlayer(com.gmail.nossr50.datatypes.player.McMMOPlayer) SkillType(com.gmail.nossr50.datatypes.skills.SkillType)

Example 13 with McMMOPlayer

use of com.gmail.nossr50.datatypes.player.McMMOPlayer in project Nexus by ProjectEdenGG.

the class McMMOResetProvider method prestigeAll.

public void prestigeAll(Player player) {
    Koda.say(Nickname.of(player) + " has reset all of their mcMMO skills!");
    PlayerUtils.runCommandAsConsole("ce give " + player.getName() + " diamond_chestplate enlighted:1 beserk:1 durability:3 mending:1");
    McMMOPlayer mcmmoPlayer = UserManager.getPlayer(player);
    boolean allMax = true;
    for (PrimarySkillType skillType : PrimarySkillType.values()) {
        if (skillType.isChildSkill())
            continue;
        if (mcmmoPlayer.getSkillLevel(skillType) < TIER_TWO)
            allMax = false;
        prestige(player, ResetSkillType.valueOf(skillType.name()), false);
    }
    int deposit = DEPOSIT_ALL;
    if (allMax)
        deposit += MAX_DEPOSIT_ALL_MULTIPLIER;
    new BankerService().deposit(player, deposit, ShopGroup.SURVIVAL, TransactionCause.MCMMO_RESET);
    McMMOPrestige mcMMOPrestige = service.getPrestige(player.getUniqueId().toString());
    mcMMOPrestige.prestige("all");
    service.save(mcMMOPrestige);
}
Also used : PrimarySkillType(com.gmail.nossr50.datatypes.skills.PrimarySkillType) McMMOPlayer(com.gmail.nossr50.datatypes.player.McMMOPlayer) BankerService(gg.projecteden.nexus.models.banker.BankerService) McMMOPrestige(gg.projecteden.nexus.models.mcmmo.McMMOPrestige)

Example 14 with McMMOPlayer

use of com.gmail.nossr50.datatypes.player.McMMOPlayer in project Depenizen by DenizenScript.

the class PartyTag method forPlayer.

public static PartyTag forPlayer(PlayerTag player) {
    McMMOPlayer pl = UserManager.getOfflinePlayer(player.getOfflinePlayer());
    if (pl == null) {
        return null;
    }
    Party party = pl.getParty();
    if (party == null) {
        return null;
    }
    return new PartyTag(party);
}
Also used : Party(com.gmail.nossr50.datatypes.party.Party) McMMOPlayer(com.gmail.nossr50.datatypes.player.McMMOPlayer)

Aggregations

McMMOPlayer (com.gmail.nossr50.datatypes.player.McMMOPlayer)14 SkillType (com.gmail.nossr50.datatypes.skills.SkillType)7 BankerService (gg.projecteden.nexus.models.banker.BankerService)3 McMMOPrestige (gg.projecteden.nexus.models.mcmmo.McMMOPrestige)3 Party (com.gmail.nossr50.datatypes.party.Party)2 PrimarySkillType (com.gmail.nossr50.datatypes.skills.PrimarySkillType)2 Player (org.bukkit.entity.Player)2 ChatChannel (com.gmail.nossr50.datatypes.chat.ChatChannel)1 AbilityType (com.gmail.nossr50.datatypes.skills.AbilityType)1 UserManager (com.gmail.nossr50.util.player.UserManager)1 Tristate (com.griefdefender.api.Tristate)1 Claim (com.griefdefender.api.claim.Claim)1 PlayerData (com.griefdefender.api.data.PlayerData)1 Context (com.griefdefender.api.permission.Context)1 Koda (gg.projecteden.nexus.features.chat.Koda)1 GemCommand (gg.projecteden.nexus.features.crates.GemCommand)1 TIER_ONE (gg.projecteden.nexus.features.mcmmo.McMMO.TIER_ONE)1 TIER_ONE_ALL (gg.projecteden.nexus.features.mcmmo.McMMO.TIER_ONE_ALL)1 TIER_TWO (gg.projecteden.nexus.features.mcmmo.McMMO.TIER_TWO)1 ConfirmationMenu (gg.projecteden.nexus.features.menus.MenuUtils.ConfirmationMenu)1