Removed item grade penalty.

This commit is contained in:
MobiusDevelopment 2019-09-25 21:41:32 +00:00
parent 88582755a8
commit 5497af095c
19 changed files with 8 additions and 351 deletions

View File

@ -726,11 +726,6 @@ PartyXpCutoffGapPercent = 100;30;0
# Default: False
DisableTutorial = False
# Expertise penalty
# If disabled, player will not receive penalty for equip higher grade items
# Default: True
ExpertisePenalty = True
# Player can in client define his own key mapping and for save it must be stored server side.
# Default: True
StoreCharUiSettings = True

View File

@ -99,7 +99,6 @@ public class EffectMasterHandler
EffectHandler.getInstance().registerHandler("CriticalDamagePosition", CriticalDamagePosition::new);
EffectHandler.getInstance().registerHandler("CriticalRate", CriticalRate::new);
EffectHandler.getInstance().registerHandler("CriticalRatePositionBonus", CriticalRatePositionBonus::new);
EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
EffectHandler.getInstance().registerHandler("DamageByAttack", DamageByAttack::new);

View File

@ -80,7 +80,7 @@ public class Wear implements IBypassHandler
player.setInventoryBlockingStatus(true);
player.sendPacket(new ShopPreviewList(buyList, player.getAdena(), player.getExpertiseLevel()));
player.sendPacket(new ShopPreviewList(buyList, player.getAdena()));
}
@Override

View File

@ -1,60 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import org.l2jmobius.gameserver.model.StatsSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
/**
* Crystal Grade Modify effect implementation.
* @author Zoey76
*/
public class CrystalGradeModify extends AbstractEffect
{
private final int _grade;
public CrystalGradeModify(StatsSet params)
{
_grade = params.getInt("grade", 0);
}
@Override
public boolean canStart(Creature effector, Creature effected, Skill skill)
{
return effected.isPlayer();
}
@Override
public void onStart(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
effected.getActingPlayer().setExpertisePenaltyBonus(_grade);
}
@Override
public void onExit(Creature effector, Creature effected, Skill skill)
{
final PlayerInstance player = effected.getActingPlayer();
if (player != null)
{
player.setExpertisePenaltyBonus(0);
}
}
}

View File

@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
import org.l2jmobius.gameserver.model.items.Weapon;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.util.Broadcast;
@ -68,17 +67,6 @@ public class BlessedSoulShots implements IItemHandler
return false;
}
final boolean gradeCheck = item.isEtcItem() && (item.getEtcItem().getDefaultAction() == ActionType.SOULSHOT) && (weaponInst.getItem().getCrystalTypePlus() == item.getItem().getCrystalTypePlus());
if (!gradeCheck)
{
if (!player.getAutoSoulShot().contains(itemId))
{
player.sendPacket(SystemMessageId.THE_SOULSHOT_YOU_ARE_ATTEMPTING_TO_USE_DOES_NOT_MATCH_THE_GRADE_OF_YOUR_EQUIPPED_WEAPON);
}
return false;
}
player.soulShotLock.lock();
try
{

View File

@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
import org.l2jmobius.gameserver.model.items.Weapon;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.util.Broadcast;
@ -70,19 +69,6 @@ public class BlessedSpiritShot implements IItemHandler
return false;
}
// Check for correct grade
final boolean gradeCheck = item.isEtcItem() && (item.getEtcItem().getDefaultAction() == ActionType.SPIRITSHOT) && (weaponInst.getItem().getCrystalTypePlus() == item.getItem().getCrystalTypePlus());
if (!gradeCheck)
{
if (!player.getAutoSoulShot().contains(itemId))
{
player.sendPacket(SystemMessageId.YOUR_SPIRITSHOT_DOES_NOT_MATCH_THE_WEAPON_S_GRADE);
}
return false;
}
// Consume Blessed SpiritShot if player has enough of them
if (!player.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false))
{

View File

@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
import org.l2jmobius.gameserver.model.items.Weapon;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.util.Broadcast;
@ -65,17 +64,6 @@ public class SoulShots implements IItemHandler
return false;
}
final boolean gradeCheck = item.isEtcItem() && (item.getEtcItem().getDefaultAction() == ActionType.SOULSHOT) && (weaponInst.getItem().getCrystalTypePlus() == item.getItem().getCrystalTypePlus());
if (!gradeCheck)
{
if (!player.getAutoSoulShot().contains(itemId))
{
player.sendPacket(SystemMessageId.THE_SOULSHOT_YOU_ARE_ATTEMPTING_TO_USE_DOES_NOT_MATCH_THE_GRADE_OF_YOUR_EQUIPPED_WEAPON);
}
return false;
}
player.soulShotLock.lock();
try
{

View File

@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
import org.l2jmobius.gameserver.model.items.Weapon;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.util.Broadcast;
@ -70,19 +69,6 @@ public class SpiritShot implements IItemHandler
return false;
}
// Check for correct grade
final boolean gradeCheck = item.isEtcItem() && (item.getEtcItem().getDefaultAction() == ActionType.SPIRITSHOT) && (weaponInst.getItem().getCrystalTypePlus() == item.getItem().getCrystalTypePlus());
if (!gradeCheck)
{
if (!player.getAutoSoulShot().contains(itemId))
{
player.sendPacket(SystemMessageId.YOUR_SPIRITSHOT_DOES_NOT_MATCH_THE_WEAPON_S_GRADE);
}
return false;
}
// Consume SpiritShot if player has enough of them
if (!player.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false))
{

View File

@ -2,12 +2,6 @@
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/skillTrees.xsd">
<skillTree type="classSkillTree">
<skill skillName="Lucky" skillId="194" skillLvl="1" getLevel="1" autoGet="true" />
<skill skillName="Expertise D" skillId="239" skillLvl="1" getLevel="20" autoGet="true" />
<skill skillName="Expertise C" skillId="239" skillLvl="2" getLevel="40" autoGet="true" />
<skill skillName="Expertise B" skillId="239" skillLvl="3" getLevel="52" autoGet="true" />
<skill skillName="Expertise A" skillId="239" skillLvl="4" getLevel="61" autoGet="true" />
<skill skillName="Expertise S" skillId="239" skillLvl="5" getLevel="76" autoGet="true" />
<skill skillName="Pirate" skillId="1800" skillLvl="1" getLevel="45" autoGet="true" />
<skill skillName="Dark Assassin" skillId="1801" skillLvl="1" getLevel="60" autoGet="true" />
<skill skillName="White Assassin" skillId="1802" skillLvl="1" getLevel="70" autoGet="true" />

View File

@ -69,7 +69,6 @@ CriticalDamage: Critical Damage stat.
CriticalDamagePosition: Critical Damage depending on position stat.
CriticalRate: Critical Rate stat.
CriticalRatePositionBonus: Critical Rate depending on position stat. Ignores the critical rate cap of 500.
CrystalGradeModify: Sets your Expertise Grade level. With this effect you can make lv. 40 player (C Grade) to wear S grade.
CubicMastery: Max cubics stat.
DamageBlock: Blocks Hp or Mp damage/heal.
DamageByAttack: An effect that changes damage taken from an attack.

View File

@ -297,7 +297,6 @@ public class Config
public static int[][] PARTY_XP_CUTOFF_GAPS;
public static int[] PARTY_XP_CUTOFF_GAP_PERCENTS;
public static boolean DISABLE_TUTORIAL;
public static boolean EXPERTISE_PENALTY;
public static boolean STORE_RECIPE_SHOPLIST;
public static boolean STORE_UI_SETTINGS;
public static String[] FORBIDDEN_NAMES;
@ -1722,7 +1721,6 @@ public class Config
PARTY_XP_CUTOFF_GAP_PERCENTS[i] = Integer.parseInt(percents[i]);
}
DISABLE_TUTORIAL = Character.getBoolean("DisableTutorial", false);
EXPERTISE_PENALTY = Character.getBoolean("ExpertisePenalty", true);
STORE_RECIPE_SHOPLIST = Character.getBoolean("StoreRecipeShopList", false);
STORE_UI_SETTINGS = Character.getBoolean("StoreCharUiSettings", true);
FORBIDDEN_NAMES = Character.getString("ForbiddenNames", "").split(",");

