Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - shop quest_shop_1 -1,501:50
- quiz_test,314,134,5, script Coupon Shop 1 899,{
- set @i,0;
- mes "[Shop Quest NPC]";
- mes "Which item do you wish to obtain?";
- mes "Select only one.";
- callshop "quest_shop",1;
- npcshopattach "quest_shop";
- end;
- OnBuyItem:
- if(.BuildQuest) {
- for(set .e,0; !compare(getarg(.e+1),"Zeny"); set .e,.e+2) {}
- npcshopadditem "quest_shop",getarg(.e+2),getarg(.e)*compare(getarg(.e+1),"SZeny");
- setarray .Shop[.i],getarg(.e+2);
- set .i,.i+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; }
- for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Quest_Setup; }
- mes "[Shop Quest NPC]";
- mes "I require the following:";
- for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
- if(getarg(@i)) mes "^FF0000" + ((Zeny>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Zeny";
- mes "^000000In exchange, I will give you:^0000FF";
- for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
- switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) {
- case 1:
- for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
- next;
- mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + ".";
- mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000.";
- close;
- }
- if(Zeny < getarg(@i)) {
- next;
- mes "You do not have enough Zeny.";
- mes "Please obtain ^FF0000" + (getarg(@i)-Zeny) + " more Zeny^000000.";
- 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);
- if (compare(getarg(@i,0),"announce")) announce strcharinfo(0) + " has just obtained " + getitemname(@bought_nameid) + "!",bc_all;
- close;
- case 2:
- set @bottomview, getlook(3);
- set @topview, getlook(4);
- set @midview, getlook(5);
- addtimer 1000, strnpcinfo(3)+"::On_Leave";
- set @equip,getiteminfo(@bought_nameid, 5);
- set @view, getiteminfo(@bought_nameid, 11);
- if(@equip != -1 && @view > 0) {
- if(@equip & 1) atcommand "@changelook 3 " + @view;
- if(@equip & 256) atcommand "@changelook 1 " + @view;
- if(@equip & 512) atcommand "@changelook 2 " + @view;
- }
- next;
- goto OnBuyItem;
- case 3:
- close;
- }
- On_Leave:
- atcommand "@changelook 1 " + @topview;
- atcommand "@changelook 2 " + @midview;
- atcommand "@changelook 3 " + @bottomview;
- set @equip,0;
- set @view,0;
- set @topview,0;
- set @midview,0;
- set @bottomview,0;
- end;
- OnInit:
- npcshopitem "quest_shop",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,7199,25,0,"Zeny",5301,1;
- case 2: callsub OnBuyItem,7199,25,0,"Zeny",5306,1;
- case 3: callsub OnBuyItem,7199,25,0,"Zeny",5307,1;
- case 4: callsub OnBuyItem,7199,25,0,"Zeny",5308,1;
- case 5: callsub OnBuyItem,7199,25,0,"Zeny",5310,1;
- case 6: callsub OnBuyItem,7199,25,0,"Zeny",5311,1;
- case 7: callsub OnBuyItem,7199,25,0,"Zeny",5312,1;
- case 8: callsub OnBuyItem,7199,25,0,"Zeny",5313,1;
- case 9: callsub OnBuyItem,7199,25,0,"Zeny",5314,1;
- case 10: callsub OnBuyItem,7199,25,0,"Zeny",5315,1;
- case 11: callsub OnBuyItem,7199,25,0,"Zeny",5316,1;
- case 12: callsub OnBuyItem,7199,25,0,"Zeny",5317,1;
- case 13: callsub OnBuyItem,7199,25,0,"Zeny",5318,1;
- case 14: callsub OnBuyItem,7199,25,0,"Zeny",5319,1;
- case 15: callsub OnBuyItem,7199,25,0,"Zeny",5320,1;
- case 16: callsub OnBuyItem,7199,25,0,"Zeny",5321,1;
- case 17: callsub OnBuyItem,7199,25,0,"Zeny",5322,1;
- case 18: callsub OnBuyItem,7199,25,0,"Zeny",5324,1;
- case 19: callsub OnBuyItem,7199,25,0,"Zeny",5333,1;
- case 20: callsub OnBuyItem,7199,25,0,"Zeny",5334,1;
- case 21: callsub OnBuyItem,7199,25,0,"Zeny",5335,1;
- case 22: callsub OnBuyItem,7199,25,0,"Zeny",5336,1;
- case 23: callsub OnBuyItem,7199,25,0,"Zeny",5337,1;
- case 24: callsub OnBuyItem,7199,25,0,"Zeny",5338,1;
- case 25: callsub OnBuyItem,7199,25,0,"Zeny",5339,1;
- case 26: callsub OnBuyItem,7199,25,0,"Zeny",5340,1;
- case 27: callsub OnBuyItem,7199,25,0,"Zeny",5341,1;
- case 28: callsub OnBuyItem,7199,25,0,"Zeny",5342,1;
- case 29: callsub OnBuyItem,7199,25,0,"Zeny",5343,1;
- case 30: callsub OnBuyItem,7199,25,0,"Zeny",5344,1;
- case 31: callsub OnBuyItem,7199,25,0,"Zeny",5345,1;
- case 32: callsub OnBuyItem,7199,25,0,"Zeny",5346,1;
- case 33: callsub OnBuyItem,7199,25,0,"Zeny",5354,1;
- case 34: callsub OnBuyItem,7199,25,0,"Zeny",5355,1;
- case 35: callsub OnBuyItem,7199,25,0,"Zeny",5357,1;
- case 36: callsub OnBuyItem,7199,25,0,"Zeny",5358,1;
- case 37: callsub OnBuyItem,7199,25,0,"Zeny",5359,1;
- case 38: callsub OnBuyItem,7199,25,0,"Zeny",5360,1;
- case 39: callsub OnBuyItem,7199,25,0,"Zeny",5361,1;
- case 40: callsub OnBuyItem,7199,25,0,"Zeny",5362,1;
- case 41: callsub OnBuyItem,7199,25,0,"Zeny",5363,1;
- case 42: callsub OnBuyItem,7199,25,0,"Zeny",5364,1;
- case 43: callsub OnBuyItem,7199,25,0,"Zeny",5365,1;
- case 44: callsub OnBuyItem,7199,25,0,"Zeny",5366,1;
- case 45: callsub OnBuyItem,7199,25,0,"Zeny",5367,1;
- case 46: callsub OnBuyItem,7199,25,0,"Zeny",5370,1;
- case 47: callsub OnBuyItem,7199,25,0,"Zeny",5371,1;
- case 48: callsub OnBuyItem,7199,25,0,"Zeny",5372,1;
- case 49: callsub OnBuyItem,7199,25,0,"Zeny",5373,1;
- case 50: callsub OnBuyItem,7199,25,0,"Zeny",5374,1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement