Whoami PVP Дамаг/защита

exigo

Путник
Участник
Сообщения
50
Розыгрыши
0
Репутация
5
Реакции
8
Баллы
55
Хроники
  1. Chaotic Throne: High Five
Исходники
Отсутствуют
Сборка
l2jeternity
Подскажите можно ли вывести в whoami - pvp damage и pvp defense - те статы которые дают скиллы от pvp пух и шмота?

Java:
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package l2e.gameserver.handler.voicedcommandhandlers.impl;

import java.text.NumberFormat;
import java.util.Locale;
import l2e.commons.apache.text.StrBuilder;
import l2e.commons.util.Strings;
import l2e.gameserver.Config;
import l2e.gameserver.data.htm.HtmCache;
import l2e.gameserver.handler.voicedcommandhandlers.IVoicedCommandHandler;
import l2e.gameserver.model.actor.Creature;
import l2e.gameserver.model.actor.Player;
import l2e.gameserver.model.items.instance.ItemInstance;
import l2e.gameserver.model.skills.Skill;
import l2e.gameserver.model.stats.Formulas;
import l2e.gameserver.model.stats.Stats;
import l2e.gameserver.network.serverpackets.NpcHtmlMessage;

public class WhoAmI implements IVoicedCommandHandler {
    private final String[] _commandList = new String[]{"stats"};

    public WhoAmI() {
    }