View File

@ -75,7 +75,6 @@ import org.l2jmobius.gameserver.model.conditions.ConditionPlayerCloakStatus;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerCp;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerDualclass;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerFlyMounted;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerGrade;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerHasCastle;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerHasClanHall;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerHasFort;
@ -511,12 +510,6 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionPlayerCp(cp));
break;
}
case "grade":
{
final int expIndex = Integer.decode(getValue(a.getNodeValue(), template));
cond = joinAnd(cond, new ConditionPlayerGrade(expIndex));
break;
}
case "pkcount":
{
final int expIndex = Integer.decode(getValue(a.getNodeValue(), template));

View File

@ -2721,7 +2721,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
final PlayerInstance player = getActingPlayer();
player.refreshOverloaded(true);
player.refreshExpertisePenalty();
sendPacket(info);
if (broadcastFull)

View File

@ -691,12 +691,6 @@ public class PlayerInstance extends Playable
private final Map<Integer, String> _chars = new ConcurrentSkipListMap<>();
// private byte _updateKnownCounter = 0;
private int _expertiseArmorPenalty = 0;
private int _expertiseWeaponPenalty = 0;
private int _expertisePenaltyBonus = 0;
private final Map<Class<? extends AbstractRequest>, AbstractRequest> _requests = new ConcurrentHashMap<>();
protected boolean _inventoryDisable = false;
@ -1996,26 +1990,6 @@ public class PlayerInstance extends Playable
broadcastReputation();
}
public int getExpertiseArmorPenalty()
{
return _expertiseArmorPenalty;
}
public int getExpertiseWeaponPenalty()
{
return _expertiseWeaponPenalty;
}
public int getExpertisePenaltyBonus()
{
return _expertisePenaltyBonus;
}
public void setExpertisePenaltyBonus(int bonus)
{
_expertisePenaltyBonus = bonus;
}
public int getWeightPenalty()
{
return _dietMode ? 0 : _curWeightPenalty;
@ -2075,83 +2049,6 @@ public class PlayerInstance extends Playable
}
}
public void refreshExpertisePenalty()
{
if (!Config.EXPERTISE_PENALTY)
{
return;
}
final int expertiseLevel = getExpertiseLevel();
int armorPenalty = 0;
int weaponPenalty = 0;
int crystaltype;
for (ItemInstance item : getInventory().getItems())
{
if ((item != null) && item.isEquipped() && ((item.getItemType() != EtcItemType.ARROW) && (item.getItemType() != EtcItemType.BOLT)))
{
crystaltype = item.getItem().getCrystalType().getId();
if (crystaltype > expertiseLevel)
{
if (item.isWeapon() && (crystaltype > weaponPenalty))
{
weaponPenalty = crystaltype;
}
else if (crystaltype > armorPenalty)
{
armorPenalty = crystaltype;
}
}
}
}
boolean changed = false;
final int bonus = getExpertisePenaltyBonus();
// calc weapon penalty
weaponPenalty = weaponPenalty - expertiseLevel - bonus;
weaponPenalty = Math.min(Math.max(weaponPenalty, 0), 4);
if ((_expertiseWeaponPenalty != weaponPenalty) || (getSkillLevel(CommonSkill.WEAPON_GRADE_PENALTY.getId()) != weaponPenalty))
{
_expertiseWeaponPenalty = weaponPenalty;
if (_expertiseWeaponPenalty > 0)
{
addSkill(SkillData.getInstance().getSkill(CommonSkill.WEAPON_GRADE_PENALTY.getId(), _expertiseWeaponPenalty));
}
else
{
removeSkill(getKnownSkill(CommonSkill.WEAPON_GRADE_PENALTY.getId()), false, true);
}
changed = true;
}
// calc armor penalty
armorPenalty = armorPenalty - expertiseLevel - bonus;
armorPenalty = Math.min(Math.max(armorPenalty, 0), 4);
if ((_expertiseArmorPenalty != armorPenalty) || (getSkillLevel(CommonSkill.ARMOR_GRADE_PENALTY.getId()) != armorPenalty))
{
_expertiseArmorPenalty = armorPenalty;
if (_expertiseArmorPenalty > 0)
{
addSkill(SkillData.getInstance().getSkill(CommonSkill.ARMOR_GRADE_PENALTY.getId(), _expertiseArmorPenalty));
}
else
{
removeSkill(getKnownSkill(CommonSkill.ARMOR_GRADE_PENALTY.getId()), false, true);
}
changed = true;
}
if (changed)
{
sendPacket(new EtcStatusUpdate(this));
}
}
public void useEquippableItem(ItemInstance item, boolean abortAttack)
{
// Equip or unEquip
@ -2219,8 +2116,6 @@ public class PlayerInstance extends Playable
}
}
refreshExpertisePenalty();
broadcastUserInfo();
final InventoryUpdate iu = new InventoryUpdate();
@ -6355,7 +6250,6 @@ public class PlayerInstance extends Playable
public void updateAndBroadcastStatus(int broadcastType)
{
refreshOverloaded(true);
refreshExpertisePenalty();
// Send a Server->Client packet UserInfo to this PlayerInstance and CharInfo to all PlayerInstance in its _KnownPlayers (broadcast)
if (broadcastType == 1)
{
@ -6797,9 +6691,6 @@ public class PlayerInstance extends Playable
// Update the overloaded status of the PlayerInstance
player.refreshOverloaded(false);
// Update the expertise status of the PlayerInstance
player.refreshExpertisePenalty();
player.restoreFriendList();
player.loadRecommendations();
@ -9957,7 +9848,6 @@ public class PlayerInstance extends Playable
}
refreshOverloaded(true);
refreshExpertisePenalty();
broadcastUserInfo();
// Clear resurrect xp calculation
@ -10327,20 +10217,6 @@ public class PlayerInstance extends Playable
}
}
/**
* Expertise of the PlayerInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7)
* @return int Expertise skill level.
*/
public int getExpertiseLevel()
{
int level = getSkillLevel(239);
if (level < 0)
{
level = 0;
}
return level;
}
@Override
public void teleToLocation(ILocational loc, boolean allowRandomOffset)
{

View File

@ -289,8 +289,6 @@ public class PlayerStat extends PlayableStat
getActiveChar().broadcastStatusUpdate();
// Update the overloaded status of the PlayerInstance
getActiveChar().refreshOverloaded(true);
// Update the expertise status of the PlayerInstance
getActiveChar().refreshExpertisePenalty();
// Send a Server->Client packet UserInfo to the PlayerInstance
getActiveChar().sendPacket(new UserInfo(getActiveChar()));
// Send acquirable skill list

View File

@ -1,61 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.model.conditions;
import java.util.logging.Logger;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.skills.Skill;
/**
* The Class ConditionPlayerGrade.
* @author Gigiikun
*/
public class ConditionPlayerGrade extends Condition
{
protected static final Logger LOGGER = Logger.getLogger(ConditionPlayerGrade.class.getName());
// conditional values
public static final int COND_NO_GRADE = 0x0001;
public static final int COND_D_GRADE = 0x0002;
public static final int COND_C_GRADE = 0x0004;
public static final int COND_B_GRADE = 0x0008;
public static final int COND_A_GRADE = 0x0010;
public static final int COND_S_GRADE = 0x0020;
public static final int COND_S80_GRADE = 0x0040;
public static final int COND_S84_GRADE = 0x0080;
private final int _value;
/**
* Instantiates a new condition player grade.
* @param value the value
*/
public ConditionPlayerGrade(int value)
{
_value = value;
}
/**
*
*/
@Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{
return (effector.getActingPlayer() != null) && (_value == (byte) effector.getActingPlayer().getExpertiseLevel());
}
}

View File

@ -462,13 +462,6 @@ public abstract class Inventory extends ItemContainer
}
final PlayerInstance player = (PlayerInstance) inventory.getOwner();
// Any items equipped that result in expertise penalty do not give any skills at all.
if (item.getItem().getCrystalType().getId() > player.getExpertiseLevel())
{
return;
}
final AtomicBoolean update = new AtomicBoolean();
final AtomicBoolean updateTimestamp = new AtomicBoolean();
@ -1549,10 +1542,6 @@ public abstract class Inventory extends ItemContainer
try
{
unEquipItemInSlot(slot);
if (getOwner().isPlayer())
{
((PlayerInstance) getOwner()).refreshExpertisePenalty();
}
}
finally
{
@ -1682,15 +1671,7 @@ public abstract class Inventory extends ItemContainer
}
if (pdollSlot >= 0)
{
final ItemInstance old = setPaperdollItem(pdollSlot, null);
if (old != null)
{
if (getOwner().isPlayer())
{
((PlayerInstance) getOwner()).refreshExpertisePenalty();
}
}
return old;
return setPaperdollItem(pdollSlot, null);
}
return null;
}

View File

@ -44,8 +44,8 @@ public class EtcStatusUpdate implements IClientOutgoingPacket
packet.writeC(_player.getCharges()); // 1-7 increase force, lvl
packet.writeD(_player.getWeightPenalty()); // 1-4 weight penalty, lvl (1=50%, 2=66.6%, 3=80%, 4=100%)
packet.writeC(_player.getExpertiseWeaponPenalty()); // Weapon Grade Penalty [1-4]
packet.writeC(_player.getExpertiseArmorPenalty()); // Armor Grade Penalty [1-4]
packet.writeC(0); // Weapon Grade Penalty [1-4]
packet.writeC(0); // Armor Grade Penalty [1-4]
packet.writeC(0); // Death Penalty [1-15, 0 = disabled)], not used anymore in Ertheia
packet.writeC(_player.getChargedSouls());
packet.writeC(_mask);

View File

@ -30,14 +30,12 @@ public class ShopPreviewList implements IClientOutgoingPacket
private final int _listId;
private final Collection<Product> _list;
private final long _money;
private int _expertise;
public ShopPreviewList(ProductList list, long currentMoney, int expertiseIndex)
public ShopPreviewList(ProductList list, long currentMoney)
{
_listId = list.getListId();
_list = list.getProducts();
_money = currentMoney;
_expertise = expertiseIndex;
}
public ShopPreviewList(Collection<Product> lst, int listId, long currentMoney)
@ -59,7 +57,7 @@ public class ShopPreviewList implements IClientOutgoingPacket
int newlength = 0;
for (Product product : _list)
{
if ((product.getItem().getCrystalType().getId() <= _expertise) && product.getItem().isEquipable())
if (product.getItem().isEquipable())
{
newlength++;
}
@ -68,7 +66,7 @@ public class ShopPreviewList implements IClientOutgoingPacket
for (Product product : _list)
{
if ((product.getItem().getCrystalType().getId() <= _expertise) && product.getItem().isEquipable())
if (product.getItem().isEquipable())
{
packet.writeD(product.getItemId());
packet.writeH(product.getItem().getType2()); // item type2