Support for item equip and unequip listeners.
This commit is contained in:
parent
60e193f2bf
commit
8786792170
@ -192,10 +192,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2284,6 +2284,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2307,9 +2310,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -232,7 +233,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -244,6 +244,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -24,12 +24,12 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
@ -48,6 +48,6 @@ public class OnPlayerEquipItem implements IBaseEvent
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1267,6 +1270,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -193,10 +193,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2290,6 +2290,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2313,9 +2316,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -232,7 +233,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -244,6 +244,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -24,12 +24,12 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
@ -48,6 +48,6 @@ public class OnPlayerEquipItem implements IBaseEvent
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1273,6 +1276,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -194,10 +194,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2292,6 +2292,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2315,9 +2318,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -232,7 +233,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -244,6 +244,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -24,12 +24,12 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
@ -48,6 +48,6 @@ public class OnPlayerEquipItem implements IBaseEvent
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1273,6 +1276,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -192,10 +192,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2299,6 +2299,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2323,9 +2326,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -232,7 +233,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -244,6 +244,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -24,12 +24,12 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
@ -48,6 +48,6 @@ public class OnPlayerEquipItem implements IBaseEvent
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1273,6 +1276,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -192,10 +192,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2292,6 +2292,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2316,9 +2319,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -238,7 +239,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -250,6 +250,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1302,6 +1305,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -192,10 +192,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2292,6 +2292,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2316,9 +2319,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -238,7 +239,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -250,6 +250,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1378,6 +1381,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -192,10 +192,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2292,6 +2292,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2316,9 +2319,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -238,7 +239,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -250,6 +250,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1378,6 +1381,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -195,10 +195,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2224,6 +2224,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2246,9 +2249,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -238,7 +239,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -250,6 +250,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1371,6 +1374,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -194,10 +194,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2219,6 +2219,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2241,9 +2244,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -238,7 +239,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -250,6 +250,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1372,6 +1375,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -181,9 +181,9 @@ import org.l2jmobius.gameserver.model.effects.EffectType;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.playable.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerKarmaChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
@ -2301,6 +2301,10 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2324,9 +2328,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,10 +54,11 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerChat;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerKarmaChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
@ -187,7 +188,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
// Henna events
|
||||
ON_PLAYER_HENNA_ADD(OnPlayerHennaAdd.class, void.class),
|
||||
@ -198,6 +198,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Other player events
|
||||
ON_PLAYER_KARMA_CHANGED(OnPlayerKarmaChanged.class, void.class),
|
||||
ON_PLAYER_LEVEL_CHANGED(OnPlayerLevelChanged.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -36,7 +36,10 @@ import org.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.Item;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
@ -1116,6 +1119,17 @@ public abstract class Inventory extends ItemContainer
|
||||
item.updateDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -184,9 +184,9 @@ import org.l2jmobius.gameserver.model.effects.EffectType;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.playable.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerKarmaChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
@ -2212,6 +2212,10 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2235,9 +2239,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,10 +54,11 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerChat;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerKarmaChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
@ -187,7 +188,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
// Henna events
|
||||
ON_PLAYER_HENNA_ADD(OnPlayerHennaAdd.class, void.class),
|
||||
@ -198,6 +198,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Other player events
|
||||
ON_PLAYER_KARMA_CHANGED(OnPlayerKarmaChanged.class, void.class),
|
||||
ON_PLAYER_LEVEL_CHANGED(OnPlayerLevelChanged.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -36,7 +36,10 @@ import org.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.Item;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
@ -1116,6 +1119,17 @@ public abstract class Inventory extends ItemContainer
|
||||
item.updateDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -192,10 +192,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2250,6 +2250,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2273,9 +2276,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -232,7 +233,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -244,6 +244,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1273,6 +1276,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -192,10 +192,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2250,6 +2250,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2273,9 +2276,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -232,7 +233,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -244,6 +244,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1273,6 +1276,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -192,10 +192,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2248,6 +2248,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2271,9 +2274,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -232,7 +233,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -244,6 +244,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1302,6 +1305,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -195,10 +195,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2258,6 +2258,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2281,9 +2284,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,7 +78,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -116,6 +116,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -234,7 +235,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -246,6 +246,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1378,6 +1381,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -195,10 +195,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2258,6 +2258,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2281,9 +2284,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,7 +78,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -116,6 +116,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -234,7 +235,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -246,6 +246,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1378,6 +1381,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -197,10 +197,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2177,6 +2177,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2199,9 +2202,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,7 +78,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -116,6 +116,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -234,7 +235,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -246,6 +246,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
@ -1,53 +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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerEquipItem implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerEquipItem(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_EQUIP_ITEM;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OnPlayerItemEquip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemEquip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_EQUIP;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.events.impl.creature.player;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class OnPlayerItemUnequip implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnPlayerItemUnequip(PlayerInstance player, ItemInstance item)
|
||||
{
|
||||
_player = player;
|
||||
_item = item;
|
||||
}
|
||||
|
||||
public PlayerInstance getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public ItemInstance getItem()
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventType getType()
|
||||
{
|
||||
return EventType.ON_PLAYER_ITEM_UNEQUIP;
|
||||
}
|
||||
}
|
@ -44,7 +44,10 @@ import org.l2jmobius.gameserver.model.ArmorSet;
|
||||
import org.l2jmobius.gameserver.model.PlayerCondOverride;
|
||||
import org.l2jmobius.gameserver.model.VariationInstance;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.EtcItem;
|
||||
@ -1371,6 +1374,17 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
if (old != null)
|
||||
{
|
||||
final Creature owner = getOwner();
|
||||
if ((owner != null) && owner.isPlayer())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
@ -192,10 +192,10 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
|
||||
@ -2252,6 +2252,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
rechargeShots(true, true, false);
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemEquip(this, item), item.getItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2275,9 +2278,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
}
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerEquipItem(this, item), this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerEquipItem;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
|
||||
@ -114,6 +114,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
|
||||
@ -232,7 +233,6 @@ public enum EventType
|
||||
ON_PLAYER_CREATE(OnPlayerCreate.class, void.class),
|
||||
ON_PLAYER_DELETE(OnPlayerDelete.class, void.class),
|
||||
ON_PLAYER_DLG_ANSWER(OnPlayerDlgAnswer.class, void.class, TerminateReturn.class),
|
||||
ON_PLAYER_EQUIP_ITEM(OnPlayerEquipItem.class, void.class),
|
||||
ON_PLAYER_FAME_CHANGED(OnPlayerFameChanged.class, void.class),
|
||||
ON_PLAYER_FISHING(OnPlayerFishing.class, void.class),
|
||||
// Henna events
|
||||
@ -244,6 +244,8 @@ public enum EventType
|
||||
ON_PLAYER_ITEM_DROP(OnPlayerItemDrop.class, void.class),
|
||||
ON_PLAYER_ITEM_PICKUP(OnPlayerItemPickup.class, void.class),
|
||||
ON_PLAYER_ITEM_TRANSFER(OnPlayerItemTransfer.class, void.class),
|
||||
ON_PLAYER_ITEM_EQUIP(OnPlayerItemEquip.class, void.class),
|
||||
ON_PLAYER_ITEM_UNEQUIP(OnPlayerItemUnequip.class, void.class),
|
||||
// Mentoring events
|
||||
ON_PLAYER_MENTEE_ADD(OnPlayerMenteeAdd.class, void.class),
|
||||
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user