This commit is contained in:
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-1.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-1.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Weaver Olf Kanore:<br>
|
||||
Select an item from which you wish the seal removed.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 32610-2.htm">Remove the seal on the pin.</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 32610-3.htm">Remove the seal on the pouch.</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 32610-4.htm">Remove the seal on the clip.</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 32610-5.htm">Remove the seal on the accessory.</a>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-2.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-2.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Weaver Olf Kanore:<br>
|
||||
Select a magic pin from which to remove the seal. Keep in mind that there is a fee for doing so.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 0_grade_pin">C-Grade Magic Pin (3200 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 1_grade_pin">B-Grade Magic Pin (11,800 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 2_grade_pin">A-Grade Magic Pin (26,500 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 3_grade_pin">S-Grade Magic Pin (136,600 Adena)</a>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-3.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-3.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Weaver Olf Kanore:<br>
|
||||
Select a magic pouch from which to remove the seal. Keep in mind that there is a fee for doing so.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 0_grade_pouch">C-Grade Magic Pouch (3200 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 1_grade_pouch">B-Grade Magic Pouch (11,800 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 2_grade_pouch">A-Grade Magic Pouch (26,500 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 3_grade_pouch">S-Grade Magic Pouch (136,600 Adena)</a>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-4.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-4.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Weaver Olf Kanore:<br>
|
||||
Select a magic clip from which to remove the seal. Keep in mind that there is a fee for doing so.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 2_grade_clip">A-Grade Magic Clip (26,500 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 3_grade_clip">S-Grade Magic Clip (136,600 Adena)</a>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-5.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-5.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Weaver Olf Kanore:<br>
|
||||
Select an accessory from which to remove the seal. Keep in mind that there is a fee for doing so.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 2_grade_ornament">A-Grade Accessory (26,500 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 3_grade_ornament">S-Grade Accessory (136,600 Adena)</a>
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-low.htm
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-low.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Weaver Olf Kanore:<br>
|
||||
Either you have no sealed items for me to release, or you don't have enough Adena to pay the fee.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-no.htm
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32610-no.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Weaver Olf Kanore:<br>
|
||||
I see no sealed items here...
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-1.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-1.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Weaver Olf Adams:<br>
|
||||
Select an item from which you wish the seal removed.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 32612-2.htm">Remove the seal on the pin.</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 32612-3.htm">Remove the seal on the pouch.</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 32612-4.htm">Remove the seal on the clip.</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 32612-5.htm">Remove the seal on the accessory.</a>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-2.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-2.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Weaver Olf Adams:<br>
|
||||
Select a magic pin from which to remove the seal. Keep in mind that there is a fee for doing so.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 0_grade_pin">C-Grade Magic Pin (3200 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 1_grade_pin">B-Grade Magic Pin (11,800 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 2_grade_pin">A-Grade Magic Pin (26,500 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 3_grade_pin">S-Grade Magic Pin (136,600 Adena)</a>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-3.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-3.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Weaver Olf Adams:<br>
|
||||
Select a magic pouch from which to remove the seal. Keep in mind that there is a fee for doing so.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 0_grade_pouch">C-Grade Magic Pouch (3200 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 1_grade_pouch">B-Grade Magic Pouch (11,800 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 2_grade_pouch">A-Grade Magic Pouch (26,500 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 3_grade_pouch">S-Grade Magic Pouch (136,600 Adena)</a>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-4.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-4.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Weaver Olf Adams:<br>
|
||||
Select a magic clip from which to remove the seal. Keep in mind that there is a fee for doing so.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 2_grade_clip">A-Grade Magic Clip (26,500 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 3_grade_clip">S-Grade Magic Clip (136,600 Adena)</a>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-5.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-5.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Weaver Olf Adams:<br>
|
||||
Select an accessory from which to remove the seal. Keep in mind that there is a fee for doing so.<br>
|
||||
<a action="bypass -h Quest WeaverOlf 2_grade_ornament">A-Grade Accessory (26,500 Adena)</a><br>
|
||||
<a action="bypass -h Quest WeaverOlf 3_grade_ornament">S-Grade Accessory (136,600 Adena)</a>
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-low.htm
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-low.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Weaver Olf Adams:<br>
|
||||
Either you have no sealed items for me to release, or you don't have enough Adena to pay the fee.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-no.htm
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/32612-no.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Weaver Olf Adams:<br>
|
||||
I see no sealed items here...
|
||||
</body></html>
|
247
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/WeaverOlf.java
vendored
Normal file
247
trunk/dist/game/data/scripts/ai/npc/WeaverOlf/WeaverOlf.java
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2014 L2J DataPack
|
||||
*
|
||||
* This file is part of L2J DataPack.
|
||||
*
|
||||
* L2J DataPack 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.
|
||||
*
|
||||
* L2J DataPack 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.npc.WeaverOlf;
|
||||
|
||||
import ai.npc.AbstractNpcAI;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
|
||||
/**
|
||||
* Weaver Olf - Pins And Pouch Unseal AI.
|
||||
* @author Gigiikun, Bloodshed, Adry_85
|
||||
*/
|
||||
public final class WeaverOlf extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int[] NPCs =
|
||||
{
|
||||
32610, // Olf Kanore
|
||||
32612, // Olf Adams
|
||||
};
|
||||
|
||||
private static final int[] UNSEAL_PRICE =
|
||||
{
|
||||
3200,
|
||||
11800,
|
||||
26500,
|
||||
136600
|
||||
};
|
||||
|
||||
private static final int[] CHANCES =
|
||||
{
|
||||
1, // top
|
||||
10, // high
|
||||
40, // mid
|
||||
100, // low
|
||||
};
|
||||
|
||||
private static final int[][] PINS =
|
||||
{
|
||||
{
|
||||
13898, // Sealed Magic Pin (C-Grade)
|
||||
13905, // Top-Grade Magic Pin (C-Grade)
|
||||
13904, // High-Grade Magic Pin (C-Grade)
|
||||
13903, // Mid-Grade Magic Pin (C-Grade)
|
||||
13902, // Low-Grade Magic Pin (C-Grade)
|
||||
},
|
||||
{
|
||||
13899, // Sealed Magic Pin (B-Grade)
|
||||
13909, // Top-Grade Magic Pin (B-Grade)
|
||||
13908, // High-Grade Magic Pin (B-Grade)
|
||||
13907, // Mid-Grade Magic Pin (B-Grade)
|
||||
13906, // Low-Grade Magic Pin (B-Grade)
|
||||
},
|
||||
{
|
||||
13900, // Sealed Magic Pin (A-Grade)
|
||||
13913, // Top-Grade Magic Pin (A-Grade)
|
||||
13912, // High-Grade Magic Pin (A-Grade)
|
||||
13911, // Mid-Grade Magic Pin (A-Grade)
|
||||
13910, // Low-Grade Magic Pin (A-Grade)
|
||||
},
|
||||
{
|
||||
13901, // Sealed Magic Pin (S-Grade)
|
||||
13917, // Top-Grade Magic Pin (S-Grade)
|
||||
13916, // High-Grade Magic Pin (S-Grade)
|
||||
13915, // Mid-Grade Magic Pin (S-Grade)
|
||||
13914, // Low-Grade Magic Pin (S-Grade)
|
||||
}
|
||||
};
|
||||
|
||||
private static final int[][] POUCHS =
|
||||
{
|
||||
{
|
||||
13918, // Sealed Magic Pouch (C-Grade)
|
||||
13925, // Top-Grade Magic Pouch (C-Grade)
|
||||
13924, // High-Grade Magic Pouch (C-Grade)
|
||||
13923, // Mid-Grade Magic Pouch (C-Grade)
|
||||
13922, // Low-Grade Magic Pouch (C-Grade)
|
||||
},
|
||||
{
|
||||
13919, // Sealed Magic Pouch (B-Grade)
|
||||
13929, // Top-Grade Magic Pouch (B-Grade)
|
||||
13928, // High-Grade Magic Pouch (B-Grade)
|
||||
13927, // Mid-Grade Magic Pouch (B-Grade)
|
||||
13926, // Low-Grade Magic Pouch (B-Grade)
|
||||
},
|
||||
{
|
||||
13920, // Sealed Magic Pouch (A-Grade)
|
||||
13933, // Top-Grade Magic Pouch (A-Grade)
|
||||
13932, // High-Grade Magic Pouch (A-Grade)
|
||||
13931, // Mid-Grade Magic Pouch (A-Grade)
|
||||
13930, // Low-Grade Magic Pouch (A-Grade)
|
||||
},
|
||||
{
|
||||
13921, // Sealed Magic Pouch (S-Grade)
|
||||
13937, // Top-Grade Magic Pouch (S-Grade)
|
||||
13936, // High-Grade Magic Pouch (S-Grade)
|
||||
13935, // Mid-Grade Magic Pouch (S-Grade)
|
||||
13934, // Low-Grade Magic Pouch (S-Grade)
|
||||
}
|
||||
};
|
||||
|
||||
private static final int[][] CLIPS_ORNAMENTS =
|
||||
{
|
||||
{
|
||||
14902, // Sealed Magic Rune Clip (A-Grade)
|
||||
14909, // Top-level Magic Rune Clip (A-Grade)
|
||||
14908, // High-level Magic Rune Clip (A-Grade)
|
||||
14907, // Mid-level Magic Rune Clip (A-Grade)
|
||||
14906, // Low-level Magic Rune Clip (A-Grade)
|
||||
},
|
||||
{
|
||||
14903, // Sealed Magic Rune Clip (S-Grade)
|
||||
14913, // Top-level Magic Rune Clip (S-Grade)
|
||||
14912, // High-level Magic Rune Clip (S-Grade)
|
||||
14911, // Mid-level Magic Rune Clip (S-Grade)
|
||||
14910, // Low-level Magic Rune Clip (S-Grade)
|
||||
},
|
||||
{
|
||||
14904, // Sealed Magic Ornament (A-Grade)
|
||||
14917, // Top-grade Magic Ornament (A-Grade)
|
||||
14916, // High-grade Magic Ornament (A-Grade)
|
||||
14915, // Mid-grade Magic Ornament (A-Grade)
|
||||
14914, // Low-grade Magic Ornament (A-Grade)
|
||||
},
|
||||
{
|
||||
14905, // Sealed Magic Ornament (S-Grade)
|
||||
14921, // Top-grade Magic Ornament (S-Grade)
|
||||
14920, // High-grade Magic Ornament (S-Grade)
|
||||
14919, // Mid-grade Magic Ornament (S-Grade)
|
||||
14918, // Low-grade Magic Ornament (S-Grade)
|
||||
}
|
||||
};
|
||||
|
||||
private WeaverOlf()
|
||||
{
|
||||
super(WeaverOlf.class.getSimpleName(), "ai/npc");
|
||||
addStartNpc(NPCs);
|
||||
addTalkId(NPCs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.contains("_grade_"))
|
||||
{
|
||||
int grade = Integer.parseInt(event.substring(0, 1));
|
||||
int price;
|
||||
int[] itemIds;
|
||||
if (event.endsWith("_pin"))
|
||||
{
|
||||
price = UNSEAL_PRICE[grade];
|
||||
itemIds = PINS[grade];
|
||||
}
|
||||
else if (event.endsWith("_pouch"))
|
||||
{
|
||||
price = UNSEAL_PRICE[grade];
|
||||
itemIds = POUCHS[grade];
|
||||
}
|
||||
else if (event.endsWith("_clip"))
|
||||
{
|
||||
price = UNSEAL_PRICE[grade];
|
||||
itemIds = CLIPS_ORNAMENTS[grade - 2];
|
||||
}
|
||||
else if (event.endsWith("_ornament"))
|
||||
{
|
||||
price = UNSEAL_PRICE[grade];
|
||||
itemIds = CLIPS_ORNAMENTS[grade];
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
if (hasQuestItems(player, itemIds[0]))
|
||||
{
|
||||
if (player.getAdena() > price)
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, price);
|
||||
takeItems(player, itemIds[0], 1);
|
||||
int rand = getRandom(200);
|
||||
if (rand <= CHANCES[0])
|
||||
{
|
||||
giveItems(player, itemIds[1], 1);
|
||||
}
|
||||
else if (rand <= CHANCES[1])
|
||||
{
|
||||
giveItems(player, itemIds[2], 1);
|
||||
}
|
||||
else if (rand <= CHANCES[2])
|
||||
{
|
||||
giveItems(player, itemIds[3], 1);
|
||||
}
|
||||
else if (rand <= CHANCES[3])
|
||||
{
|
||||
giveItems(player, itemIds[4], 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getId(), NpcStringId.WHAT_A_PREDICAMENT_MY_ATTEMPTS_WERE_UNSUCCESSFUL));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return npc.getId() + "-low.htm";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return npc.getId() + "-no.htm";
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
return event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return npc.getId() + "-1.htm";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new WeaverOlf();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user