Well i make it by me own.
And now i find the issue.
For a criature Undead, undead_weakness is -15, at race skill lvl 1 and all others weakness 0.
Even receiving 0 is add the others weakness to the array. So when u attack with others weakness even dont have negative parameters, the mob bugged receive the positive amount of attacker.
So far i saw, the add to array is here
Java:
package handlers.effecthandlers;
import java.util.EnumMap;
import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.stats.TraitType;
/**
* Defence Trait effect implementation.
* @author NosBit
*/
public class DefenceTrait extends AbstractEffect
{
private final Map<TraitType, Float> _defenceTraits = new EnumMap<>(TraitType.class);
public DefenceTrait(StatSet params)
{
if (params.isEmpty())
{
LOGGER.warning(getClass().getSimpleName() + ": must have parameters.");
return;
}
for (Entry<String, Object> param : params.getSet().entrySet())
{
_defenceTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}
@Override
public void onStart(Creature effector, Creature effected, Skill skill, Item item)
{
for (Entry<TraitType, Float> trait : _defenceTraits.entrySet())
{
if (trait.getValue().floatValue() < 1.0f)
{
effected.getStat().mergeDefenceTrait(trait.getKey(), trait.getValue().floatValue());
}
else
{
effected.getStat().mergeInvulnerableTrait(trait.getKey());
}
}
}
@Override
public void onExit(Creature effector, Creature effected, Skill skill)
{
for (Entry<TraitType, Float> trait : _defenceTraits.entrySet())
{
if (trait.getValue().floatValue() < 1.0f)
{
effected.getStat().removeDefenceTrait(trait.getKey(), trait.getValue().floatValue());
}
else
{
effected.getStat().removeInvulnerableTrait(trait.getKey());
}
}
}
}
but this part i really dont move further. My small knowledge dont let me find a solution. So i keep asking for help to try understand why this is add wrong values to the array.
ty