L2SkillAgathion.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package net.sf.l2j.gameserver.skills.l2skills;
  16. import net.sf.l2j.gameserver.model.L2Character;
  17. import net.sf.l2j.gameserver.model.L2Object;
  18. import net.sf.l2j.gameserver.model.L2Skill;
  19. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  20. import net.sf.l2j.gameserver.templates.StatsSet;
  21. public class L2SkillAgathion extends L2Skill
  22. {
  23. private int _npcId;
  24. public L2SkillAgathion(StatsSet set)
  25. {
  26. super(set);
  27. _npcId = set.getInteger("npcId", 0);
  28. }
  29. @Override
  30. public void useSkill(L2Character caster, L2Object[] targets)
  31. {
  32. if (caster.isAlikeDead() || !(caster instanceof L2PcInstance))
  33. return;
  34. L2PcInstance activeChar = (L2PcInstance)caster;
  35. activeChar.setAgathionId(_npcId);
  36. activeChar.broadcastUserInfo();
  37. }
  38. }