Skip to content
Snippets Groups Projects
Commit d980f024 authored by malyelfik's avatar malyelfik
Browse files

BETA: '''Frozen Labyrinth''' AI and minor update for '''Frightened Ragna Orc''' AI

Patch by: malyelfik, !UnAfraid
Reviewed by: !UnAfraid
parent 2ca37c3b
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,7 @@ ai/group_template/EnergySeeds.java
ai/group_template/EvasGiftBoxes.java
ai/group_template/FairyTrees.java
ai/group_template/FeedableBeasts.java
ai/group_template/FrozenLabyrinth.java
ai/group_template/GiantScouts.java
ai/group_template/Monastery.java
ai/group_template/NonLethalableNpcs.java
......
/*
* 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 ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.skills.L2Skill;
/**
* Frozen Labyrinth AI
* @author malyelfik
*/
public final class FrozenLabyrinth extends AbstractNpcAI
{
// Monsters
private static final int PRONGHORN_SPIRIT = 22087;
private static final int PRONGHORN = 22088;
private static final int LOST_BUFFALO = 22093;
private static final int FROST_BUFFALO = 22094;
private FrozenLabyrinth(String name, String descr)
{
super(name, descr);
addAttackId(PRONGHORN, FROST_BUFFALO);
}
@Override
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet, L2Skill skill)
{
if (skill != null && !skill.isMagic())
{
int spawnId = LOST_BUFFALO;
if (npc.getNpcId() == PRONGHORN)
{
spawnId = PRONGHORN_SPIRIT;
}
int diff = 0;
for (int i = 0; i < 6; i++)
{
int x = diff < 60 ? npc.getX() + diff : npc.getX();
int y = diff >= 60 ? npc.getY() + (diff - 40) : npc.getY();
final L2Attackable monster = (L2Attackable) addSpawn(spawnId, x, y, npc.getZ(), npc.getHeading(), false, 0);
attackPlayer(monster, attacker);
diff += 20;
}
npc.deleteMe();
}
return super.onAttack(npc, attacker, damage, isPet, skill);
}
public static void main(String[] args)
{
new FrozenLabyrinth(FrozenLabyrinth.class.getSimpleName(), "ai/group_template");
}
}
\ No newline at end of file
......@@ -35,8 +35,6 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
{
// NPC ID
private static final int MOB_ID = 18807;
// Amount of Health
private static final int HP = 4500;
// Chances
private static final int ADENA = 10000;
private static final int CHANCE = 1000;
......@@ -60,7 +58,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
npc.setScriptValue(1);
startQuestTimer("say", (getRandom(5) + 3) * 1000, npc, null, true);
}
else if ((npc.getCurrentHp() <= HP) && npc.isScriptValue(1))
else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.2)) && npc.isScriptValue(1))
{
startQuestTimer("reward", 10000, npc, attacker);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.WAIT_WAIT_STOP_SAVE_ME_AND_ILL_GIVE_YOU_10000000_ADENA);
......@@ -135,7 +133,6 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition((npc.getX() + getRandom(-800, 800)), (npc.getY() + getRandom(-800, 800)), npc.getZ(), npc.getHeading()));
npc.deleteMe();
npc.setScriptValue(0);
break;
}
}
......
......@@ -87,9 +87,7 @@ INSERT INTO `minions` VALUES
(22028,22027,3,4),
(22080,22079,3,3),
(22084,22083,3,3),
(22088,22087,3,3),
(22092,22091,3,3),
(22094,22093,6,6),
(22096,22095,3,3),
(22100,22099,8,8),
(22102,22101,8,8),
......
......@@ -32494,46 +32494,6 @@ INSERT INTO `spawnlist` VALUES
("Ice Merchant/Frozen", 1, 22086, 117812, -104741, -1313, 0, 0, 58513, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22086, 121220, -106261, -2146, 0, 0, 19918, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22086, 121211, -106635, -2142, 0, 0, 946, 60, 0, 0),
-- Pronghorn Spirit
("Ice Merchant/Frozen", 1, 22087, 127894, -107035, -2774, 0, 0, 28349, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127903, -106538, -2774, 0, 0, 21837, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128325, -106280, -2774, 0, 0, 5774, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128548, -106669, -2774, 0, 0, 58745, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128491, -107112, -2774, 0, 0, 719, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128012, -107263, -2774, 0, 0, 33738, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127498, -107304, -2774, 0, 0, 31242, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127401, -107681, -2774, 0, 0, 46229, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127595, -107882, -2774, 0, 0, 57159, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128187, -107365, -2774, 0, 0, 26635, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127579, -106946, -2774, 0, 0, 24837, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128493, -106549, -2774, 0, 0, 64957, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 123941, -110970, -2592, 0, 0, 61648, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 124286, -110964, -2592, 0, 0, 55652, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 124499, -110517, -2592, 0, 0, 11257, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 124317, -110107, -2592, 0, 0, 21013, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 123889, -110083, -2592, 0, 0, 52584, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 123486, -110239, -2592, 0, 0, 35670, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 123348, -110705, -2592, 0, 0, 46352, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 123830, -110697, -2592, 0, 0, 63813, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 123775, -110398, -2592, 0, 0, 17552, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 120185, -113045, -2314, 0, 0, 36589, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 120514, -113468, -2314, 0, 0, 56951, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 120473, -114168, -2315, 0, 0, 48771, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 121280, -114175, -2316, 0, 0, 56262, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 121597, -113599, -2329, 0, 0, 10992, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 121243, -113057, -2320, 0, 0, 28022, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 121581, -112725, -2319, 0, 0, 7132, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 121282, -112387, -2315, 0, 0, 7730, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 120395, -112323, -2314, 0, 0, 28218, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128394, -111517, -2774, 0, 0, 63818, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127892, -112000, -2774, 0, 0, 39329, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127605, -111602, -2774, 0, 0, 31578, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127870, -111075, -2774, 0, 0, 11848, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128231, -110366, -2774, 0, 0, 11981, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128059, -111359, -2774, 0, 0, 43203, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127418, -110725, -2774, 0, 0, 23380, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 128442, -111104, -2775, 0, 0, 58553, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22087, 127060, -110055, -2774, 0, 0, 29240, 60, 0, 0),
-- Pronghorn
("Ice Merchant/Frozen", 1, 22088, 127578, -110473, -2774, 0, 0, 17039, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22088, 128230, -106844, -2774, 0, 0, 43250, 60, 0, 0),
......@@ -32593,41 +32553,6 @@ INSERT INTO `spawnlist` VALUES
("Ice Merchant/Frozen", 1, 22092, 127232, -115502, -2584, 0, 0, 32313, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22092, 127976, -119797, -2587, 0, 0, 22405, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22092, 126437, -118775, -2584, 0, 0, 53429, 60, 0, 0),
-- Lost Buffalo
("Ice Merchant/Frozen", 1, 22093, 125127, -122279, -2614, 0, 0, 59719, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 124816, -122479, -2639, 0, 0, 29471, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 124285, -122410, -2581, 0, 0, 30702, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 124428, -121896, -2614, 0, 0, 12228, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127921, -122755, -2575, 0, 0, 21162, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128245, -122408, -2584, 0, 0, 9330, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128629, -122209, -2584, 0, 0, 4497, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128950, -122421, -2578, 0, 0, 32644, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 129090, -122718, -2571, 0, 0, 33575, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 129141, -123025, -2571, 0, 0, 25590, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128464, -123200, -2571, 0, 0, 34725, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128146, -123512, -2584, 0, 0, 25098, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127255, -125318, -2572, 0, 0, 8708, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127599, -125462, -2572, 0, 0, 194, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127825, -125179, -2597, 0, 0, 5549, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127678, -124774, -2569, 0, 0, 59066, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127267, -124923, -2564, 0, 0, 46433, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127391, -125140, -2572, 0, 0, 808, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128720, -125330, -2572, 0, 0, 23331, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128411, -125293, -2572, 0, 0, 34564, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128493, -124929, -2572, 0, 0, 14124, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127726, -119402, -2599, 0, 0, 16354, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127819, -118960, -2609, 0, 0, 45444, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128111, -118776, -2584, 0, 0, 43337, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128440, -119068, -2581, 0, 0, 47629, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 128176, -119262, -2584, 0, 0, 39091, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127986, -119138, -2609, 0, 0, 38802, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127227, -119397, -2585, 0, 0, 36812, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 126387, -119736, -2587, 0, 0, 8654, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 124739, -122031, -2614, 0, 0, 44762, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 124420, -121449, -2614, 0, 0, 21038, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 124855, -122032, -2614, 0, 0, 54167, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 127234, -120182, -2586, 0, 0, 10087, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22093, 126866, -120259, -2584, 0, 0, 7944, 60, 0, 0),
-- Frost Buffalo
("Ice Merchant/Frozen", 1, 22094, 128449, -123008, -2571, 0, 0, 37662, 60, 0, 0),
("Ice Merchant/Frozen", 1, 22094, 128560, -123306, -2571, 0, 0, 40908, 60, 0, 0),
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment