diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-08-09 23:11:00 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-08-09 23:11:00 -0300 |
commit | 5e1f768729778a60be895e46815486444734a95e (patch) | |
tree | 522f9593c38c75d641cbe859b97fb895451440f8 | |
parent | 74c66143ed8d693792b09b933e25df4b51b1a904 (diff) | |
download | serverdata-5e1f768729778a60be895e46815486444734a95e.tar.gz serverdata-5e1f768729778a60be895e46815486444734a95e.tar.bz2 serverdata-5e1f768729778a60be895e46815486444734a95e.tar.xz serverdata-5e1f768729778a60be895e46815486444734a95e.zip |
Rewrite how Transmigration works (it is now bad and maybe broken)
-rw-r--r-- | db/re/skill_tree.conf | 2 | ||||
-rw-r--r-- | npc/functions/clientversion.txt | 3 | ||||
-rw-r--r-- | npc/magic/transmigration.txt | 100 |
3 files changed, 79 insertions, 26 deletions
diff --git a/db/re/skill_tree.conf b/db/re/skill_tree.conf index bf1308ae2..62a80a57f 100644 --- a/db/re/skill_tree.conf +++ b/db/re/skill_tree.conf @@ -47,7 +47,7 @@ Human: { TMW2_ZARKOR: 3 TMW2_PARUM: 0 TMW2_KALMURK: 4 - TMW2_TRANSMIGRATION: 20 + TMW2_TRANSMIGRATION: 10 TMW2_DEMURE: 15 TMW2_DRAGOKIN: 5 TMW2_LIMERIZER: 5 diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt index 9c5102a82..5d0346c85 100644 --- a/npc/functions/clientversion.txt +++ b/npc/functions/clientversion.txt @@ -534,6 +534,9 @@ function script clientupdater { if (countitem(JesusalvaGrimorium) && getskilllv(TMW2_SKILLPERMIT) == 2) { skill TMW2_SKILLPERMIT, 3, 0; } + if (getskilllv(TMW2_TRANSMIGRATION) > 10) { + skill TMW2_TRANSMIGRATION, 10, 0; + } } diff --git a/npc/magic/transmigration.txt b/npc/magic/transmigration.txt index 4e45d8510..4fb2232e2 100644 --- a/npc/magic/transmigration.txt +++ b/npc/magic/transmigration.txt @@ -10,12 +10,6 @@ - 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)); @@ -26,26 +20,82 @@ OnCall: 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; + do { + mes ".:: " + l("Transmutation Skill") + " ::."; + mesc l("What will you transmute today?"); + mes ""; + menuint + l("Haste Potion"), HastePotion, + l("Mouboo Figurine"), MoubooFigurine; + + mes ""; + switch (@menuret) { + case HastePotion: + mesc l("Transmutating @@ will require:", getitemlink(@menuret)); + mesc l("* @@/@@ @@", countitem(Plushroom), 10, getitemlink(Plushroom)); + mesc l("* @@/@@ @@", countitem(Milk), 1, getitemlink(Milk)); + next; + mesc l("Transmute?!"); + if (askyesno() == ASK_NO) + @menuret=0; + break; + case MoubooFigurine: + mesc l("Transmutating @@ will require:", getitemlink(@menuret)); + mesc l("* @@/@@ @@", countitem(WoodenLog), 1, getitemlink(WoodenLog)); + next; + mesc l("Transmute?!"); + if (askyesno() == ASK_NO) + @menuret=0; + break; + } + } while (!@menuret); + + // Close the dialog + closeclientdialog; + + // Check and Consume the reagents + switch (@menuret) { + case HastePotion: + if (countitem(Plushroom) < 10 || + countitem(Milk) < 1) { + dispbottom l("Not enough items!"); + end; + } + // Consume items + delitem Plushroom, 10; + delitem Milk, 1; + break; + case MoubooFigurine: + if (countitem(WoodenLog) < 1) { + dispbottom l("Not enough items!"); + end; + } + // Consume items + delitem WoodenLog, 1; + break; + } + + // Do the roll from 1 to 100 + // Base success chance is 0% + // Each abizit() point gives you 18% success rate (max 90%) + // Each skill level gives you 1% success rate (max 10%) + .@r=rand2(1, 100)-abizit()*18-getskilllv(TMW2_TRANSMIGRATION); + + // Backfire chance: 30% + if (.@r >= 70) { + dispbottom l("The spell backfires!"); + percentheal -(rand2(5, 15)), 0; + // Chance for nothing to happen + } else if (.@r >= 30) { + dispbottom l("Your reagents vanish into emptiness!"); + // Chance for you getting a junk item + } else if (.@r > 0) { + dispbottom l("Your spell takes a mind of its own and shapes in something else!"); + geitem WarpedLog, 1; + // You were successful } else { - dispbottom l("Your items vanishes into thin air. What?!"); + dispbottom l("*plim*"); + getitem @menuret, 1; } // set cooldown |