From c01ee518f81d117b92ac69f634c50e42f69eafe4 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 7 Aug 2019 19:48:52 -0300 Subject: Replace makepot with Transmigration/Transmutation general spell (TODO/WIP) --- npc/magic/transmigration.txt | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 npc/magic/transmigration.txt (limited to 'npc/magic/transmigration.txt') diff --git a/npc/magic/transmigration.txt b/npc/magic/transmigration.txt new file mode 100644 index 000000000..4e45d8510 --- /dev/null +++ b/npc/magic/transmigration.txt @@ -0,0 +1,62 @@ +// TMW2 script +// Author: Jesusalva +// +// Magic Script: TMW2_TRANSMIGRATION +// +// Attempts to make stuff from other stuff +// This is actually referred as transmutation in human-readable forms, and +// transmigration in scripts. + +- script sk#mkpot 32767,{ + end; +OnCall: + // Other requeriments + if (countitem(Plushroom) < 10 || !countitem(Milk)) { + dispbottom l("You need @@ @@ and @@ to cast this skill.", 10, getitemlink(Plushroom), getitemlink(Milk)); + end; + } + + // Check cooldown + if (@mkpot_at > gettimetick(2)) { + dispbottom l("Skill is in cooldown for @@.", FuzzyTime(@mkpot_at)); + end; + } + + // Check requisites + if (!MagicCheck(TMW2_TRANSMIGRATION, 185, -5)) + end; + + // Consume items + delitem Plushroom, 10; + delitem Milk, 1; + + // Create the stuff based on MAGIC_EXP + // The closer to zero, best; + // Each 3 mexp reduces chance to get a fail + // Each skill level reduces chances to get a fail + .@r=rand(141,181)-(MAGIC_EXP/3)-getskilllv(TMW2_TRANSMIGRATION); + if (.@r < 21) { + // Get up to 6 Haste Potions depending on your skill. + getitem HastePotion, abizit()+1; + } else if (.@r < 82) { + getitem any(BottleOfTonoriWater, BottleOfWoodlandWater, BottleOfDivineWater, Milk, CelestiaTea, PileOfAsh), 1; + } else if (.@r < 122) { + getitem any(BottleOfSewerWater, Milk, CelestiaTea, PileOfAsh), 1; + } else if (.@r < 162) { + getitem any(BottleOfSewerWater, BottleOfSewerWater, PileOfAsh), 1; + } else { + dispbottom l("Your items vanishes into thin air. What?!"); + } + + // set cooldown + @mkpot_at=gettimetick(2); + @mkpot_at=@mkpot_at+6; + + // Get a few mana experience points (this is NOT used by Mana Stone) + GetManaExp(TMW2_TRANSMIGRATION, rand2(4,11)); + end; + +OnInit: + bindatcmd "sk-trans", "sk#mkpot::OnCall", 0, 100, 0; + end; +} -- cgit v1.2.3-60-g2f50