[?]On-Screen Damage Text p464 High Elf

Salty Mike

hella salty
VIP
Неукротимое пламя
Сообщения
398
Розыгрыши
0
Решения
6
Репутация
205
Реакции
192
Баллы
1 438
Хроники
  1. Master Class
Исходники
Присутствуют
Сборка
приватный
Greetings everyone,

I've been messing around with the newest protocol version client (High Elves p464) and I can't seem to figure out how to display the ON-SCREEN DAMAGE TEXT.
The old system from Essence SevenSigns (p447) no longer works.

There is a new system triggered through the ExDamagePopUp packet. I've added the packet, with the proper structure taken directly from the client, but the text appears GREEN, all the time, regardless of what type of element I hit with and what type of elemental defence a monster has. It is never white/silver.

1720793622489.png



From what I could gather from the client, the TEXT color depends on the ELEMENTAL SPIRIT TYPE, as evident from this GFX code block:
1720793718645.png


I've used to convert the colors and the default is SILVER, as it should be, the FIRE is red, WATER is blue, etc.


The question is, where are these SPIRIT_TYPES provided from, or more specifically, how can I force a specific SPIRIT_TYPE to be used from within the SERVER CORE (which packet)?

Below is a screenshot of how the new DMG Text is being triggered in the GFX, where `attackType` equals the SPIRIT_TYPE. I've checked everywhere, but I couldn't find the culprit.
1720793932493.png
 
Damage should send as negative value

That's not it.

I'm already sending the negative damage value with the SystemMessage. It is how it was working on older chronicles, such as SevenSigns, but on HighElves, it wouldn't show, despite the fact that the structure hasn't changed.


EDIT: I stand corrected! This was the solution all along.
 
Последнее редактирование:
ExDamagePopup
Код:
package org.l2jmobius.gameserver.network.serverpackets;

import org.l2jmobius.commons.network.WritableBuffer;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.ServerPackets;

public class ExDamagePopUp extends ServerPacket
{
    public static final byte NOMAKE = 0;
    public static final byte NORMAL_ATTACK = 1;
    public static final byte CONSECUTIVE_ATTACK = 2;
    public static final byte CRITICAL = 3;
    public static final byte OVERHIT = 4;
    public static final byte RECOVER_HP = 5;
    public static final byte RECOVER_MP = 6;
    public static final byte GET_SP = 7;
    public static final byte GET_EXP = 8;
    public static final byte MAGIC_DEFIANCE = 9;
    public static final byte SHIELD_GUARD = 10;
    public static final byte DODGE = 11;
    public static final byte IMMUNE = 12;
    public static final byte SKILL_HIT = 13;
   
    private final int _caster;
    private final int _target;
    private final int _damage;
    private final byte _type;
   
    public ExDamagePopUp(int caster, int target, int damage, byte type)
    {
        _caster = caster;
        _target = target;
        _damage = damage;
        _type = type;
    }
   
    @Override
    public void writeImpl(GameClient client, WritableBuffer buffer)
    {
        ServerPackets.EX_DAMAGE_POPUP.writeId(this, buffer);
        buffer.writeInt(_caster);
        buffer.writeInt(_target);
        buffer.writeInt(-_damage);
        buffer.writeByte(_type);
    }
}

ExMagicAttackInfo
Код:
package org.l2jmobius.gameserver.network.serverpackets;

import org.l2jmobius.commons.network.WritableBuffer;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.ServerPackets;

/**
 * @author Sdw
 */
public class ExMagicAttackInfo extends ServerPacket
{
    // TODO: Enum
    public static final int CRITICAL = 1;
    public static final int CRITICAL_HEAL = 2;
    public static final int OVERHIT = 3;
    public static final int EVADED = 4;
    public static final int BLOCKED = 5;
    public static final int RESISTED = 6;
    public static final int IMMUNE = 7;
    public static final int IMMUNE2 = 8;
    public static final int P_CRITICAL = 10;
    public static final int M_CRITICAL = 11;
    
    private final int _caster;
    private final int _target;
    private final int _type;
    
    public ExMagicAttackInfo(int caster, int target, int type)
    {
        _caster = caster;
        _target = target;
        _type = type;
    }
    
    @Override
    public void writeImpl(GameClient client, WritableBuffer buffer)
    {
        ServerPackets.EX_MAGIC_ATTACK_INFO.writeId(this, buffer);
        buffer.writeInt(_caster);
        buffer.writeInt(_target);
        buffer.writeInt(_type);
    }
}
, check sendDamageMessage
 
ExDamagePopup
Код:
package org.l2jmobius.gameserver.network.serverpackets;

import org.l2jmobius.commons.network.WritableBuffer;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.ServerPackets;

public class ExDamagePopUp extends ServerPacket
{
    public static final byte NOMAKE = 0;
    public static final byte NORMAL_ATTACK = 1;
    public static final byte CONSECUTIVE_ATTACK = 2;
    public static final byte CRITICAL = 3;
    public static final byte OVERHIT = 4;
    public static final byte RECOVER_HP = 5;
    public static final byte RECOVER_MP = 6;
    public static final byte GET_SP = 7;
    public static final byte GET_EXP = 8;
    public static final byte MAGIC_DEFIANCE = 9;
    public static final byte SHIELD_GUARD = 10;
    public static final byte DODGE = 11;
    public static final byte IMMUNE = 12;
    public static final byte SKILL_HIT = 13;
 
    private final int _caster;
    private final int _target;
    private final int _damage;
    private final byte _type;
 
    public ExDamagePopUp(int caster, int target, int damage, byte type)
    {
        _caster = caster;
        _target = target;
        _damage = damage;
        _type = type;
    }
 
    @Override
    public void writeImpl(GameClient client, WritableBuffer buffer)
    {
        ServerPackets.EX_DAMAGE_POPUP.writeId(this, buffer);
        buffer.writeInt(_caster);
        buffer.writeInt(_target);
        buffer.writeInt(-_damage);
        buffer.writeByte(_type);
    }
}

ExMagicAttackInfo
Код:
package org.l2jmobius.gameserver.network.serverpackets;

import org.l2jmobius.commons.network.WritableBuffer;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.ServerPackets;

/**
 * @author Sdw
 */
public class ExMagicAttackInfo extends ServerPacket
{
    // TODO: Enum
    public static final int CRITICAL = 1;
    public static final int CRITICAL_HEAL = 2;
    public static final int OVERHIT = 3;
    public static final int EVADED = 4;
    public static final int BLOCKED = 5;
    public static final int RESISTED = 6;
    public static final int IMMUNE = 7;
    public static final int IMMUNE2 = 8;
    public static final int P_CRITICAL = 10;
    public static final int M_CRITICAL = 11;
 
    private final int _caster;
    private final int _target;
    private final int _type;
 
    public ExMagicAttackInfo(int caster, int target, int type)
    {
        _caster = caster;
        _target = target;
        _type = type;
    }
 
    @Override
    public void writeImpl(GameClient client, WritableBuffer buffer)
    {
        ServerPackets.EX_MAGIC_ATTACK_INFO.writeId(this, buffer);
        buffer.writeInt(_caster);
        buffer.writeInt(_target);
        buffer.writeInt(_type);
    }
}
, check sendDamageMessage

Thanks, but it turned out that the damage was reversed on my source compared to Mobius. On Mobius, the `damage` variable in the `sendDamageMessage()` method is already negative, while on my source it is positive.

The fix was what ChaosPaladin suggested - sending a negative value for DAMAGE with the `ExDamagePopUp` packet.

In my defence, I kept thinking that the old way of sending the damage - through a SystemMessage, was still required, but it is not.

For future reference, there were a bunch of additional messages in the UGX, here's the full list:

1720809480610.png
 
Последнее редактирование:
Назад
Сверху Снизу