Addition of second part of Best Choice series quest.
Contributed by NightBR.
This commit is contained in:
@@ -100,6 +100,8 @@ public final class Elementals
|
||||
|
||||
public enum ElementalItems
|
||||
{
|
||||
attributePracticeFireStone(FIRE, 48169, ElementalItemType.Stone, 0),
|
||||
|
||||
fireStone(FIRE, 9546, ElementalItemType.Stone, 0),
|
||||
waterStone(WATER, 9547, ElementalItemType.Stone, 0),
|
||||
windStone(WIND, 9549, ElementalItemType.Stone, 0),
|
||||
|
@@ -120,6 +120,7 @@ import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceDestroy;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceEnter;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceLeave;
|
||||
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange;
|
||||
import org.l2jmobius.gameserver.model.events.impl.item.OnItemAttributeAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent;
|
||||
import org.l2jmobius.gameserver.model.events.impl.item.OnItemCreate;
|
||||
import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk;
|
||||
@@ -181,6 +182,7 @@ public enum EventType
|
||||
ON_ITEM_BYPASS_EVENT(OnItemBypassEvent.class, void.class),
|
||||
ON_ITEM_CREATE(OnItemCreate.class, void.class),
|
||||
ON_ITEM_TALK(OnItemTalk.class, void.class),
|
||||
ON_ITEM_ATTRIBUTE_ADD(OnItemAttributeAdd.class, void.class),
|
||||
|
||||
// NPC events
|
||||
ON_NPC_CAN_BE_SEEN(OnNpcCanBeSeen.class, void.class, TerminateReturn.class),
|
||||
|
@@ -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.item;
|
||||
|
||||
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 NightBR
|
||||
*/
|
||||
public class OnItemAttributeAdd implements IBaseEvent
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final ItemInstance _item;
|
||||
|
||||
public OnItemAttributeAdd(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_ITEM_ATTRIBUTE_ADD;
|
||||
}
|
||||
}
|
@@ -67,6 +67,7 @@ import org.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAugment;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
|
||||
import org.l2jmobius.gameserver.model.events.impl.item.OnItemAttributeAdd;
|
||||
import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent;
|
||||
import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk;
|
||||
import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@@ -1215,6 +1216,9 @@ public final class ItemInstance extends WorldObject
|
||||
_elementals.put(holder.getType(), holder);
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to Scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemAttributeAdd(getActingPlayer(), this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -104,6 +104,14 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
// Quest Q10579_ContainingTheAttributePower check.
|
||||
if ((item.getItem().getId() == 48168) && (stone.getItem().getId() != 48169))
|
||||
{
|
||||
player.removeRequest(request.getClass());
|
||||
client.sendPacket(SystemMessageId.ATTRIBUTE_ITEM_USAGE_HAS_BEEN_CANCELLED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!item.isElementable())
|
||||
{
|
||||
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
|
||||
|
Reference in New Issue
Block a user