Third part for Best Choice series quests.

Contributed by NightBR.
This commit is contained in:
MobiusDevelopment
2019-04-30 16:01:39 +00:00
parent b4df097529
commit 137d5cabd8
111 changed files with 1641 additions and 261 deletions

View File

@@ -123,6 +123,7 @@ import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChang
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.OnItemSoulCrystalAdd;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk;
import org.l2jmobius.gameserver.model.events.impl.olympiad.OnOlympiadMatchResult;
import org.l2jmobius.gameserver.model.events.impl.server.OnPacketReceived;
@@ -183,6 +184,7 @@ public enum EventType
ON_ITEM_CREATE(OnItemCreate.class, void.class),
ON_ITEM_TALK(OnItemTalk.class, void.class),
ON_ITEM_ATTRIBUTE_ADD(OnItemAttributeAdd.class, void.class),
ON_ITEM_SOUL_CRYSTAL_ADD(OnItemSoulCrystalAdd.class, void.class),
// NPC events
ON_NPC_CAN_BE_SEEN(OnNpcCanBeSeen.class, void.class, TerminateReturn.class),

View File

@@ -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 OnItemSoulCrystalAdd implements IBaseEvent
{
private final PlayerInstance _player;
private final ItemInstance _item;
public OnItemSoulCrystalAdd(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_SOUL_CRYSTAL_ADD;
}
}

View File

@@ -69,6 +69,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDr
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.OnItemSoulCrystalAdd;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.items.Armor;
@@ -2207,6 +2208,9 @@ public final class ItemInstance extends WorldObject
{
updateSpecialAbilities();
}
// Notify to Scripts
EventDispatcher.getInstance().notifyEventAsync(new OnItemSoulCrystalAdd(getActingPlayer(), this));
}
public void removeSpecialAbility(int position, int type)