Сообщений: 25
Тем: 9
Зарегистрирован: Oct 2012
Репутация:
0
I'm just having a problem with this packet.
RequestAcquireAbilityList.
Код: public class RequestAcquireAbilityList extends L2GameClientPacket
{
private int count1;
private int count2;
private int skillId;
private int skillLvl;
private int unk1;
private int unk2;
@Override
protected void readImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if(activeChar == null)
{
return;
}
count1 = readD();
count2 = readD();
if(count2 == 1)
{
for(int i = 0; i < 2; i++)
{
skillId = readD();
skillLvl = readD();
activeChar.addAbility(skillId, skillLvl);
_log.log(Level.DEBUG, "count = " + count1 + " count2 = " + count1 + "skillId = " + skillId + "skillLvl = " + skillLvl + "unk1 & 2 = " + unk1 + " " + unk2);
}
}
else
{
for(int i = 0; i < count2; i++)
{
skillId = readD();
skillLvl = readD();
activeChar.addAbility(skillId, skillLvl);
_log.log(Level.DEBUG, "count = " + count1 + " count2 = " + count1 + "skillId = " + skillId + "skillLvl = " + skillLvl + "unk1 & 2 = " + unk1 + " " + unk2);
}
}
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if(activeChar == null)
{
return;
}
if(activeChar.getOlympiadController().isPlayingNow())
{
return;
}
activeChar.addAbilityPoints(count2);
activeChar.addAbility(skillId, skillLvl);
activeChar.sendPacket(new ExAcquireAPSkillList(activeChar));
}
@Override
public String getType()
{
return getClass().getSimpleName();
}
}
Сообщений: 441
Тем: 15
Зарегистрирован: Oct 2012
Репутация:
3,319
tuningxtreme Написал:I'm just having a problem with this packet.
RequestAcquireAbilityList.
Код: public class RequestAcquireAbilityList extends L2GameClientPacket
{
private int count1;
private int count2;
private int skillId;
private int skillLvl;
private int unk1;
private int unk2;
@Override
protected void readImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if(activeChar == null)
{
return;
}
count1 = readD();
count2 = readD();
if(count2 == 1)
{
for(int i = 0; i < 2; i++)
{
skillId = readD();
skillLvl = readD();
activeChar.addAbility(skillId, skillLvl);
_log.log(Level.DEBUG, "count = " + count1 + " count2 = " + count1 + "skillId = " + skillId + "skillLvl = " + skillLvl + "unk1 & 2 = " + unk1 + " " + unk2);
}
}
else
{
for(int i = 0; i < count2; i++)
{
skillId = readD();
skillLvl = readD();
activeChar.addAbility(skillId, skillLvl);
_log.log(Level.DEBUG, "count = " + count1 + " count2 = " + count1 + "skillId = " + skillId + "skillLvl = " + skillLvl + "unk1 & 2 = " + unk1 + " " + unk2);
}
}
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if(activeChar == null)
{
return;
}
if(activeChar.getOlympiadController().isPlayingNow())
{
return;
}
activeChar.addAbilityPoints(count2);
activeChar.addAbility(skillId, skillLvl);
activeChar.sendPacket(new ExAcquireAPSkillList(activeChar));
}
@Override
public String getType()
{
return getClass().getSimpleName();
}
}
What a problem? Explain pls
Сообщений: 25
Тем: 9
Зарегистрирован: Oct 2012
Репутация:
0
elastic Написал:What a problem? Explain pls
The points are ok, all ok, however I can not save in db.
Сообщений: 441
Тем: 15
Зарегистрирован: Oct 2012
Репутация:
3,319
tuningxtreme Написал:The points are ok, all ok, however I can not save in db. Man, you can do this very easy obviously... Its not a serious problem i think
Сообщений: 527
Тем: 17
Зарегистрирован: Oct 2010
Репутация:
1,919
11-18-2014, 05:01 PM
(Сообщение последний раз редактировалось: 11-18-2014, 05:46 PM Mifesto.)
tuningxtreme Написал:I'm just having a problem with this packet.
RequestAcquireAbilityList.
Код: public class RequestAcquireAbilityList extends L2GameClientPacket
{
private int count1;
private int count2;
private int skillId;
private int skillLvl;
private int unk1;
private int unk2;
@Override
protected void readImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if(activeChar == null)
{
return;
}
count1 = readD();
count2 = readD();
if(count2 == 1)
{
for(int i = 0; i < 2; i++)
{
skillId = readD();
skillLvl = readD();
activeChar.addAbility(skillId, skillLvl);
_log.log(Level.DEBUG, "count = " + count1 + " count2 = " + count1 + "skillId = " + skillId + "skillLvl = " + skillLvl + "unk1 & 2 = " + unk1 + " " + unk2);
}
}
else
{
for(int i = 0; i < count2; i++)
{
skillId = readD();
skillLvl = readD();
activeChar.addAbility(skillId, skillLvl);
_log.log(Level.DEBUG, "count = " + count1 + " count2 = " + count1 + "skillId = " + skillId + "skillLvl = " + skillLvl + "unk1 & 2 = " + unk1 + " " + unk2);
}
}
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if(activeChar == null)
{
return;
}
if(activeChar.getOlympiadController().isPlayingNow())
{
return;
}
activeChar.addAbilityPoints(count2);
activeChar.addAbility(skillId, skillLvl);
activeChar.sendPacket(new ExAcquireAPSkillList(activeChar));
}
@Override
public String getType()
{
return getClass().getSimpleName();
}
}
RequestAcquireAbilityList
Код: /**
* @user: Mifesto
* @date: 19:03/08.09.2014
* @team: http://mmo-core.ru/
* @desc:
* TODO: Проверку на очки умений (защиты от пакет хаков и тд).
*/
public class RequestAcquireAbilityList extends L2GameClientPacket
{
private List<SkillHolder> _skills;
@Override
protected void readImpl()
{
_skills = new ArrayList<>();
readD(); // Total size
for(int i = 0; i < 3; i++)
{
int size = readD();
for (int j = 0; j < size; j++) {
_skills.add(new SkillHolder(readD(), readD()));
}
}
}
@Override
protected void runImpl()
{
L2PcInstance player = getClient().getActiveChar();
if(player != null)
{
for(SkillHolder holder : _skills)
{
L2SkillLearn learn = SkillTreesData.getInstance().getAbilitySkill(holder.getSkillId(), holder.getSkillLvl());
if(learn == null)
{
_log.warn("SkillLearn " + holder.getSkillId() + "(" + holder.getSkillLvl() + ") not found!");
player.sendActionFailed();
break;
}
L2Skill skill = holder.getSkill();
if(skill == null)
{
_log.warn("SkillLearn " + holder.getSkillId() + "(" + holder.getSkillLvl() + ") not found!");
player.sendActionFailed();
break;
}
player.addSkill(skill, true);
}
player.sendPacket(new ExAcquireAPSkillList(player));
}
}
@Override
public String getType()
{
return "[C] D0:E9 RequestAcquireAbilityList";
}
}
Working packet, it is necessary to add the pair of verifications.
Сообщений: 25
Тем: 9
Зарегистрирован: Oct 2012
Репутация:
0
Mifesto Написал:
RequestAcquireAbilityList
Код: /**
* @user: Mifesto
* @date: 19:03/08.09.2014
* @team: http://mmo-core.ru/
* @desc:
* TODO: Проверку на очки умений (защиты от пакет хаков и тд).
*/
public class RequestAcquireAbilityList extends L2GameClientPacket
{
private List<SkillHolder> _skills;
@Override
protected void readImpl()
{
_skills = new ArrayList<>();
readD(); // Total size
for(int i = 0; i < 3; i++)
{
int size = readD();
for (int j = 0; j < size; j++) {
_skills.add(new SkillHolder(readD(), readD()));
}
}
}
@Override
protected void runImpl()
{
L2PcInstance player = getClient().getActiveChar();
if(player != null)
{
for(SkillHolder holder : _skills)
{
L2SkillLearn learn = SkillTreesData.getInstance().getAbilitySkill(holder.getSkillId(), holder.getSkillLvl());
if(learn == null)
{
_log.warn("SkillLearn " + holder.getSkillId() + "(" + holder.getSkillLvl() + ") not found!");
player.sendActionFailed();
break;
}
L2Skill skill = holder.getSkill();
if(skill == null)
{
_log.warn("SkillLearn " + holder.getSkillId() + "(" + holder.getSkillLvl() + ") not found!");
player.sendActionFailed();
break;
}
player.addSkill(skill, true);
}
player.sendPacket(new ExAcquireAPSkillList(player));
}
}
@Override
public String getType()
{
return "[C] D0:E9 RequestAcquireAbilityList";
}
}
Working packet, it is necessary to add the pair of verifications. Thanks brother, I'll work now.
Сообщений: 15
Тем: 0
Зарегистрирован: Feb 2012
Репутация:
-6
elastic Написал:Уважаемые! Объясните мне, пожалуйста, как работает это зловредное поле в панели новых абилок? Вроде описание читал к системе, какими только способами не реализовывал отображение оставшихся очков - получается ерунда... В моем самом первом варианте все было более-менее, но когда расходуешь последнее очко, то оно либо не расходуется вовсе, либо значение уходит в минус. А еще заметил явление, что поле с остатком очков отображает значение с противоположным знаком. Скрин ниже:
Кто-нибудь может прояснить ситуацию?
Я лох, нашел ошибку. :pandaredlol:
Hello Elastik,
im right now at the same part/error... how did you fixed that shitty thingy?
Thanks in advance...
Сообщений: 441
Тем: 15
Зарегистрирован: Oct 2012
Репутация:
3,319
jalemao Написал:Hello Elastik,
im right now at the same part/error... how did you fixed that shitty thingy?
Thanks in advance... Oh, this thing is so stupid:redlol:
This field shows how many points you can use after skill learn.
For example:
Код: public int getUsedAcquirePoints()
{
int consume = 0;
for(Skill skill : getAllSkills())
{
if(skill.getAcquirePointsConsumeMulLevel() > 0)
{
consume += skill.getAcquirePointsConsumeMulLevel();
}
}
return consume;
}
Client automatically calculates a final count of points. Just send this info in ExAcquireAPSkillList, it should be ok
Сообщений: 15
Тем: 0
Зарегистрирован: Feb 2012
Репутация:
-6
elastic Написал:Oh, this thing is so stupid:redlol:
This field shows how many points you can use after skill learn.
For example:
Код: public int getUsedAcquirePoints()
{
int consume = 0;
for(Skill skill : getAllSkills())
{
if(skill.getAcquirePointsConsumeMulLevel() > 0)
{
consume += skill.getAcquirePointsConsumeMulLevel();
}
}
return consume;
}
Client automatically calculates a final count of points. Just send this info in ExAcquireAPSkillList, it should be ok
OMG rly? and i tryd to make a F**** calc for all that hahahah ty mate
Edit :
How did you got : getAcquirePointsConsumeMulLevel?
Сообщений: 441
Тем: 15
Зарегистрирован: Oct 2012
Репутация:
3,319
jalemao Написал:OMG rly? and i tryd to make a F**** calc for all that hahahah ty mate
Edit :
How did you got : getAcquirePointsConsumeMulLevel? This method returns "skill points consume * skill_learned_level" as i remember, the first idea which came to my head, but it works :redlol:
|