summaryrefslogtreecommitdiff
path: root/npc/custom/quests/quest_shop.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/custom/quests/quest_shop.txt')
-rw-r--r--npc/custom/quests/quest_shop.txt42
1 files changed, 25 insertions, 17 deletions
diff --git a/npc/custom/quests/quest_shop.txt b/npc/custom/quests/quest_shop.txt
index 3f69c73ef..fb5b7993d 100644
--- a/npc/custom/quests/quest_shop.txt
+++ b/npc/custom/quests/quest_shop.txt
@@ -3,24 +3,30 @@
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
-//= 1.6
-//===== Compatible With: =====================================
-//= Hercules
+//= 1.6a
//===== Description: =========================================
//= A dynamic quest shop based on Lunar's, with easier config.
//= Includes support for multiple shops & cashpoints.
//= Item Preview script by ToastOfDoom.
+//===== Additional Comments: =================================
+//= 1.0 Initial script.
+//= 1.2 Added category support.
+//= 1.3 More options and fixes.
+//= 1.4 Added debug settings.
+//= 1.5 Replaced categories with shop IDs.
+//= 1.6 Added support for purchasing stackables.
+//= 1.6a Added support for previewing costumes and robes.
//============================================================
// Shop NPCs -- supplying no argument displays entire menu.
// callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}};
//============================================================
-prontera,164,203,6 script Quest Shop#1 998,{ callfunc "qshop"; }
+prontera,164,203,6 script Quest Shop#1 4_M_MOCASS2,{ callfunc "qshop"; }
// Script Core
//============================================================
-- script quest_shop -1,{
+- script quest_shop -1,{
function Add; function Chk; function Slot; function A_An;
OnInit:
freeloop(1);
@@ -116,13 +122,13 @@ OnBuyItem:
mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
next;
setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11);
- if (((@qe[1] & 1) || (@qe[1] & 256) || (@qe[1] & 512)) && @qe[2] > 0)
+ if (@qe[2] > 0 && ((@qe[1] & 1) || (@qe[1] & 256) || (@qe[1] & 512) || (@qe[1] & 1024) || (@qe[1] & 2048) || (@qe[1] & 4096) || (@qe[1] & 4) || (@qe[1] & 8192)))
set .@preview,1;
addtimer 1000, strnpcinfo(0)+"::OnEnd";
while(1) {
- switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[6])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
+ switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
case 1:
- if (@qe[0]) {
+ if (@qe[0]) {
mes "[Quest Shop]";
mes "You're missing one or more quest requirements.";
close;
@@ -132,19 +138,20 @@ OnBuyItem:
mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
close;
}
- if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]);
+ if (.@q[4]) Zeny -= (.@q[4]*.@q[1]);
if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]);
if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
delitem .@q[.@i],.@q[.@i+1]*.@q[1];
getitem .@q[0],.@q[2];
if (.Announce) announce strcharinfo(0)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):A_An(getitemname(.@q[0])))+"!",0;
- specialeffect2 699;
+ specialeffect2 EF_FLOWERLEAF;
close;
case 2:
- setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), 1;
- if (@qe[1] & 1) changelook LOOK_HEAD_BOTTOM, @qe[2];
- if (@qe[1] & 256) changelook LOOK_HEAD_TOP, @qe[2];
- if (@qe[1] & 512) changelook LOOK_HEAD_MID, @qe[2];
+ setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1;
+ if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2];
+ else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2];
+ else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2];
+ else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2];
break;
case 3:
close;
@@ -152,12 +159,13 @@ OnBuyItem:
}
OnEnd:
- if (@qe[6]) {
+ if (@qe[7]) {
changelook LOOK_HEAD_BOTTOM, @qe[3];
changelook LOOK_HEAD_TOP, @qe[4];
changelook LOOK_HEAD_MID, @qe[5];
+ changelook LOOK_ROBE, @qe[6];
}
- deletearray @qe[0],7;
+ deletearray @qe[0],8;
end;
function Add {
@@ -219,4 +227,4 @@ function script qshop {
- shop qshop2 -1,909:-1
- shop qshop3 -1,909:-1
- shop qshop4 -1,909:-1
-- shop qshop5 -1,909:-1 \ No newline at end of file
+- shop qshop5 -1,909:-1