summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-02-09 00:16:10 -0200
committerJesusaves <cpntb1@ymail.com>2019-02-09 00:16:10 -0200
commitb252965292e08718096289d76547d7c68d442e94 (patch)
tree8ad7c8bcce3a4972192d6d4258e041c88eebeb49
parent1c2001f6ef1ddabd5e1852fe3ce5f2ae687cbad7 (diff)
downloadserverdata-b252965292e08718096289d76547d7c68d442e94.tar.gz
serverdata-b252965292e08718096289d76547d7c68d442e94.tar.bz2
serverdata-b252965292e08718096289d76547d7c68d442e94.tar.xz
serverdata-b252965292e08718096289d76547d7c68d442e94.zip
Send chocolate boxes - OK
Valentine Day event is officially working, just without rewards
-rw-r--r--npc/001-11/Demure.txt63
1 files changed, 63 insertions, 0 deletions
diff --git a/npc/001-11/Demure.txt b/npc/001-11/Demure.txt
index 8e14066b3..7c00f9e1a 100644
--- a/npc/001-11/Demure.txt
+++ b/npc/001-11/Demure.txt
@@ -32,10 +32,73 @@
mesn;
mesq l("How many chocolate do you want to send? You currenly have: @@", countitem(BoxOfChocolates));
input @Val_Ammo;
+ mes "";
+
if (@Val_Ammo > countitem(BoxOfChocolates)) {
mesc l("You don't have that many!");
return;
}
+
+ do {
+ mesn;
+ mesq l("To whom you want to send @@ boxes? Cannot be yourself!", @Val_Ammo);
+ mesc l("Leave blank to abort.");
+ input .@ref$;
+ //debugmes "Sending chocolate to: "+.@ref$;
+ mes "";
+ if (.@ref$ != "") {
+ .@ref=gf_accid(strip(.@ref$));
+ if (.@ref > 0) {
+ if (.@ref == getcharid(3)) {
+ mesn;
+ mesq l("I said it cannot be yourself... </3");
+ next;
+ } else {
+ // Now we do the magic, first of, delete the chocolate and the text input
+ delitem BoxOfChocolates, @Val_Ammo;
+ .@ref$="";
+
+ // Send the Chocolate
+ .@m = htget($@VALENTINE_GIFTSTACKS, .@ref);
+ if (!.@m)
+ htput $@VALENTINE_GIFTSTACKS, .@ref, @Val_Ammo;
+ else
+ htput $@VALENTINE_GIFTSTACKS, .@ref, .@m+@Val_Ammo;
+
+ // Get 1 Point per sent box
+ #VALENTINE_POINTS+=1;
+
+ // Handle Love Letter
+ if (countitem(LoveLetter) {
+ mesn;
+ mesq l("Should I attach a love letter?");
+ next;
+ if (askyesno() == ASK_YES) {
+ delitem LoveLetter, 1;
+
+ // Register your name on love letter
+ .@s$ = htget($@VALENTINE_LOVELETTER, .@ref);
+ if (.@s$ == "")
+ htput $@VALENTINE_LOVELETTER, .@ref, strip(strcharinfo(0));
+ else
+ htput $@VALENTINE_LOVELETTER, .@ref, .@s$+", "+strip(strcharinfo(0));
+
+ // Get the bonus: 1 point for 2 boxes, capped at 25 and minimum 1 extra point
+ // Sending over 50 boxes at once won't give bonus, give another Love Letter.
+ #VALENTINE_POINTS+=min(25, max(1, @Val_Ammo/2));
+
+ } // Love Letter OK
+ } // Not yourself
+ } // Valid Person
+ } else {
+ mesn;
+ mesq l("Oops, there is nobody known as @@ on this game.", .@ref$);
+ mesq l("Could you try again? There could be a typo!");
+ next;
+ } // Invalid Input
+ } // Non void input
+ } while (.@ref$ != "");
+ return;
}
function GetGift {
.@m = htget($@VALENTINE_GIFTSTACKS, getcharid(3));