Daily Mission new handler additions and updates.

Contributed by CostyKiller.
This commit is contained in:
MobiusDevelopment
2022-11-06 23:29:45 +00:00
parent 4d6f30dc23
commit 9cfbb26557
88 changed files with 6584 additions and 2350 deletions

View File

@@ -36,6 +36,7 @@ public class DailyMissionDataHolder
private final int _id;
private final List<ItemHolder> _rewardsItems;
private final List<ClassId> _classRestriction;
private final int _requiredMissionCompleteId;
private final int _requiredCompletions;
private final StatSet _params;
private final boolean _dailyReset;
@@ -50,6 +51,7 @@ public class DailyMissionDataHolder
{
final Function<DailyMissionDataHolder, AbstractDailyMissionHandler> handler = DailyMissionHandler.getInstance().getHandler(set.getString("handler"));
_id = set.getInt("id");
_requiredMissionCompleteId = set.getInt("requiredMissionCompleteId", 0);
_requiredCompletions = set.getInt("requiredCompletion", 0);
_rewardsItems = set.getList("items", ItemHolder.class);
_classRestriction = set.getList("classRestriction", ClassId.class);
@@ -78,6 +80,11 @@ public class DailyMissionDataHolder
return _rewardsItems;
}
public int getRequiredMissionCompleteId()
{
return _requiredMissionCompleteId;
}
public int getRequiredCompletions()
{
return _requiredCompletions;

View File

@@ -59,7 +59,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcTeleport;
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcTeleportRequest;
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.OnPlayerAuctionWin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAugment;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerBecomeExalted;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerBecomeNoblesse;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerBypass;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCallToChangeClass;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerChangeToAwakenedClass;
@@ -94,6 +97,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMentee
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeLeft;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeRemove;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeTrainingComplete;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMentorStatus;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMoveRequest;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerPKChanged;
@@ -124,6 +128,8 @@ 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.OnItemCombination;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemCompound;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemCreate;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemEnchantAdd;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemSoulCrystalAdd;
@@ -189,6 +195,8 @@ public enum EventType
ON_ITEM_ATTRIBUTE_ADD(OnItemAttributeAdd.class, void.class),
ON_ITEM_SOUL_CRYSTAL_ADD(OnItemSoulCrystalAdd.class, void.class),
ON_ITEM_ENCHANT_ADD(OnItemEnchantAdd.class, void.class),
ON_ITEM_COMBINATION(OnItemCombination.class, void.class),
ON_ITEM_COMPOUND(OnItemCompound.class, void.class),
// NPC events
ON_NPC_CAN_BE_SEEN(OnNpcCanBeSeen.class, void.class, TerminateReturn.class),
@@ -219,9 +227,12 @@ public enum EventType
ON_PLAYABLE_EXP_CHANGED(OnPlayableExpChanged.class, void.class, TerminateReturn.class),
// Player events
ON_PLAYER_AUCTION_WIN(OnPlayerAuctionWin.class, void.class),
ON_PLAYER_AUGMENT(OnPlayerAugment.class, void.class),
ON_PLAYER_BYPASS(OnPlayerBypass.class, void.class, TerminateReturn.class),
ON_PLAYER_CALL_TO_CHANGE_CLASS(OnPlayerCallToChangeClass.class, void.class),
ON_PLAYER_BECOME_NOBLESSE(OnPlayerBecomeNoblesse.class, void.class),
ON_PLAYER_BECOME_EXALTED(OnPlayerBecomeExalted.class, void.class),
ON_PLAYER_CHAT(OnPlayerChat.class, void.class, ChatFilterReturn.class),
ON_PLAYER_ABILITY_POINTS_CHANGED(OnPlayerAbilityPointsChanged.class, void.class),
// Clan events
@@ -256,6 +267,7 @@ public enum EventType
ON_PLAYER_MENTEE_LEFT(OnPlayerMenteeLeft.class, void.class),
ON_PLAYER_MENTEE_REMOVE(OnPlayerMenteeRemove.class, void.class),
ON_PLAYER_MENTEE_STATUS(OnPlayerMenteeStatus.class, void.class),
ON_PLAYER_MENTEE_TRAINING_COMPLETE(OnPlayerMenteeTrainingComplete.class, void.class),
ON_PLAYER_MENTOR_STATUS(OnPlayerMentorStatus.class, void.class),
// Other player events
ON_PLAYER_REPUTATION_CHANGED(OnPlayerReputationChanged.class, void.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.creature.player;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
* @author CostyKiller
*/
public class OnPlayerAuctionWin implements IBaseEvent
{
private final Player _player;
private final Item _item;
public OnPlayerAuctionWin(Player player, Item item)
{
_player = player;
_item = item;
}
public Player getPlayer()
{
return _player;
}
public Item getItem()
{
return _item;
}
@Override
public EventType getType()
{
return EventType.ON_PLAYER_AUCTION_WIN;
}
}

View File

@@ -0,0 +1,45 @@
/*
* 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.Player;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
/**
* @author CostyKiller
*/
public class OnPlayerBecomeExalted implements IBaseEvent
{
private final Player _player;
public OnPlayerBecomeExalted(Player player)
{
_player = player;
}
public Player getPlayer()
{
return _player;
}
@Override
public EventType getType()
{
return EventType.ON_PLAYER_BECOME_EXALTED;
}
}

View File

@@ -0,0 +1,45 @@
/*
* 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.Player;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
/**
* @author CostyKiller
*/
public class OnPlayerBecomeNoblesse implements IBaseEvent
{
private final Player _player;
public OnPlayerBecomeNoblesse(Player player)
{
_player = player;
}
public Player getPlayer()
{
return _player;
}
@Override
public EventType getType()
{
return EventType.ON_PLAYER_BECOME_NOBLESSE;
}
}

View File

@@ -0,0 +1,52 @@
/*
* 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.Player;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
/**
* @author CostyKiller
*/
public class OnPlayerMenteeTrainingComplete implements IBaseEvent
{
private final Player _mentor;
private final Player _mentee;
public OnPlayerMenteeTrainingComplete(Player mentor, Player mentee)
{
_mentor = mentor;
_mentee = mentee;
}
public Player getMentor()
{
return _mentor;
}
public Player getMentee()
{
return _mentee;
}
@Override
public EventType getType()
{
return EventType.ON_PLAYER_MENTEE_TRAINING_COMPLETE;
}
}

View File

@@ -28,12 +28,14 @@ public class OnPlayerQuestComplete implements IBaseEvent
{
private final Player _player;
private final int _questId;
private final String _questName;
private final QuestType _questType;
public OnPlayerQuestComplete(Player player, int questId, QuestType questType)
public OnPlayerQuestComplete(Player player, int questId, String questName, QuestType questType)
{
_player = player;
_questId = questId;
_questName = questName;
_questType = questType;
}
@@ -47,6 +49,11 @@ public class OnPlayerQuestComplete implements IBaseEvent
return _questId;
}
public String getQuestName()
{
return _questName;
}
public QuestType getQuestType()
{
return _questType;

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.Player;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
* @author CostyKiller
*/
public class OnItemCombination implements IBaseEvent
{
private final Player _player;
private final Item _item;
public OnItemCombination(Player player, Item item)
{
_player = player;
_item = item;
}
public Player getPlayer()
{
return _player;
}
public Item getItem()
{
return _item;
}
@Override
public EventType getType()
{
return EventType.ON_ITEM_COMBINATION;
}
}

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.Player;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
* @author CostyKiller
*/
public class OnItemCompound implements IBaseEvent
{
private final Player _player;
private final Item _item;
public OnItemCompound(Player player, Item item)
{
_player = player;
_item = item;
}
public Player getPlayer()
{
return _player;
}
public Item getItem()
{
return _item;
}
@Override
public EventType getType()
{
return EventType.ON_ITEM_COMPOUND;
}
}

View File

@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.model.events.impl.item;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.ensoul.EnsoulStone;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
import org.l2jmobius.gameserver.model.item.instance.Item;
@@ -28,11 +29,13 @@ public class OnItemSoulCrystalAdd implements IBaseEvent
{
private final Player _player;
private final Item _item;
private final EnsoulStone _stone;
public OnItemSoulCrystalAdd(Player player, Item item)
public OnItemSoulCrystalAdd(Player player, Item item, EnsoulStone stone)
{
_player = player;
_item = item;
_stone = stone;
}
public Player getPlayer()
@@ -45,6 +48,11 @@ public class OnItemSoulCrystalAdd implements IBaseEvent
return _item;
}
public EnsoulStone getEnsoulStone()
{
return _stone;
}
@Override
public EventType getType()
{

View File

@@ -71,7 +71,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPi
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.OnItemEnchantAdd;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemSoulCrystalAdd;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk;
import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
@@ -2250,12 +2249,6 @@ public class Item extends WorldObject
{
updateSpecialAbilities();
}
// Notify to Scripts
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_SOUL_CRYSTAL_ADD))
{
EventDispatcher.getInstance().notifyEventAsync(new OnItemSoulCrystalAdd(getActingPlayer(), this));
}
}
public void removeSpecialAbility(int position, int type)

View File

@@ -729,7 +729,7 @@ public class QuestState
// Notify to scripts
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_QUEST_COMPLETE, _player))
{
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerQuestComplete(_player, getQuest().getId(), type), _player);
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerQuestComplete(_player, getQuest().getId(), getQuestName(), type), _player);
}
}
@@ -819,7 +819,7 @@ public class QuestState
// Notify to scripts
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_QUEST_COMPLETE, _player))
{
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerQuestComplete(_player, getQuest().getId(), repeatable ? QuestType.REPEATABLE : QuestType.ONE_TIME), _player);
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerQuestComplete(_player, getQuest().getId(), getQuestName(), repeatable ? QuestType.REPEATABLE : QuestType.ONE_TIME), _player);
}
}

View File

@@ -25,6 +25,9 @@ import org.l2jmobius.gameserver.data.xml.ItemCrystallizationData;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.enums.Race;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemCombination;
import org.l2jmobius.gameserver.model.holders.ItemChanceHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.item.type.CrystalType;
@@ -249,7 +252,11 @@ public class RequestCrystallizeItem implements ClientPacket
sm = new SystemMessage(SystemMessageId.S1_HAS_BEEN_CRYSTALLIZED);
sm.addItemName(removedItem);
player.sendPacket(sm);
// Notify to scripts.
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_COMBINATION))
{
EventDispatcher.getInstance().notifyEventAsync(new OnItemCombination(player, removedItem));
}
player.broadcastUserInfo();
player.setInCrystallize(false);

View File

@@ -24,6 +24,9 @@ import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.enums.Race;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.alchemy.AlchemyCraftData;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemCombination;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.ItemTemplate;
import org.l2jmobius.gameserver.model.item.instance.Item;
@@ -197,6 +200,16 @@ public class RequestAlchemyConversion implements ClientPacket
player.getInventory().addItem("Alchemy", data.getProductionFailure().getId(), data.getProductionFailure().getCount() * failureCount, player, null);
}
// Notify to scripts.
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_COMBINATION))
{
for (ItemHolder ingredient : data.getIngredients())
{
final Item item = player.getInventory().getItemByItemId(ingredient.getId());
EventDispatcher.getInstance().notifyEventAsync(new OnItemCombination(player, item));
}
}
player.sendPacket(new ExAlchemyConversion(successCount, failureCount));
}
}

