Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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 ai.group_template;
- import net.sf.l2j.gameserver.datatables.SkillTable;
- import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.model.quest.Quest;
- import net.sf.l2j.gameserver.serverpackets.CreatureSay;
- import net.sf.l2j.util.Rnd;
- /**
- * Frenzy behavior on low health.
- * Few others monsters got that skillId too, need to check "retail C4" :
- * and remove npc_skills for those too.
- * Halisha's Officer
- * Executioner of Halisha
- * by Karakan for L2JLisvus
- */
- public class FrenzyOnAttack extends Quest
- {
- private static final int BREKA_ORC_OVERLORD = 270;
- private static final int TUREK_ORC_OVERLORD = 495;
- private static final int TIMAK_ORC_OVERLORD = 588;
- private static final int RAGNA_ORC_OVERLORD = 778;
- private static final int HAMES_ORC_OVERLORD = 1116;
- private static final int ALPEN_KOOKABURRA = 1468;
- private static final int ALPEN_KOOKABURRA2 = 1469;
- private static final int ALPEN_BUFFALO = 1487;
- private static final int ALPEN_BUFFALO2 = 1488;
- private static final int ALPEN_COUGAR = 1506;
- private static final int ALPEN_COUGAR2 = 1507;
- //private static final int HALISHAS_OFFICER = 12955;
- //private static final int HALISHAS_OFFICER2 = 12961;
- //private static final int HALISHAS_OFFICER3 = 12964;
- //private static final int EXECUTIONER_OF_HALISHA = 12993;
- //private static final int EXECUTIONER_OF_HALISHA2 = 12994;
- //private static final int EXECUTIONER_OF_HALISHA3 = 12995;
- //private static final int EXECUTIONER_OF_HALISHA4 = 12996;
- //private static final int EXECUTIONER_OF_HALISHA5 = 12997;
- //private static final int EXECUTIONER_OF_HALISHA6 = 12998;
- //private static final int EXECUTIONER_OF_HALISHA7 = 12999;
- //private static final int EXECUTIONER_OF_HALISHA8 = 13000;
- private static final String[] ORCS_WORDS =
- {
- "Dear ultimate power!!!",
- "The battle has just begun!",
- "I never thought I'd use this against a novice!",
- "You won't take me down easily."
- };
- public FrenzyOnAttack (int questId, String name, String descr)
- {
- super(questId, name, descr);
- int[] mobs =
- {
- BREKA_ORC_OVERLORD,
- TUREK_ORC_OVERLORD,
- TIMAK_ORC_OVERLORD,
- RAGNA_ORC_OVERLORD,
- HAMES_ORC_OVERLORD,
- ALPEN_KOOKABURRA,
- ALPEN_KOOKABURRA2,
- ALPEN_BUFFALO,
- ALPEN_BUFFALO2,
- ALPEN_COUGAR,
- ALPEN_COUGAR2
- // HALISHAS_OFFICER,
- // HALISHAS_OFFICER,
- // HALISHAS_OFFICER,
- // EXECUTIONER_OF_HALISHA,
- // EXECUTIONER_OF_HALISHA2,
- // EXECUTIONER_OF_HALISHA3,
- // EXECUTIONER_OF_HALISHA4,
- // EXECUTIONER_OF_HALISHA5,
- // EXECUTIONER_OF_HALISHA6,
- // EXECUTIONER_OF_HALISHA7,
- // EXECUTIONER_OF_HALISHA8
- };
- registerMobs(mobs);
- }
- @Override
- public String onAttack(L2NpcInstance npc, L2PcInstance attacker, int damage, boolean isPet)
- {
- // The only requirements are HP < 25%.
- if (npc.getCurrentHp() / npc.getMaxHp() < 0.25 && Rnd.get(10) == 0)
- {
- npc.broadcastPacket(new CreatureSay(npc.getObjectId(),0,npc.getName(),(ORCS_WORDS[Rnd.get(ORCS_WORDS.length)])));
- npc.setTarget(npc);
- //ULTIMATE_BUFF
- npc.doCast(SkillTable.getInstance().getInfo(4318,1));
- }
- return super.onAttack(npc, attacker, damage, isPet);
- }
- public static void main(String[] args)
- {
- // Quest class and state definition
- new FrenzyOnAttack(-1, "frenzyonattack", "ai/group_template");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement