Addition of pet target type.

Contributed by manax182.
This commit is contained in:
MobiusDevelopment
2021-05-21 23:27:14 +00:00
parent 80d9daf414
commit 4da31e6e01
7 changed files with 100 additions and 2 deletions

View File

@@ -263,6 +263,7 @@ import handlers.targethandlers.NpcBody;
import handlers.targethandlers.Others;
import handlers.targethandlers.OwnerPet;
import handlers.targethandlers.PcBody;
import handlers.targethandlers.Pet;
import handlers.targethandlers.Self;
import handlers.targethandlers.Summon;
import handlers.targethandlers.Target;
@@ -626,6 +627,7 @@ public class MasterHandler
Others.class,
OwnerPet.class,
PcBody.class,
Pet.class,
Self.class,
Summon.class,
Target.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 handlers.targethandlers;
import org.l2jmobius.gameserver.handler.ITargetTypeHandler;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.skills.targets.TargetType;
/**
* @author Manax
*/
public class Pet implements ITargetTypeHandler
{
@Override
public Enum<TargetType> getTargetType()
{
return TargetType.PET;
}
@Override
public WorldObject getTarget(Creature creature, WorldObject selectedTarget, Skill skill, boolean forceUse, boolean dontMove, boolean sendMessage)
{
if (creature.isPet())
{
return creature.getPet();
}
return null;
}
}