diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-02-15 00:09:20 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-02-15 00:09:20 -0300 |
commit | 3247dd7d8de40a76b6973a41102ee7047f6aa07e (patch) | |
tree | dd5aa617ee6f5e74a5035acb09d3d466012aa7db | |
parent | fd5bfe1aaee2a55b1e4adcc72ea67cadeffffbd6 (diff) | |
download | serverdata-3247dd7d8de40a76b6973a41102ee7047f6aa07e.tar.gz serverdata-3247dd7d8de40a76b6973a41102ee7047f6aa07e.tar.bz2 serverdata-3247dd7d8de40a76b6973a41102ee7047f6aa07e.tar.xz serverdata-3247dd7d8de40a76b6973a41102ee7047f6aa07e.zip |
[Skip CI] Valentine Day event - eat multiple + Demure bugfixes
-rw-r--r-- | db/re/item_db.conf | 12 | ||||
-rw-r--r-- | npc/001-11/Demure.txt | 4 | ||||
-rw-r--r-- | npc/items/valentine.txt | 33 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
4 files changed, 25 insertions, 25 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 506f72804..8e54658b9 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -2600,17 +2600,7 @@ item_db: ( noauction: true } Script: <" - if ($EVENT$ != "Valentine" || #VALENTINE_OPENED >= #VALENTINE_RECEIVED) { - dispbottom l("Past due date."); - } else { - // I know technically this is wrong grammar, but I want fixed width - #VALENTINE_OPENED=#VALENTINE_OPENED+1; - #VALENTINE_POINTS=#VALENTINE_POINTS+1; - if (rand(0,1)) - dispbottom l("It's tasty ^.^"); - else - dispbottom l("It's yummy ^.^"); - } + callfunc("EatValentineChocolate"); "> }, { diff --git a/npc/001-11/Demure.txt b/npc/001-11/Demure.txt index 7608e79fd..c36ca4cf8 100644 --- a/npc/001-11/Demure.txt +++ b/npc/001-11/Demure.txt @@ -77,7 +77,7 @@ mesn; mesq l("Should I attach a love letter?"); next; - .@totalneed=@Val_Ammo/10+1; + .@totalneed=@Val_Ammo/10+(@Val_Ammo % 10 ? 1 : 0); select l("Yes, one"), //rif(countitem(LoveLetter) >= .@totalneed, l("Yes, %d", .@totalneed)), @@ -88,7 +88,7 @@ // Custom input if (@menu == 2) { mes l("How many %s should I attach?", getitemlink(LoveLetter)); - mesc l("Recommended: %d | Max: %d", countitem(LoveLetter), .@totalneed); + mesc l("Recommended: ##B%d##b | Max: %d", .@totalneed, countitem(LoveLetter)); input .@totalneed; if (.@totalneed > countitem(LoveLetter)) .@totalneed=countitem(LoveLetter); diff --git a/npc/items/valentine.txt b/npc/items/valentine.txt index 259b4fcb3..2bb56ab26 100644 --- a/npc/items/valentine.txt +++ b/npc/items/valentine.txt @@ -4,19 +4,28 @@ // Description: // Valentine eating -// Create a random card, with rares +// Eats chocolate, returns bad ones if requested +// EatValentineChocolate() function script EatValentineChocolate { - if ($EVENT$ != "Valentine" || #VALENTINE_OPENED >= #VALENTINE_RECEIVED) { - dispbottom l("Past due date."); - } else { - // I know technically this is wrong grammar, but I want fixed width - #VALENTINE_OPENED=#VALENTINE_OPENED+1; - #VALENTINE_POINTS=#VALENTINE_POINTS+1; - if (rand(0,1)) - dispbottom l("It's tasty ^.^"); - else - dispbottom l("It's yummy ^.^"); - } + if ($EVENT$ != "Valentine") { + dispbottom l("Past due date."); + } else if (#VALENTINE_OPENED >= #VALENTINE_RECEIVED) { + dispbottom l("This is not meant for me."); + getitem BoxOfChocolates, 1; + } else { + .@pts=1; + if (!GSET_VALENTINE_EATONE) { + .@pts=(#VALENTINE_RECEIVED-#VALENTINE_OPENED); + delitem BoxOfChocolates, .@pts-1; + } + // I know technically this is wrong grammar, but I want fixed width + #VALENTINE_OPENED=#VALENTINE_OPENED+.@pts; + #VALENTINE_POINTS=#VALENTINE_POINTS+.@pts; + if (rand2(0,1)) + dispbottom l("It's tasty ^.^"); + else + dispbottom l("It's yummy ^.^"); + } return; } diff --git a/npc/scripts.conf b/npc/scripts.conf index 1b5cba8c0..864adfe9a 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -81,6 +81,7 @@ "npc/items/mercenary.txt", "npc/items/shovel.txt", "npc/items/teleporter.txt", +"npc/items/valentine.txt", // Crafting System "npc/craft/options.txt", |