- r101 fixed error for friend memo (SQL).
- Fixed Awakening social action. - Implemented configs for awakening to skip or not Seize of Destiny quest and Scroll of Afterlife item. - Fixed mentee getting 2 letters with 2 headphones and fixed skill error, when adding mentee. - Implemented Change Attribute stone engine.
This commit is contained in:
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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 com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author Erlandys
|
||||
*/
|
||||
public class RequestChangeAttributeCancel extends L2GameClientPacket
|
||||
{
|
||||
|
||||
private static final String _C__D0_B7_SENDCHANGEATTRIBUTETARGETITEM = "[C] D0:B7 RequestChangeAttributeCancel";
|
||||
|
||||
@Override
|
||||
protected void readImpl()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void runImpl()
|
||||
{
|
||||
L2PcInstance player = getClient().getActiveChar();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
player.setActiveEnchantAttrItemId(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return _C__D0_B7_SENDCHANGEATTRIBUTETARGETITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
/*
|
||||
* 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 com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExChangeAttributeFail;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExChangeAttributeItemList;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExChangeAttributeOk;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.gameserver.network.serverpackets.UserInfo;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* @author Erlandys
|
||||
*/
|
||||
public class RequestChangeAttributeItem extends L2GameClientPacket
|
||||
{
|
||||
|
||||
private static final String _C__D0_B7_SENDCHANGEATTRIBUTETARGETITEM = "[C] D0:B7 SendChangeAttributeTargetItem";
|
||||
|
||||
private int _attributeOID, _itemOID, _newAttributeID;
|
||||
|
||||
@Override
|
||||
protected void readImpl()
|
||||
{
|
||||
_attributeOID = readD();
|
||||
_itemOID = readD();
|
||||
_newAttributeID = readD();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void runImpl()
|
||||
{
|
||||
L2PcInstance player = getClient().getActiveChar();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
L2ItemInstance item = player.getInventory().getItemByObjectId(_itemOID);
|
||||
|
||||
if (player.getPrivateStoreType() != PrivateStoreType.NONE)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_CHANGE_AN_ATTRIBUTE_WHILE_USING_A_PRIVATE_STORE_OR_WORKSHOP);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getActiveTradeList() != null)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_CHANGE_ATTRIBUTES_WHILE_EXCHANGING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!item.isWeapon())
|
||||
{
|
||||
player.setActiveEnchantAttrItemId(0);
|
||||
player.sendPacket(new ExChangeAttributeItemList(player, _attributeOID));
|
||||
return;
|
||||
}
|
||||
|
||||
if (_newAttributeID == -1)
|
||||
{
|
||||
player.setActiveEnchantAttrItemId(0);
|
||||
player.sendPacket(new ExChangeAttributeItemList(player, _attributeOID));
|
||||
return;
|
||||
}
|
||||
L2ItemInstance attribute = player.getInventory().getItemByObjectId(_attributeOID);
|
||||
player.getInventory().destroyItem("ChangingAttribute", _attributeOID, 1, player, null);
|
||||
|
||||
if (Rnd.get(100) < Config.CHANGE_CHANCE_ELEMENT)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_S_S2_ATTRIBUTE_HAS_SUCCESSFULLY_CHANGED_TO_S3_ATTRIBUTE);
|
||||
sm.addItemName(item);
|
||||
sm.addElemental(item.getAttackElementType());
|
||||
sm.addElemental(_newAttributeID);
|
||||
|
||||
item.changeAttribute((byte) _newAttributeID, item.getAttackElementPower());
|
||||
if (item.isEquipped())
|
||||
{
|
||||
item.updateElementAttrBonus(player);
|
||||
}
|
||||
|
||||
player.sendPacket(sm);
|
||||
player.sendPacket(new ExChangeAttributeOk());
|
||||
player.sendPacket(new UserInfo(player));
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(new ExChangeAttributeFail());
|
||||
player.sendPacket(SystemMessageId.CHANGING_ATTRIBUTES_HAS_BEEN_FAILED);
|
||||
}
|
||||
|
||||
// send packets
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
InventoryUpdate iu = new InventoryUpdate();
|
||||
iu.addModifiedItem(item);
|
||||
if (player.getInventory().getItemByObjectId(_attributeOID) == null)
|
||||
{
|
||||
iu.addRemovedItem(attribute);
|
||||
}
|
||||
else
|
||||
{
|
||||
iu.addModifiedItem(attribute);
|
||||
}
|
||||
player.sendPacket(iu);
|
||||
|
||||
player.setActiveEnchantAttrItemId(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return _C__D0_B7_SENDCHANGEATTRIBUTETARGETITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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 com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExChangeAttributeInfo;
|
||||
|
||||
/**
|
||||
* @author Erlandys
|
||||
*/
|
||||
public class SendChangeAttributeTargetItem extends L2GameClientPacket
|
||||
{
|
||||
|
||||
private static final String _C__D0_B0_SENDCHANGEATTRIBUTETARGETITEM = "[C] D0:B0 SendChangeAttributeTargetItem";
|
||||
int _elementOID;
|
||||
int _itemOID;
|
||||
|
||||
@Override
|
||||
protected void readImpl()
|
||||
{
|
||||
_elementOID = readD();
|
||||
_itemOID = readD();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void runImpl()
|
||||
{
|
||||
L2PcInstance player = getClient().getActiveChar();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
L2ItemInstance item = player.getInventory().getItemByObjectId(_itemOID);
|
||||
if (item == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
player.sendPacket(new ExChangeAttributeInfo(_elementOID, _itemOID, item.getAttackElementType()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return _C__D0_B0_SENDCHANGEATTRIBUTETARGETITEM;
|
||||
}
|
||||
}
|
@ -85,7 +85,7 @@ public class ConfirmMenteeAdd extends L2GameClientPacket
|
||||
MentorManager.getInstance().addMentor(mentor.getObjectId(), mentee.getObjectId());
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerMenteeAdd(mentor, mentee), mentor, mentee);
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerMenteeAdd(mentor, mentee), mentee);
|
||||
|
||||
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.FROM_NOW_ON_S1_WILL_BE_YOUR_MENTEE).addCharName(mentee));
|
||||
mentor.sendPacket(new ExMentorList(mentor));
|
||||
|
Reference in New Issue
Block a user