diff options
author | Wushin <pasekei@gmail.com> | 2015-09-04 22:52:11 -0500 |
---|---|---|
committer | Wushin <pasekei@gmail.com> | 2015-09-04 22:52:11 -0500 |
commit | f9b459730c880b57a77beab8bf348a5605a0a6cb (patch) | |
tree | bb19cf943f459d4ee010db8c606c3dd64baaa5ed | |
parent | 9350e593c161118555a3171770490e61407b2cbe (diff) | |
parent | be594ed37e06b2c2e63ecb678fc6a854059acde2 (diff) | |
download | serverdata-f9b459730c880b57a77beab8bf348a5605a0a6cb.tar.gz serverdata-f9b459730c880b57a77beab8bf348a5605a0a6cb.tar.bz2 serverdata-f9b459730c880b57a77beab8bf348a5605a0a6cb.tar.xz serverdata-f9b459730c880b57a77beab8bf348a5605a0a6cb.zip |
Merge pull request #419 from wushin/max-dp
Cash in max items/dp in Daily Quests
-rw-r--r-- | world/map/npc/functions/dailyquest.txt | 30 |
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; |