summaryrefslogtreecommitdiff
path: root/world/map/npc/functions/dailyquest.txt
diff options
context:
space:
mode:
authorThe Kandiman <kandiman@kandiman.(none)>2011-09-10 20:15:17 -0400
committerThe Kandiman <kandiman@kandiman.(none)>2011-09-11 16:48:18 -0400
commit1cb0e75cbd356485ebe35bb3f5af10e1454e57a5 (patch)
tree594bbf4a1bb428ef527f6ce6ec79e4eb3e478607 /world/map/npc/functions/dailyquest.txt
parenta9868851cfe19c503cc72b0289889c564b41dd20 (diff)
downloadserverdata-1cb0e75cbd356485ebe35bb3f5af10e1454e57a5.tar.gz
serverdata-1cb0e75cbd356485ebe35bb3f5af10e1454e57a5.tar.bz2
serverdata-1cb0e75cbd356485ebe35bb3f5af10e1454e57a5.tar.xz
serverdata-1cb0e75cbd356485ebe35bb3f5af10e1454e57a5.zip
Tab conversion and formatting project.
npc/functions and npc/items complete.
Diffstat (limited to 'world/map/npc/functions/dailyquest.txt')
-rw-r--r--world/map/npc/functions/dailyquest.txt112
1 files changed, 60 insertions, 52 deletions
diff --git a/world/map/npc/functions/dailyquest.txt b/world/map/npc/functions/dailyquest.txt
index dc56895b..b984050e 100644
--- a/world/map/npc/functions/dailyquest.txt
+++ b/world/map/npc/functions/dailyquest.txt
@@ -2,11 +2,11 @@
// Variables returned:
// @dq_return - Code of what happend
-// 0 = Low level
-// 1 = Ignored NPC
-// 2 = Not enough points
-// 3 = Not enough items
-// 4 = Success
+// 0 = Low level
+// 1 = Ignored NPC
+// 2 = Not enough points
+// 3 = Not enough items
+// 4 = Success
// Variables to set:
// @dq_level - Minimal level needed to use the quest
@@ -27,73 +27,81 @@
// (DailyQuestBonus makes a good reward from non-daily quests)
-function script DailyQuest {
- set @dq_earliest, gettimetick(2) - 86400;
- if (DailyQuestTime < @dq_earliest) set DailyQuestTime, @dq_earliest;
+function|script|DailyQuest|{
+ set @dq_earliest, gettimetick(2) - 86400;
+ if (DailyQuestTime < @dq_earliest) set DailyQuestTime, @dq_earliest;
- //how many whole daily quest points the player has earned
- //we increment DailyQuestTime by the number of seconds in that many increments
- set @dq_increments, (gettimetick(2) - DailyQuestTime)*BaseLevel / 86400;
- set DailyQuestTime, DailyQuestTime+@dq_increments*86400/BaseLevel;
+ //how many whole daily quest points the player has earned
+ //we increment DailyQuestTime by the number of seconds in that many increments
+ set @dq_increments, (gettimetick(2) - DailyQuestTime)*BaseLevel / 86400;
+ set DailyQuestTime, DailyQuestTime+@dq_increments*86400/BaseLevel;
- //player can't regenerate any quest points, but might have a bonus
- if (DailyQuestPoints >= BaseLevel) goto L_Bonus;
+ //player can't regenerate any quest points, but might have a bonus
+ if (DailyQuestPoints >= BaseLevel) goto L_Bonus;
+
+ //normal recharging case - increment, but don't let it recharge more than a day's worth
+ set DailyQuestPoints, DailyQuestPoints + @dq_increments;
+ if (DailyQuestPoints > BaseLevel) set DailyQuestPoints, BaseLevel;
+ //fallthrough to bonus, which *is* allowed to push DailyQuestPoints above BaseLevel
- //normal recharging case - increment, but don't let it recharge more than a day's worth
- set DailyQuestPoints, DailyQuestPoints + @dq_increments;
- if (DailyQuestPoints > BaseLevel) set DailyQuestPoints, BaseLevel;
- //fallthrough to bonus, which *is* allowed to push DailyQuestPoints above BaseLevel
L_Bonus:
- if (DailyQuestBonus != 0) set DailyQuestPoints, DailyQuestPoints + DailyQuestBonus;
- set DailyQuestBonus, 0;
+ if (DailyQuestBonus != 0) set DailyQuestPoints, DailyQuestPoints + DailyQuestBonus;
+ set DailyQuestBonus, 0;
- if (BaseLevel < @dq_level) goto L_Low_Level;
- if (DailyQuestPoints < @dq_cost) goto L_Not_Enough_Points;
+ if (BaseLevel < @dq_level)
+ goto L_Low_Level;
+ if (DailyQuestPoints < @dq_cost)
+ goto L_Not_Enough_Points;
- mes "\"If you bring me " + @dq_count + " " + @dq_friendly_name$ + ", I will give you a reward.\"";
- menu "I have what you want.", L_Trade,
- "Ok, I'll get to work.", -,
- "Nah, I'm not going to help you.", -;
+ mes "\"If you bring me " + @dq_count + " " + @dq_friendly_name$ + ", I will give you a reward.\"";
+ menu "I have what you want.", L_Trade,
+ "Ok, I'll get to work.", -,
+ "Nah, I'm not going to help you.", -;
- set @dq_return, 1;
- goto L_Exit;
+ set @dq_return, 1;
+ goto L_Exit;
L_Trade:
- if (countitem(@dq_name$) < @dq_count) goto L_Not_Enough;
- delitem @dq_name$, @dq_count;
+ if (countitem(@dq_name$) < @dq_count)
+ goto L_Not_Enough;
+ delitem @dq_name$, @dq_count;
+
+ set zeny, zeny + @dq_money;
+ getexp @dq_exp, 0;
- set zeny, zeny + @dq_money;
- getexp @dq_exp, 0;
+ set DailyQuestPoints, DailyQuestPoints - @dq_cost;
- set DailyQuestPoints, DailyQuestPoints - @dq_cost;
+ if (@dq_handle_return)
+ goto L_Exit_Good;
- if (@dq_handle_return) goto L_Exit_Good;
-
- mes "\"Thank you!\"";
- mes "";
- mes "[" + @dq_money + " money]";
- mes "[" + @dq_exp + " experience points]";
+ mes "\"Thank you!\"";
+ mes "";
+ mes "[" + @dq_money + " money]";
+ mes "[" + @dq_exp + " experience points]";
L_Exit_Good:
- set @dq_return, 4;
- goto L_Exit;
+ set @dq_return, 4;
+ goto L_Exit;
L_Not_Enough:
- if (!@dq_handle_return) mes "\"I said " + @dq_count + " " + @dq_friendly_name$ + "; you should learn to count.\"";
- set @dq_return, 3;
- goto L_Exit;
+ if (!@dq_handle_return)
+ mes "\"I said " + @dq_count + " " + @dq_friendly_name$ + "; you should learn to count.\"";
+ set @dq_return, 3;
+ goto L_Exit;
L_Low_Level:
- if (!@dq_handle_return) mes "\"Hey, you should go kill some things to get stronger first.\"";
- set @dq_return, 0;
- goto L_Exit;
+ if (!@dq_handle_return)
+ mes "\"Hey, you should go kill some things to get stronger first.\"";
+ set @dq_return, 0;
+ goto L_Exit;
L_Not_Enough_Points:
- if (!@dq_handle_return) mes "\"You look exhausted, maybe you should rest a bit.\"";
- set @dq_return, 2;
- goto L_Exit;
+ if (!@dq_handle_return)
+ mes "\"You look exhausted, maybe you should rest a bit.\"";
+ set @dq_return, 2;
+ goto L_Exit;
L_Exit:
- set @dq_handle_return, 0; // Incase they forget
- return;
+ set @dq_handle_return, 0; // Incase they forget
+ return;
}