Addition of OnPlayerTakeHero event.

This commit is contained in:
MobiusDevelopment
2019-12-11 14:49:50 +00:00
parent 4869bc1745
commit 63c72de874
43 changed files with 655 additions and 2 deletions

View File

@ -45,6 +45,8 @@ import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
@ -948,6 +950,7 @@ public class Hero
loadFights(player.getObjectId());
loadDiary(player.getObjectId());
HERO_MESSAGE.put(player.getObjectId(), "");
EventDispatcher.getInstance().notifyEvent(new OnPlayerTakeHero(player));
updateHeroes(false);
}

View File

@ -111,6 +111,7 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSubCha
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonSpawn;
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.OnPlayerUnsummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
@ -266,6 +267,7 @@ public enum EventType
ON_PLAYER_SKILL_LEARN(OnPlayerSkillLearn.class, void.class),
ON_PLAYER_SUMMON_SPAWN(OnPlayerSummonSpawn.class, void.class),
ON_PLAYER_SUMMON_TALK(OnPlayerSummonTalk.class, void.class),
ON_PLAYER_TAKE_HERO(OnPlayerTakeHero.class, void.class),
ON_PLAYER_TRANSFORM(OnPlayerTransform.class, void.class),
ON_PLAYER_SUB_CHANGE(OnPlayerSubChange.class, void.class),
ON_PLAYER_QUEST_ABORT(OnPlayerQuestAbort.class, void.class),

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.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
/**
* @author Mobius
*/
public class OnPlayerTakeHero implements IBaseEvent
{
private final PlayerInstance _player;
public OnPlayerTakeHero(PlayerInstance player)
{
_player = player;
}
public PlayerInstance getPlayer()
{
return _player;
}
@Override
public EventType getType()
{
return EventType.ON_PLAYER_TAKE_HERO;
}
}