    public boolean useVoicedCommand(String command, Player player, String targets) {
        if (!Config.ALLOW_STATS_COMMAND) {
            return false;
        } else {
            Player playerToShow = player.isGM() && player.getTarget() != null && player.getTarget().isPlayer() ? player.getTarget().getActingPlayer() : player;
            double hpRegen = Formulas.calcHpRegen(playerToShow);
            double cpRegen = Formulas.calcCpRegen(playerToShow);
            double mpRegen = Formulas.calcMpRegen(playerToShow);
            double hpDrain = playerToShow.calcStat(Stats.ABSORB_DAMAGE_PERCENT, 0.0, (Creature)null, (Skill)null);
            double hpGain = playerToShow.calcStat(Stats.HEAL_EFFECT, 100.0, (Creature)null, (Skill)null);
            double mpGain = playerToShow.calcStat(Stats.MANA_CHARGE, 100.0, (Creature)null, (Skill)null);
            double critPerc = 2.0 * playerToShow.getCriticalDmg((Creature)null, 1.0, (Skill)null);
            double critStatic = playerToShow.calcStat(Stats.CRITICAL_DAMAGE_ADD, 0.0, (Creature)null, (Skill)null);
            double mCritRate = playerToShow.getMCriticalHit((Creature)null, (Skill)null) * 0.1;
            double blowRate = playerToShow.calcStat(Stats.BLOW_RATE, 0.0, (Creature)null, (Skill)null);
            ItemInstance shld = playerToShow.getSecondaryWeaponInstance();
            boolean shield = shld != null && shld.getItem().isShield();
            double shieldDef = shield ? playerToShow.calcStat(Stats.SHIELD_DEFENCE, (double)player.getTemplate().getBaseShldDef(), (Creature)null, (Skill)null) : 0.0;
            double shieldRate = shield ? playerToShow.calcStat(Stats.SHIELD_RATE, 0.0, (Creature)null, (Skill)null) : 0.0;
            double xpRate = Config.RATE_XP_BY_LVL[playerToShow.getLevel()] * playerToShow.getPremiumBonus().getRateXp();
            double spRate = Config.RATE_SP_BY_LVL[playerToShow.getLevel()] * playerToShow.getPremiumBonus().getRateSp();
            double dropRate = Config.RATE_DROP_ITEMS * playerToShow.getPremiumBonus().getDropItems();
            double spoilRate = Config.RATE_DROP_SPOIL * playerToShow.getPremiumBonus().getDropSpoil();
            double fireResist = playerToShow.calcStat(Stats.FIRE_RES, 0.0, (Creature)null, (Skill)null);
            double windResist = playerToShow.calcStat(Stats.WIND_RES, 0.0, (Creature)null, (Skill)null);
            double waterResist = playerToShow.calcStat(Stats.WATER_RES, 0.0, (Creature)null, (Skill)null);
            double earthResist = playerToShow.calcStat(Stats.EARTH_RES, 0.0, (Creature)null, (Skill)null);
            double holyResist = playerToShow.calcStat(Stats.HOLY_RES, 0.0, (Creature)null, (Skill)null);
            double unholyResist = playerToShow.calcStat(Stats.DARK_RES, 0.0, (Creature)null, (Skill)null);
            double bleedPower = Math.min(playerToShow.calcStat(Stats.BLEED_PROF, 0.0, (Creature)null, (Skill)null), Config.BLEED_PROF);
            double bleedResist = calcMin(playerToShow.calcStat(Stats.BLEED_VULN, 0.0, (Creature)null, (Skill)null), Config.BLEED_VULN);
            double poisonPower = Math.min(playerToShow.calcStat(Stats.POISON_PROF, 0.0, (Creature)null, (Skill)null), Config.POISON_PROF);
            double poisonResist = calcMin(playerToShow.calcStat(Stats.POISON_VULN, 0.0, (Creature)null, (Skill)null), Config.POISON_VULN);
            double stunPower = Math.min(playerToShow.calcStat(Stats.STUN_PROF, 0.0, (Creature)null, (Skill)null), Config.STUN_PROF);
            double stunResist = calcMin(playerToShow.calcStat(Stats.STUN_VULN, 0.0, (Creature)null, (Skill)null), Config.STUN_VULN);
            double rootPower = Math.min(playerToShow.calcStat(Stats.ROOT_PROF, 0.0, (Creature)null, (Skill)null), Config.ROOT_PROF);
            double rootResist = calcMin(playerToShow.calcStat(Stats.ROOT_VULN, 0.0, (Creature)null, (Skill)null), Config.ROOT_VULN);
            double sleepPower = Math.min(playerToShow.calcStat(Stats.SLEEP_PROF, 0.0, (Creature)null, (Skill)null), Config.SLEEP_PROF);
            double sleepResist = calcMin(playerToShow.calcStat(Stats.SLEEP_VULN, 0.0, (Creature)null, (Skill)null), Config.SLEEP_VULN);
            double paralyzePower = Math.min(playerToShow.calcStat(Stats.PARALYZE_PROF, 0.0, (Creature)null, (Skill)null), Config.PARALYZE_PROF);
            double paralyzeResist = calcMin(playerToShow.calcStat(Stats.PARALYZE_VULN, 0.0, (Creature)null, (Skill)null), Config.PARALYZE_VULN);
            double mentalPower = Math.min(playerToShow.calcStat(Stats.DERANGEMENT_PROF, 0.0, (Creature)null, (Skill)null), Config.MENTAL_PROF);
            double mentalResist = calcMin(playerToShow.calcStat(Stats.DERANGEMENT_VULN, 0.0, (Creature)null, (Skill)null), Config.MENTAL_VULN);
            double debuffPower = Math.min(playerToShow.calcStat(Stats.DEBUFF_PROF, 0.0, (Creature)null, (Skill)null), Config.DEBUFF_PROF);
            double debuffResist = calcMin(playerToShow.calcStat(Stats.DEBUFF_VULN, 0.0, (Creature)null, (Skill)null), Config.DEBUFF_VULN);
            double cancelPower = Math.min(playerToShow.calcStat(Stats.CANCEL_PROF, 0.0, (Creature)null, (Skill)null), Config.CANCEL_PROF);
            double cancelResist = calcMin(playerToShow.calcStat(Stats.CANCEL_VULN, 0.0, (Creature)null, (Skill)null), Config.CANCEL_VULN);
            double swordResist = 100.0 - playerToShow.calcStat(Stats.SWORD_WPN_VULN, 0.0, (Creature)null, (Skill)null);
            double dualResist = 100.0 - playerToShow.calcStat(Stats.DUAL_WPN_VULN, 0.0, (Creature)null, (Skill)null);
            double bluntResist = 100.0 - playerToShow.calcStat(Stats.BLUNT_WPN_VULN, 0.0, (Creature)null, (Skill)null);
            double daggerResist = 100.0 - playerToShow.calcStat(Stats.DAGGER_WPN_VULN, 0.0, (Creature)null, (Skill)null);
            double bowResist = 100.0 - playerToShow.calcStat(Stats.BOW_WPN_VULN, 0.0, (Creature)null, (Skill)null);
            double crossbowResist = 100.0 - playerToShow.calcStat(Stats.CROSSBOW_WPN_VULN, 0.0, (Creature)null, (Skill)null);
            double poleResist = 100.0 - playerToShow.calcStat(Stats.POLE_WPN_VULN, 0.0, (Creature)null, (Skill)null);
            double fistResist = 100.0 - playerToShow.calcStat(Stats.FIST_WPN_VULN, 0.0, (Creature)null, (Skill)null);
            double critChanceResist = 100.0 - playerToShow.calcStat(Stats.CRITICAL_RATE, playerToShow.getTemplate().getBaseCritRate(), (Creature)null, (Skill)null);
            double critDamResistStatic = playerToShow.calcStat(Stats.CRIT_VULN, playerToShow.getTemplate().getBaseCritVuln(), (Creature)null, (Skill)null);
            double critDamResist = 100.0 - 100.0 * (playerToShow.calcStat(Stats.CRIT_VULN, playerToShow.getTemplate().getBaseCritVuln(), (Creature)null, (Skill)null) - critDamResistStatic);
            String dialog = HtmCache.getInstance().getHtm(player, player.getLang(), player.isGM() ? "data/html/mods/whoamiGM.htm" : "data/html/mods/whoami.htm");
            NumberFormat df = NumberFormat.getInstance(Locale.ENGLISH);
            df.setMaximumFractionDigits(1);
            df.setMinimumFractionDigits(1);
            StrBuilder sb = new StrBuilder(dialog);
            sb.replaceAll("%hpRegen%", df.format(hpRegen));
            sb.replaceAll("%cpRegen%", df.format(cpRegen));
            sb.replaceAll("%mpRegen%", df.format(mpRegen));
            sb.replaceAll("%hpDrain%", df.format(hpDrain));
            sb.replaceAll("%hpGain%", df.format(hpGain));
            sb.replaceAll("%mpGain%", df.format(mpGain));
            sb.replaceAll("%critPerc%", df.format(critPerc));
            sb.replaceAll("%critStatic%", df.format(critStatic));
            sb.replaceAll("%mCritRate%", df.format(mCritRate));
            sb.replaceAll("%blowRate%", df.format(blowRate));
            sb.replaceAll("%shieldDef%", df.format(shieldDef));
            sb.replaceAll("%shieldRate%", df.format(shieldRate));
            sb.replaceAll("%xpRate%", df.format(xpRate));
            sb.replaceAll("%spRate%", df.format(spRate));
            sb.replaceAll("%dropRate%", df.format(dropRate));
            sb.replaceAll("%spoilRate%", df.format(spoilRate));
            sb.replaceAll("%fireResist%", df.format(fireResist));
            sb.replaceAll("%windResist%", df.format(windResist));
            sb.replaceAll("%waterResist%", df.format(waterResist));
            sb.replaceAll("%earthResist%", df.format(earthResist));
            sb.replaceAll("%holyResist%", df.format(holyResist));
            sb.replaceAll("%darkResist%", df.format(unholyResist));
            sb.replaceAll("%bleedPower%", df.format(bleedPower));
            sb.replaceAll("%bleedResist%", df.format(Math.abs(bleedResist)));
            sb.replaceAll("%poisonPower%", df.format(poisonPower));
            sb.replaceAll("%poisonResist%", df.format(Math.abs(poisonResist)));
            sb.replaceAll("%stunPower%", df.format(stunPower));
            sb.replaceAll("%stunResist%", df.format(Math.abs(stunResist)));
            sb.replaceAll("%rootPower%", df.format(rootPower));
            sb.replaceAll("%rootResist%", df.format(Math.abs(rootResist)));
            sb.replaceAll("%sleepPower%", df.format(sleepPower));
            sb.replaceAll("%sleepResist%", df.format(Math.abs(sleepResist)));
            sb.replaceAll("%paralyzePower%", df.format(paralyzePower));
            sb.replaceAll("%paralyzeResist%", df.format(Math.abs(paralyzeResist)));
            sb.replaceAll("%mentalPower%", df.format(mentalPower));
            sb.replaceAll("%mentalResist%", df.format(Math.abs(mentalResist)));
            sb.replaceAll("%debuffPower%", df.format(debuffPower));
            sb.replaceAll("%debuffResist%", df.format(Math.abs(debuffResist)));
            sb.replaceAll("%cancelPower%", df.format(cancelPower));
            sb.replaceAll("%cancelResist%", df.format(Math.abs(cancelResist)));
            sb.replaceAll("%swordResist%", df.format(swordResist));
            sb.replaceAll("%dualResist%", df.format(dualResist));
            sb.replaceAll("%bluntResist%", df.format(bluntResist));
            sb.replaceAll("%daggerResist%", df.format(daggerResist));
            sb.replaceAll("%bowResist%", df.format(bowResist));
            sb.replaceAll("%crossbowResist%", df.format(crossbowResist));
            sb.replaceAll("%fistResist%", df.format(fistResist));
            sb.replaceAll("%poleResist%", df.format(poleResist));
            sb.replaceAll("%critChanceResist%", df.format(Math.abs(critChanceResist)));
            sb.replaceAll("%critDamResist%", df.format(critDamResist));
            NpcHtmlMessage msg = new NpcHtmlMessage(0);
            msg.setHtml(player, Strings.bbParse(sb.toString()));
            player.sendPacket(msg);
            return true;
        }
    }

    private static double calcMin(double a, double b) {
        return a < b ? b : a;
    }

    public String[] getVoicedCommandList() {
        return this._commandList;
    }
}
 
PVP_PHYSICAL_DMG("pvpPhysDmg"),
PVP_MAGICAL_DMG("pvpMagicalDmg"),
PVP_PHYS_SKILL_DMG("pvpPhysSkillsDmg"),
PVP_PHYSICAL_DEF("pvpPhysDef"),
PVP_MAGICAL_DEF("pvpMagicalDef"),
PVP_PHYS_SKILL_DEF("pvpPhysSkillsDef"),

Вот эти варианты в ядре есть - подскажите как прикрутить без исходников? Дописать свой класс и наследоваться от WhoAmI?
 
Самое простое - попросить в l2jeternity комьюнити и там расширят и добавят подобное. Если нет, то просто полностью вынести класс whoami из ядра в dp скрипты как перекрыющую войс команду и добавить, что нужно

Если в статах реально такого нет, то запилю и пропихну через LordWinter на днях
 
Последнее редактирование: