summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--world/map/npc/functions/dailyquest.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/world/map/npc/functions/dailyquest.txt b/world/map/npc/functions/dailyquest.txt
index 4448feed..4bbe7800 100644
--- a/world/map/npc/functions/dailyquest.txt
+++ b/world/map/npc/functions/dailyquest.txt
@@ -68,6 +68,7 @@ function|script|DailyQuest
mes "\"If you bring me " + @dq_count + " " + @dq_friendly_name$ + ", I will give you a reward.\"";
menu
"I have what you want.", L_Trade,
+ "Take all you need.", L_All,
"Ok, I'll get to work.", L_Next,
"Nah, I'm not going to help you.", L_Next;
@@ -95,6 +96,35 @@ L_Trade:
mes "[" + @dq_exp + " experience points]";
goto L_Exit_Good;
+L_All:
+ if (countitem(@dq_name$) < @dq_count)
+ goto L_Not_Enough;
+
+ set @item_multiple, (countitem(@dq_name$) / @dq_count);
+ set @dp_multiple, (DailyQuestPoints / @dq_cost);
+
+ if (@dp_multiple > @item_multiple)
+ set @multipler, @item_multiple;
+ if (@item_multiple >= @dp_multiple)
+ set @multipler, @dp_multiple;
+
+ set DailyQuestPoints, DailyQuestPoints - (@dq_cost * @multipler);
+
+ delitem @dq_name$, (@dq_count * @multipler);
+
+ set Zeny, Zeny + (@dq_money * @multipler);
+ getexp (@dq_exp * @multipler), 0;
+
+ if (@dq_handle_return)
+ goto L_Exit_Good;
+
+ mes "\"Thank you!\"";
+ callsub S_SayPhrase;
+ mes "";
+ mes "[" + (@dq_money * @multipler) + " money]";
+ mes "[" + (@dq_exp * @multipler) + " experience points]";
+ goto L_Exit_Good;
+
L_Exit_Good:
set @dq_return, 4;
goto L_Exit;