diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-02-09 00:02:22 -0200 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-02-09 00:02:22 -0200 |
commit | 1c2001f6ef1ddabd5e1852fe3ce5f2ae687cbad7 (patch) | |
tree | e2be272e8ffdf813deaa024c015933c2458e765e /npc/001-11 | |
parent | e270acd927459a0ee9ea480d51272bdb1edf8393 (diff) | |
download | serverdata-1c2001f6ef1ddabd5e1852fe3ce5f2ae687cbad7.tar.gz serverdata-1c2001f6ef1ddabd5e1852fe3ce5f2ae687cbad7.tar.bz2 serverdata-1c2001f6ef1ddabd5e1852fe3ce5f2ae687cbad7.tar.xz serverdata-1c2001f6ef1ddabd5e1852fe3ce5f2ae687cbad7.zip |
Receive chocolate boxes - OK
Diffstat (limited to 'npc/001-11')
-rw-r--r-- | npc/001-11/Demure.txt | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/npc/001-11/Demure.txt b/npc/001-11/Demure.txt index 14b3cd1d3..8e14066b3 100644 --- a/npc/001-11/Demure.txt +++ b/npc/001-11/Demure.txt @@ -5,6 +5,9 @@ // Valentine Event Master 001-11,40,25,0 script Demure#Valentine NPC_FEMALE,{ + goto L_Main; + + // Functions function ScoreValentine { .@nb = query_sql("SELECT c.name, i.value FROM `acc_reg_num_db` AS i, `char` AS c WHERE i.key='#VALENTINE_POINTS' AND i.account_id=c.account_id ORDER BY i.value DESC LIMIT 10", .@name$, .@value); @@ -21,6 +24,40 @@ mes("10."+.@name$[9]+" ("+.@value[9]+")"); next; } + // $@VALENTINE_GIFTSTACKS + // (account id, gifts to receive) + // $@VALENTINE_LOVELETTER + // (account id, list of names) + function SendGift { + mesn; + mesq l("How many chocolate do you want to send? You currenly have: @@", countitem(BoxOfChocolates)); + input @Val_Ammo; + if (@Val_Ammo > countitem(BoxOfChocolates)) { + mesc l("You don't have that many!"); + return; + } + } + function GetGift { + .@m = htget($@VALENTINE_GIFTSTACKS, getcharid(3)); + if (.@m > 0) { + mesq l("Hey, look, you have @@ boxes to collect!", .@m); + .@n$ = htget($@VALENTINE_LOVELETTER, getcharid(3), l("Secret Admirer")); + mesq l("They were given with @@ by @@.", any(l("love"), l("passion"), l("affection")), .@n$); + + inventoryplace BoxOfChocolates, .@m; + getitem BoxOfChocolates, .@m; + htput $@VALENTINE_GIFTSTACKS, getcharid(3), 0; + htput $@VALENTINE_LOVELETTER, getcharid(3), ""; + + } else { + mesq l("Sorry, you don't have any chocolate to pick up."); + } + + return; + } + +// Script begin +L_Main: // Safety Check if ($EVENT$ != "Valentine") { warp "Save", 0, 0; end; @@ -35,12 +72,18 @@ next; do { mesc l("You currently have @@ points, @@ boxes of chocolate and @@ love letters.", #VALENTINE_POINTS, countitem(BoxOfChocolates), countitem(LoveLetter)); - mesc l("@@ boxes of chocolate were given to you as a gift.", #VALENTINE_OPENED-#VALENTINE_RECEIVED); + if (#VALENTINE_OPENED-#VALENTINE_RECEIVED > 0) { + mesc l("@@ boxes of chocolate were given to you as a gift.", #VALENTINE_OPENED-#VALENTINE_RECEIVED); + // Demure can just send Soren's Chocolate to somebody else. + // Everyone else cannot send their gift chocolates. Please don't lose the boxes. + if (!is_gm()) + .@eatfirst=true; + } mes ""; select l("Information"), l("Scoreboards"), - l("Send Chocolate"), + rif(!.@eatfirst, l("Send Chocolate")), l("Receive Chocolate"), l("Okay, bye"); mes ""; @@ -59,6 +102,7 @@ next; mes l("When receiving the chocolate, you must eat it before event ends to get a point for that!"); mes l("These boxes cannot be sold, but they'll be deleted a while after the event ends."); + mes l("You also cannot send any boxes before eating any you've received, but Demure is an exception for this rule."); next; mes l("As with all TMW2 Major Events, the top 1 receive a special pet, and the other ranked ones get diverse rewards."); mes l("There might be reward for anyone who doesn't gets a rank, but I never count on that. So, let's start?"); @@ -68,9 +112,10 @@ ScoreValentine(); break; case 3: + SendGift(); next; + break; case 4: - mesn; - mesq l("NYI"); + GetGift(); next; break; } } while (@menu != 5); |