View File

@@ -20,6 +20,9 @@ import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.CombinationItemsData;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.actor.request.CompoundRequest;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemCompound;
import org.l2jmobius.gameserver.model.item.combination.CombinationItem;
import org.l2jmobius.gameserver.model.item.combination.CombinationItemReward;
import org.l2jmobius.gameserver.model.item.combination.CombinationItemType;
@@ -118,6 +121,11 @@ public class RequestNewEnchantTry implements ClientPacket
{
player.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId()));
}
// Notify to scripts.
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_COMPOUND))
{
EventDispatcher.getInstance().notifyEventAsync(new OnItemCompound(player, success ? item : itemOne));
}
}
final InventoryUpdate iu = new InventoryUpdate();

View File

@@ -22,6 +22,9 @@ import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
import org.l2jmobius.gameserver.model.ensoul.EnsoulStone;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.item.OnItemSoulCrystalAdd;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.AbnormalType;
@@ -60,7 +63,6 @@ public class RequestItemEnsoul implements ClientPacket
_options[i] = new EnsoulItemOption(type, position, soulCrystalObjectId, soulCrystalOption);
}
}
return;
}
}
@@ -217,6 +219,12 @@ public class RequestItemEnsoul implements ClientPacket
{
item.addSpecialAbility(option, position, stone.getSlotType(), true);
success = 1;
// Notify to Scripts
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_SOUL_CRYSTAL_ADD))
{
EventDispatcher.getInstance().notifyEventAsync(new OnItemSoulCrystalAdd(player, item, stone));
}
}
if (soulCrystal.isStackable() && (soulCrystal.getCount() > 0))