Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- java/net/sf/l2j/gameserver/model/zone/type/RaidLimitZone.java (revision 0)
- package net.sf.l2j.gameserver.model.zone.type;
- import net.sf.l2j.gameserver.model.actor.Creature;
- import net.sf.l2j.gameserver.model.actor.ai.CtrlIntention;
- import net.sf.l2j.gameserver.model.actor.instance.RaidBoss;
- import net.sf.l2j.gameserver.model.zone.SpawnZoneType;
- import net.sf.l2j.gameserver.model.zone.ZoneId;
- public class RaidLimitZone extends SpawnZoneType
- {
- private int _bossId;
- public RaidLimitZone(int id)
- {
- super(id);
- }
- @Override
- public void setParameter(String name, String value)
- {
- if (name.equals("bossId"))
- _bossId = Integer.parseInt(value);
- }
- @Override
- protected void onEnter(Creature character)
- {
- character.setInsideZone(ZoneId.RAID_LIMIT, true);
- }
- @Override
- protected void onExit(Creature character)
- {
- character.setInsideZone(ZoneId.RAID_LIMIT, false);
- if (character instanceof RaidBoss)
- {
- final RaidBoss raidboss = ((RaidBoss) character);
- if (raidboss.getNpcId() == _bossId)
- {
- raidboss.teleportTo(raidboss.getSpawn().getLoc(), 0);
- raidboss.setTarget(null);
- raidboss.getAI().setIntention(CtrlIntention.IDLE);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement