2013年5月18日 星期六

【Java教學】新增幫玩家加魔法NPC


        新增幫玩家加魔法NPC
修改C_NPCAction

// “
調查をやめます
            else if (s.equalsIgnoreCase("Z")) {
                if (pc.getInventory().consumeItem(41062, 1)) {
                    htmlid = "orcfbakumo6";
                }
            }
        }
在這加入
       
複制代碼
1.
2.        else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 300015) {
3. //
魔術師  by bill00148
4.                if (s.equals("request for a6_1")){
5.                    if (pc.getInventory().checkItem(40308,200)) { //
拟似
6.                        L1ItemInstance item = pc.getWeapon();
7.                        if(item != null) {                   
8.                            pc.sendPackets(new S_ServerMessage(161, item.getLogName(), "$245", "$247"));
9.                            item.setSkillWeaponEnchant(pc, 12, 1800 * 1000);
10.                            } else {                 
11.                        pc.sendPackets(new S_ServerMessage(79));
12.                        }
13.                        pc.sendPackets(new S_SkillSound(pc.getId(), 747));
14.                        pc.broadcastPacket(new S_SkillSound(pc.getId(), 747));
15.                        pc.getInventory().consumeItem(40308,200);
16.                        //htmlid = "";
17.                    } else {
18.                        pc.sendPackets(new S_ServerMessage(189));
19.                        htmlid = "";
20.                    }
21.                }
22.                else if (s.equals("request for a6_2")){
23.                    if (pc.getInventory().checkItem(40308,200)) { //
铠甲
24.                    L1ItemInstance item = pc.getInventory().getItemEquipped((byte)2,(byte)2);
25.                    if(item != null) {
26.                        pc.sendPackets(new S_ServerMessage(161, item.getLogName(), "$245", "$247"));
27.                            item.setSkillArmorEnchant(pc, 21, 1800 * 1000);
28.                        } else {
29.                        pc.sendPackets(new S_ServerMessage(79));
30.                    }
31.                    pc.sendPackets(new S_SkillSound(pc.getId(), 748));
32.                    pc.broadcastPacket(new S_SkillSound(pc.getId(), 748));
33.                    pc.getInventory().consumeItem(40308,200);
34.                    } else {
35.                    pc.sendPackets(new S_ServerMessage(189));
36.                    htmlid = "";
37.                    }
38.                        }
39.                else if (s.equals("request for a6_3")){
40.                    if (pc.getInventory().checkItem(40308,1000)) { //
通暢
41.                            pc.getInventory().consumeItem(40308,1000);
42.                            L1SkillUse l1skilluse = new L1SkillUse();
43.                            l1skilluse.handleCommands(client.getActiveChar(),
44.                                    L1SkillId.PHYSICAL_ENCHANT_DEX, pc.getId(), pc.getX(), pc.getY(),
45.                                    null, 0, L1SkillUse.TYPE_SPELLSC);
46.                        } else {
47.                            htmlid = "";
48.                            pc.sendPackets(new S_ServerMessage(189));
49.                        }
50.                        }
51.                else if (s.equals("request for a6_4")){
52.                    if (pc.getInventory().checkItem(40308,1000)) { //
體魄
53.                            pc.getInventory().consumeItem(40308,1000);
54.                            L1SkillUse l1skilluse = new L1SkillUse();
55.                            l1skilluse.handleCommands(client.getActiveChar(),
56.                                    L1SkillId.PHYSICAL_ENCHANT_STR, pc.getId(), pc.getX(), pc.getY(),
57.                                    null, 0, L1SkillUse.TYPE_SPELLSC);
58.                        } else {
59.                            htmlid = "";
60.                            pc.sendPackets(new S_ServerMessage(189));
61.                        }
62.                        }
63.                else if (s.equals("request for a6_5")){
64.                    if (pc.getInventory().checkItem(40308,1000)) { //
祝福
65.                            pc.getInventory().consumeItem(40308,1000);
66.                            L1SkillUse l1skilluse = new L1SkillUse();
67.                            l1skilluse.handleCommands(client.getActiveChar(),
68.                                    L1SkillId.BLESS_WEAPON, pc.getId(), pc.getX(), pc.getY(),
69.                                    null, 0, L1SkillUse.TYPE_SPELLSC);
70.                        } else {
71.                            htmlid = "";
72.                            pc.sendPackets(new S_ServerMessage(189));
73.                        }
74.                        }
75.                else if (s.equals("request for a6_6")){
76.                    if (pc.getInventory().checkItem(40308,20000)) { //
靈魂
77.                            pc.getInventory().consumeItem(40308,20000);
78.                            L1SkillUse l1skilluse = new L1SkillUse();
79.                            l1skilluse.handleCommands(client.getActiveChar(),
80.                                    L1SkillId.ADVANCE_SPIRIT, pc.getId(), pc.getX(), pc.getY(),
81.                                    null, 0, L1SkillUse.TYPE_SPELLSC);
82.                        } else {
83.                            htmlid = "";
84.                            pc.sendPackets(new S_ServerMessage(189));
85.                        }
86.                        }
87.                else if (s.equals("request for a6_8")){ //
變黑妖
88.                    if (pc.getInventory().checkItem(40308,10000)) {
89.                            pc.getInventory().consumeItem(40308,10000);
90.                            poly(client, (short)2284);
91.                        } else {
92.                            htmlid = "";
93.                            pc.sendPackets(new S_ServerMessage(189));
94.                        }
95.                        }
96.                else if (s.equals("request for a6_9")){ //
變死騎
97.                    if (pc.getInventory().checkItem(40308,10000)) {
98.                            pc.getInventory().consumeItem(40308,10000);
99.                            poly(client, (short)3784);
100.                        } else {
101.                            htmlid = "";
102.                            pc.sendPackets(new S_ServerMessage(189));
103.                        }
104.                        }
105.        }
106.                    //
魔術師  end   
107.       

        //
ドゥダ-マラ ブカ
        else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 71043) {
            // “
調查をします
            if (s.equalsIgnoreCase("A")) {
                L1NpcInstance npc = (L1NpcInstance) obj;

NPC
編号自己改一下

大緻上應該沒什麽問題

價錢如果不滿意大大自己修改嘿











                 修改天神祝福
到核心裡面修改
先找到C_NPCTalk在收尋
                                          //
體魄
                new L1SkillUse().handleCommands(pc, 42, pc.getId(), pc.getX(), pc.getY(), null, time, L1SkillUse.TYPE_GMBUFF);
                //
通暢
                new L1SkillUse().handleCommands(pc, 26, pc.getId(), pc.getX(), pc.getY(), null, time, L1SkillUse.TYPE_GMBUFF);
                //
祝福魔法武器
                new L1SkillUse().handleCommands(pc, 48, pc.getId(), pc.getX(), pc.getY(), null, time, L1SkillUse.TYPE_GMBUFF);
                //
鋼鐵防護
                new L1SkillUse().handleCommands(pc, 168, pc.getId(), pc.getX(), pc.getY(), null, time, L1SkillUse.TYPE_GMBUFF);
這裡就是改他放魔法的地方

感覺天神祝福5萬太多呢修改核心
C_NPCTalk裡面的 ;]A:(HSZj
  int time = 3600;  < &$
<7]a\dM

                if(((L1NpcInstance)obj).getMapId() == 4) mJFFst,‑
                { 5 [1]cz6\A&
                    L1ItemInstance adena = ItemTable.getInstance().createItem(40308); .~ Y%[1]
AI

                    adena.setCount(pc.getInventory().countItems(40308)); 6SVh6o@]
                    if(adena.getCount() < 50000) z >9g

t
                    {                                      這裡作修改  這裡是不到5萬元 會出現以下訊息 eW.[M?,
                        pc.sendPackets(new S_SystemMessage("\u91D1\u5E63\u4E0D\u8DB3!\u89815\u842C\u5143\u5537!\u5929\u795E\u795D\u798F\u4E0D\u662F\u5E73\u5E38\u4EBA\u80FD\u6709\u7684!")); u(bPdf@kz
                        return; <F#/wU ^9­
                    } ^_o9%)RL(
                    pc.getInventory().consumeItem(40308, 50000); n= tg{_9f%
                    time = 900;                                                 
這裡修改

沒有留言:

張貼留言