UID313760
帖子
精華
主題
積分448
現金
積極性
威望
違規
熱心
推廣次數
閱讀權限5
註冊時間2011-8-7
在線時間 小時
最後登錄1970-1-1
TA的每日心情 | 怒 2018-12-16 03:25 PM |
---|
簽到天數: 336 天 連續簽到: 1 天 [LV.8]以壇為家I
|
EA
私服版號: |
EA14934 |
問題內容: |
腳本問題 |
本帖最後由 i780112 於 2016-3-24 11:09 AM 編輯
是這樣的, 前幾天下載了這個"試戴及製作NPC" - - shop quest_shop1 -1,512:100 //生成商店,請無視這行
- amatsu,46,127,5, script 武器製作 441,{ //自行設定位子,外觀
- set @i,0;
- mes "[武器製作]";
- mes "請按照購買物品似的選擇";
- mes "材料足夠後將直接製作";
- mes "材料不足將直接提示材料";
- mes "請^FF0000一次選購一種^000000武器";
- mes "請放心選購^FF3399 查看武器時,不會扣除相應Zeny^000000";
- callshop "quest_shop1",1;
- npcshopattach "quest_shop1";
- end;
- OnBuyItem:
-
- if(.BuildQuest) {
- for(set .e,0; !compare(getarg(.e+1)+"","Zeny"); set .e,.e+2) {}
- npcshopadditem "quest_shop1",getarg(.e+2),getarg(.e)*compare(getarg(.e+1)+"","SZeny");
- setarray .Shop[.i],getarg(.e+2);
- set .i,.i+1;
- if(.i%20==0){sleep(1);}
- goto Quest_Setup;
- }
- if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Quest_Setup; }
- mes "- 製作 ^FF0000"+getitemname(@bought_nameid)+"^000000";
- mes "- 請準備好下面材料!";
- for(set @i,0; !compare(getarg(@i+1)+"","Zeny"); set @i,@i+2) mes " ^0066CC" + getitemname(getarg(@i)) + "^000000 x " + ((countitem(getarg(@i))>=getarg(@i+1))? "":"") + "" + getarg(@i+1) + " [^009900" + countitem(getarg(@i)) + "^000000/^FF6600" + getarg(@i+1) + "^000000]"+( countitem(getarg(@i))>=getarg(@i+1)?" ( ^D2691E已完成^000000 )":" ( ^999999未完成^000000 )");
- if(getarg(@i)) mes " ^FF1493需要製作費用^000000 " + ((Zeny>=getarg(@i))? "^FF0000":"") + "" + getarg(@i) + "^000000 "+((Zeny>=getarg(@i))? "( ^D2691E已完成^000000 )":"( ^999999金錢不足^000000 )");
- mes "- 在交換條件裡寫著, 我將會給你:^0000FF";
- for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " 個 " + getitemname(getarg(@i));
- switch(select("- 1、製作 ^FF0000"+getitemname(@bought_nameid)+"^000000:- 2、結束對話")) {
- case 1:
- for(set @i,0; !compare(getarg(@i+1)+"","Zeny"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
- next;
- mes "[武器製作]";
- mes "你身上有 ^FF0000" + countitem(getarg(@i)) + "^000000 個 ^FF0000" + getitemname(getarg(@i)) + "^000000,我需要 ^009900" + getarg(@i+1) + "^000000 個";
- mes "請補齊 ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + "^000000 個 ^FF0000" + getitemname(getarg(@i)) + "^000000 再來找我.";
- emotion 53;
- close;
- }
- if(Zeny < getarg(@i)) {
- next;
- mes "[武器製作]";
- mes "你身上攜帶的金錢不足.";
- mes "請補齊 ^FF0000" + (getarg(@i)-Zeny) + "Zeny差額再來找我^000000.";
- emotion 53;
- close;
- }
- for(set @i,0; !compare(getarg(@i+1)+"","Zeny"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
- set Zeny,Zeny-getarg(@i);
- for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
- specialeffect2 154;
- emotion 21;
- if (compare(getarg(@i,0)+"","announce")) announce strcharinfo(0) + " 獲得了 " + getitemname(@bought_nameid) + "!",bc_all;
- close;
- case 2:
- emotion 12;
- close;
- }
- OnInit:
- npcshopitem "quest_shop1",0,0;
- npcshopdelitem "quest_shop1",0,0;
- set .BuildQuest,1;
- set .i,1;
- Quest_Setup:
- switch(.i) {
- default: set .BuildQuest,0; set .e,0; set .i,0; end;
- case 1: callsub OnBuyItem,7022,1,7023,10,724,5,7002,100,714,1,100000,"SZeny",1237,1,"announce";
- case 2: callsub OnBuyItem,7018,1,7019,1,7020,1,7021,1,714,1,100000,"SZeny",1138,1,"announce";
- case 3: callsub OnBuyItem,7017,2,7024,10,1008,3,609,50,714,1,100000,"SZeny",1169,1,"announce";
- case 4: callsub OnBuyItem,7295,30,969,10,999,50,714,10,100000,"SZeny",1141,1,"announce";
- case 5: callsub OnBuyItem,7294,30,969,10,999,50,714,10,100000,"SZeny",1526,1,"announce";
-
- }
- }
複製代碼
因為這個腳本很方便, 可以點NPC直接觀看列表跟製作物品
現在我遇到了瓶頸
由於我的東西有很多種類型
例如: 我要將雙手劍, 單手劍, 鈍器.... 等等分開展示
但是我又想把他集中在一個NPC內, 然後用標籤分開
例如
menu "雙手劍",A,"單手劍",B,"鈍器",C;
選擇ABC顯示不同的SHOP列表
但是不管我怎麼試, 都沒辦法讓他在同一個NPC內作用
卡在Onbuy標籤很久不知道怎麼去解決
因為一個NPC就只能用一個Onbuy標籤
也沒辦法用callfunc
不知道能不能在Onbuy標籤加入判斷(屢改屢敗)
不知道有沒有高手能夠幫幫忙指點迷津...
|
|