// TMW2 Scripts // Author: Jesusalva // SQuest_ElliChest, which gives equipments but cannot be open before MK is down. 011-4,265,68,0 script Elli's Chest NPC_CHEST_BIG,{ mesn; if ($GAME_STORYLINE < 5) { mesc l("This chest belongs to Elli and is sealed by a great power. At this point in time, it is impossible to open it."); close; } // Bitwise storing which seasons were open .@season = 2 ** season(); mesc l("This is Elli's chest."); if (getq(SQuest_ElliChest) & .@season) { mesc l("You already opened it recently. Please wait a few months before Elli replenishes it."); close; } mesc l("Elli prepared a prize for you... If you manage to open it."); switch (season()) { case SUMMER: setarray(.@item, CherryCocktail, CactusCocktail, AppleCocktail); .@prize=ElliEssence; break; case WINTER: setarray(.@item, Snowflake, CaramelCandy, SmallChocolateBar); .@prize=AngelWings; break; case SPRING: setarray(.@item, Rose, Tulip, Blueberries); .@prize=DragonWings; break; case AUTUMN: setarray(.@item, Lawncandy, Saulcandy, Poocandy); .@prize=ElliDisguise; break; } mesc l("Maybe %s %s will do it.", fnum(1000), getitemlink(.@item[0])); mesc l("Maybe %s %s will do it.", fnum(1000), getitemlink(.@item[1])); mesc l("Maybe %s %s will do it.", fnum(1000), getitemlink(.@item[2])); if (!.@prize) { next; mesn l("Elli"); mesq l("Not today, I still haven't decided the prize!"); close; } if (countitem(.@item[0]) < 1000) close; if (countitem(.@item[1]) < 1000) close; if (countitem(.@item[2]) < 1000) close; mesc l("Deliver the items to the Chest?"), 1; if (askyesno() == ASK_NO) close; delitem .@item[0], 1000; delitem .@item[1], 1000; delitem .@item[2], 1000; getitem .@prize, 1; setq SQuest_ElliChest, (getq(SQuest_ElliChest) | .@season); mes ""; mesc l("You found a(n) %s inside.", getitemlink(.@prize)); close; OnInit: .sex=G_OTHER; .distance=5; end; }