📄 c_npcaction.java
字号:
// ヤヒのブーツ / バルログの鍛冶屋
else if (s.equalsIgnoreCase("e") && karmaLevel >= 5) {
materials = new int[] { 20190, 40674, 40678 };
counts = new int[] { 1, 40, 100 };
createitem = new int[] { 20209 };
createcount = new int[] { 1 };
success_htmlid = "";
failure_htmlid = "lsmithee";
}
// ヤヒのリング / バルログの鍛冶屋
else if (s.equalsIgnoreCase("f") && karmaLevel >= 6) {
materials = new int[] { 20078, 40674, 40678 };
counts = new int[] { 1, 5, 100 };
createitem = new int[] { 20290 };
createcount = new int[] { 1 };
success_htmlid = "";
failure_htmlid = "lsmithff";
}
// ヤヒのアミュレット / バルログの鍛冶屋
else if (s.equalsIgnoreCase("g") && karmaLevel >= 7) {
materials = new int[] { 20078, 40670, 40678 };
counts = new int[] { 1, 1, 100 };
createitem = new int[] { 20261 };
createcount = new int[] { 1 };
success_htmlid = "";
failure_htmlid = "lsmithgg";
}
// ヤヒのヘルム / バルログの鍛冶屋
else if (s.equalsIgnoreCase("h") && karmaLevel >= 8) {
materials = new int[] { 40719, 40673, 40678 };
counts = new int[] { 1, 1, 100 };
createitem = new int[] { 20031 };
createcount = new int[] { 1 };
success_htmlid = "";
failure_htmlid = "lsmithhh";
}
}
// 業の管理者
else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 80074) {
L1NpcInstance npc = (L1NpcInstance) obj;
if (pc.getKarma() >= 10000000) {
getSoulCrystalByKarma(pc, npc, s);
}
htmlid = "";
}
// アルフォンス
else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 80057) {
htmlid = karmaLevelToHtmlId(pc.getKarmaLevel());
htmldata = new String[] { String.valueOf(pc.getKarmaPercent()) };
}
// 次元の扉(土風水火)
else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 80059
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 80060
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 80061
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 80062) {
htmlid = talkToDimensionDoor(pc, (L1NpcInstance) obj, s);
}
// ジャック オ ランタン
else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 81124) {
if (s.equalsIgnoreCase("1")) {
poly(client, 4002);
htmlid = ""; // ウィンドウを消す
} else if (s.equalsIgnoreCase("2")) {
poly(client, 4004);
htmlid = ""; // ウィンドウを消す
} else if (s.equalsIgnoreCase("3")) {
poly(client, 4950);
htmlid = ""; // ウィンドウを消す
}
}
// クエスト関連
// 一般クエスト / ライラ
else if (s.equalsIgnoreCase("contract1")) {
pc.getQuest().set_step(L1Quest.QUEST_LYRA, 1);
htmlid = "lyraev2";
} else if (s.equalsIgnoreCase("contract1yes") || // ライラ Yes
s.equalsIgnoreCase("contract1no")) { // ライラ No
if (s.equalsIgnoreCase("contract1yes")) {
htmlid = "lyraev5";
} else if (s.equalsIgnoreCase("contract1no")) {
pc.getQuest().set_step(L1Quest.QUEST_LYRA, 0);
htmlid = "lyraev4";
}
int totem = 0;
if (pc.getInventory().checkItem(40131)) {
totem++;
}
if (pc.getInventory().checkItem(40132)) {
totem++;
}
if (pc.getInventory().checkItem(40133)) {
totem++;
}
if (pc.getInventory().checkItem(40134)) {
totem++;
}
if (pc.getInventory().checkItem(40135)) {
totem++;
}
if (totem != 0) {
materials = new int[totem];
counts = new int[totem];
createitem = new int[totem];
createcount = new int[totem];
totem = 0;
if (pc.getInventory().checkItem(40131)) {
L1ItemInstance l1iteminstance = pc.getInventory()
.findItemId(40131);
int i1 = l1iteminstance.getCount();
materials[totem] = 40131;
counts[totem] = i1;
createitem[totem] = L1ItemId.ADENA;
createcount[totem] = i1 * 50;
totem++;
}
if (pc.getInventory().checkItem(40132)) {
L1ItemInstance l1iteminstance = pc.getInventory()
.findItemId(40132);
int i1 = l1iteminstance.getCount();
materials[totem] = 40132;
counts[totem] = i1;
createitem[totem] = L1ItemId.ADENA;
createcount[totem] = i1 * 100;
totem++;
}
if (pc.getInventory().checkItem(40133)) {
L1ItemInstance l1iteminstance = pc.getInventory()
.findItemId(40133);
int i1 = l1iteminstance.getCount();
materials[totem] = 40133;
counts[totem] = i1;
createitem[totem] = L1ItemId.ADENA;
createcount[totem] = i1 * 50;
totem++;
}
if (pc.getInventory().checkItem(40134)) {
L1ItemInstance l1iteminstance = pc.getInventory()
.findItemId(40134);
int i1 = l1iteminstance.getCount();
materials[totem] = 40134;
counts[totem] = i1;
createitem[totem] = L1ItemId.ADENA;
createcount[totem] = i1 * 30;
totem++;
}
if (pc.getInventory().checkItem(40135)) {
L1ItemInstance l1iteminstance = pc.getInventory()
.findItemId(40135);
int i1 = l1iteminstance.getCount();
materials[totem] = 40135;
counts[totem] = i1;
createitem[totem] = L1ItemId.ADENA;
createcount[totem] = i1 * 200;
totem++;
}
}
}
// 最近の物価について
// パンドラ、コルド、バルシム、メリン、グレン
else if (s.equalsIgnoreCase("pandora6") || s.equalsIgnoreCase("cold6")
|| s.equalsIgnoreCase("balsim3")
|| s.equalsIgnoreCase("mellin3") || s.equalsIgnoreCase("glen3")) {
htmlid = s;
int npcid = ((L1NpcInstance) obj).getNpcTemplate().get_npcId();
int taxRatesCastle = L1CastleLocation
.getCastleTaxRateByNpcId(npcid);
htmldata = new String[] { String.valueOf(taxRatesCastle) };
}
// タウンマスター(この村の住民に登録する)
else if (s.equalsIgnoreCase("set")) {
if (obj instanceof L1NpcInstance) {
int npcid = ((L1NpcInstance) obj).getNpcTemplate().get_npcId();
int town_id = L1TownLocation.getTownIdByNpcid(npcid);
if (town_id >= 1 && town_id <= 10) {
if (pc.getHomeTownId() == -1) {
// \f1新しく住民登録を行なうには時間がかかります。時間を置いてからまた登録してください。
pc.sendPackets(new S_ServerMessage(759));
htmlid = "";
} else if (pc.getHomeTownId() > 0) {
// 既に登録してる
if (pc.getHomeTownId() != town_id) {
L1Town town = TownTable.getInstance().getTownTable(
pc.getHomeTownId());
if (town != null) {
// 現在、あなたが住民登録している場所は%0です。
pc.sendPackets(new S_ServerMessage(758, town
.get_name()));
}
htmlid = "";
} else {
// ありえない?
htmlid = "";
}
} else if (pc.getHomeTownId() == 0) {
// 登録
if (pc.getLevel() < 10) {
// \f1住民登録ができるのはレベル10以上のキャラクターです。
pc.sendPackets(new S_ServerMessage(757));
htmlid = "";
} else {
int level = pc.getLevel();
int cost = level * level * 10;
if (pc.getInventory().consumeItem(L1ItemId.ADENA,
cost)) {
pc.setHomeTownId(town_id);
pc.setContribution(0); // 念のため
pc.save();
} else {
// アデナが不足しています。
pc.sendPackets(new S_ServerMessage(337, "$4"));
}
htmlid = "";
}
}
}
}
}
// タウンマスター(住民登録を取り消す)
else if (s.equalsIgnoreCase("clear")) {
if (obj instanceof L1NpcInstance) {
int npcid = ((L1NpcInstance) obj).getNpcTemplate().get_npcId();
int town_id = L1TownLocation.getTownIdByNpcid(npcid);
if (town_id > 0) {
if (pc.getHomeTownId() > 0) {
if (pc.getHomeTownId() == town_id) {
pc.setHomeTownId(-1);
pc.setContribution(0); // 貢献度クリア
pc.save();
} else {
// \f1あなたは他の村の住民です。
pc.sendPackets(new S_ServerMessage(756));
}
}
htmlid = "";
}
}
}
// タウンマスター(村の村長が誰かを聞く)
else if (s.equalsIgnoreCase("ask")) {
if (obj instanceof L1NpcInstance) {
int npcid = ((L1NpcInstance) obj).getNpcTemplate().get_npcId();
int town_id = L1TownLocation.getTownIdByNpcid(npcid);
if (town_id >= 1 && town_id <= 10) {
L1Town town = TownTable.getInstance().getTownTable(town_id);
String leader = town.get_leader_name();
if (leader != null && leader.length() != 0) {
htmlid = "owner";
htmldata = new String[] { leader };
} else {
htmlid = "noowner";
}
}
}
}
// タウンアドバイザー
else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70534
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70556
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70572
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70631
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70663
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70761
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70788
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70806
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70830
|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70876) {
// タウンアドバイザー(収入に関する報告)
if (s.equalsIgnoreCase("r")) {
if (obj instanceof L1NpcInstance) {
int npcid = ((L1NpcInstance) obj).getNpcTemplate()
.get_npcId();
int town_id = L1TownLocation.getTownIdByNpcid(npcid);
}
}
// タウンアドバイザー(税率変更)
else if (s.equalsIgnoreCase("t")) {
}
// タウンアドバイザー(報酬をもらう)
else if (s.equalsIgnoreCase("c")) {
}
}
// ドロモンド
else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70997) {
// ありがとう、旅立ちます
if (s.equalsIgnoreCase("0")) {
final int[] item_ids = { 41146, 4, 20322, 173, 40743, };
final int[] item_amounts = { 1, 1, 1, 1, 500, };
for (int i = 0; i < item_ids.length; i++) {
L1ItemInstance item = pc.getInventory().storeItem(
item_ids[i], item_amounts[i]);
pc.sendPackets(new S_ServerMessage(143,
((L1NpcInstance) obj).getNpcTemplate().get_name(),
item.getLogName()));
}
pc.getQuest().set_step(L1Quest.QUEST_DOROMOND, 1);
htmlid = "jpe0015";
}
}
// アレックス(歌う島)
else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 70999) {
// ドロモンドの紹介状を渡す
if (s.equalsIgnoreCase("1")) {
if (pc.getInventory().consumeItem(41146, 1)) {
final int[] item_ids = { 23, 20219, 20193, };
final int[] item_amounts = { 1, 1, 1, };
for (int i = 0; i < item_ids.length; i++) {
L1ItemInstance item = pc.getInventory().storeItem(
item_ids[i], item_amounts[i]);
pc.sendPackets(new S_ServerMessage(143,
((L1NpcInstance) obj).getNpcTemplate()
.get_name(), item.getLogName()));
}
pc.getQuest().set_step(L1Quest.QUEST_DOROMOND, 2);
htmlid = "";
}
} else if (s.equalsIgnoreCase("2")) {
final int[] item_ids = { 41227 }; // アレックスの紹介状
final int[] item_amounts = { 1 };
for (int i = 0; i < item_ids.length; i++) {
L1ItemInstance item = pc.getInventory().storeItem(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -