From ee2ec41a30c4575d037f20c0a9e2a4d642a08122 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 28 Oct 2019 00:50:09 -0300 Subject: Handle rewards and fix a typo (untested) --- db/re/item_db.conf | 2 +- npc/functions/event.txt | 95 +++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 90 insertions(+), 7 deletions(-) diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 20c0de9fd..dc3dbe4ae 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -1720,7 +1720,7 @@ item_db: ( noauction: true } Script: <" - setarray .@r, StrangeCoin, StrangeCoin, IronIngot, CopperIngot, TinIngot, SilverIngot, GoldIngot, PlatinumOre, IridiumOre, TitaniumOre, LeadOre, FourLeafClover, MercBoxA, MercBoxB, GoldenGift, ThornAmmoBox, PoisonAmmoBox, PolishedDiamond, PolishedRuby, PolishedEmerald, PolishedSapphire, PolishedAmethyst, PolishedTopaz, SacredLifePotion, SacredManaPotion, AncientBlueprint, ArcmageBoxset, MysteryFruit; + setarray .@r, StrangeCoin, StrangeCoin, IronIngot, CopperIngot, TinIngot, SilverIngot, GoldIngot, PlatinumOre, IridiumOre, TitaniumOre, LeadOre, FourLeafClover, MercBoxA, MercBoxB, GoldenGift, ThornAmmoBox, PoisonAmmoBox, PolishedDiamond, PolishedRuby, PolishedEmerald, PolishedSapphire, PolishedAmethyst, PolishedTopaz, SacredLifePotion, SacredManaPotion, AncientBlueprint, ArcmageBoxset, MysteriousFruit; .@n=rand(getarraysize(.@r)); if (.@n > 1) diff --git a/npc/functions/event.txt b/npc/functions/event.txt index 4e4a30c81..e77f8409c 100644 --- a/npc/functions/event.txt +++ b/npc/functions/event.txt @@ -94,8 +94,8 @@ function script sThanksgiving { // Your prize is saved in .@luck. Rigged against fruits .@luck=rand2(0,11); .@luck=(.@luck == 10 ? rand2(0,11) : .@luck); - // A fruit before 7 days: rig to Arcmage or to blueprint - if (.@luck == 10 && #THANKS_STREAK < 7) + // A fruit before 10 days: rig to Arcmage or to blueprint + if (.@luck == 10 && #THANKS_STREAK < 10) .@luck+=any(-1,1); // Extra spins .@extra=rand2(1,3); @@ -109,12 +109,95 @@ function script sThanksgiving { sleep2(60); } mes l(".:: Congratulations ::."); - //#THANKS_DAY = gettime(5) - mes l("You got a %d", .@luck); - mesf "Spins: %d/%d (cur %d extra %d)", .@i, .@spins, .@cur, .@extra; - next; + //#THANKS_DAY = gettime(5); + #THANKS_STREAK+=1; + if (debug || $@GM_OVERRIDE) { + mes l("You got a %d", .@luck); + mesf "Spins: %d/%d (cur %d extra %d)", .@i, .@spins, .@cur, .@extra; + next; + } + + // Switch the reward + switch (.@luck) { + case 0: // EXP + .@p=BaseLevel*#THANKS_STREAK; + .@p*=2; + getexp .@p, 0; + mes l("You got %d EXP!", .@p); + break; + case 1: // JEXP + .@p=BaseLevel*#THANKS_STREAK; + getexp 0, .@p; + mes l("You got %d JEXP!", .@p); + break; + case 2: // GP + .@p=BaseLevel*#THANKS_STREAK; + Zeny+=.@p; + mes l("You got %d GP!", .@p); + break; + case 3: // MOBPT + .@p=BaseLevel*#THANKS_STREAK; + Mobpt+=.@p; + mes l("You got %d Monster Points!", .@p); + break; + case 4: // RES + .@p=BaseLevel*#THANKS_STREAK; + .@p*=3; + REAL_ESTATE_CREDITS+=.@p; + mes l("You got %d Real Estate Credits!", .@p); + break; + case 5: // GIFT + .@p=BronzeGift; + .@p=(#THANKS_STREAK > 7 ? SilverGift : .@p); + .@p=(#THANKS_STREAK > 14 ? GoldenGift : .@p); + .@p=(#THANKS_STREAK > 21 ? PrismGift : .@p); + .@p=(#THANKS_STREAK > 27 ? SupremeGift : .@p); + mes l("You got a(n) %s gift!", getitemlink(.@p)); + break; + case 6: // STR C + .@p=#THANKS_STREAK; + getitem StrangeCoin, .@p; + mes l("You got %d %s!", .@p, getitemlink(StrangeCoin)); + break; + case 7: // HERO C + .@p=#THANKS_STREAK; + .@p+=1; + getitem HeroCoin, .@p; + mes l("You got %d %s!", .@p, getitemlink(HeroCoin)); + break; + case 8: // MERC + .@p=any(MercCard_GonzoDark, MercCard_Rosa, MercCard_Soren, MercCard_Apane); + .@p=(#THANKS_STREAK > 7 ? any(MercCard_EarthWitch, MercCard_Demure, MercCard_Jesusalva, MercCard_Pookie) : .@p); + .@p=(#THANKS_STREAK > 14 ? any(MercCard_Arthur, MercCard_LawnCable, MercCard_Crazyfefe, MercCard_Saulc) : .@p); + .@p=(#THANKS_STREAK > 21 ? any(MercCard_Swezanne, MercCard_DragonStar, MercCard_Msawis, MercCard_Aisen) : .@p); + .@p=(#THANKS_STREAK > 27 ? any(MercCard_Xanthem, MercCard_Woody, MercCard_Lilanna) : .@p); + getitem .@p, 1; + mes l("You got a %s!", getitemlink(.@p)); + break; + case 9: // CARD + .@p=any(NatureCard, NinjaCard, MageCard, DruidCard, ClericCard, KnightCard, HeroCard, NecromancerCard); + .@p=(#THANKS_STREAK > 24 ? any(SpeedCard, ReflectCard, PowerCard, WallCard) : .@p); + getitem .@p, 1; + mes l("You got a %s!", getitemlink(.@p)); + break; + case 10: // FRUIT + .@p=MysteriousFruit; + getitem .@p, 1; + mes l("You got a %s!", getitemlink(.@p)); + break; + case 11: // BLUE + .@p=any(EquipmentBlueprintA, AlchemyBlueprintA); + .@p=(#THANKS_STREAK > 7 ? any(EquipmentBlueprintB, AlchemyBlueprintB) : .@p); + .@p=(#THANKS_STREAK > 14 ? any(EquipmentBlueprintC, AlchemyBlueprintC) : .@p); + .@p=(#THANKS_STREAK > 21 ? any(EquipmentBlueprintD, AlchemyBlueprintD) : .@p); + .@p=(#THANKS_STREAK > 27 ? any(EquipmentBlueprintE, AlchemyBlueprintE) : .@p); + getitem .@p, 1; + mes l("You got a %s!", getitemlink(.@p)); + break; + } // Close + next; setskin ""; closeclientdialog; return; -- cgit v1.2.3-70-g09d2