summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-11-26 16:56:03 -0300
committerJesusaves <cpntb1@ymail.com>2022-11-26 16:56:03 -0300
commitc8385ed28192a88ad07b74714e2a712e07515716 (patch)
tree2cbfd5e6e41c2923eabbad2fdaabbe3860911b6c
parentc50dbd8d3b50a90fa4530e5e9a8dfc2d02b5f5ac (diff)
downloadserverdata-c8385ed28192a88ad07b74714e2a712e07515716.tar.gz
serverdata-c8385ed28192a88ad07b74714e2a712e07515716.tar.bz2
serverdata-c8385ed28192a88ad07b74714e2a712e07515716.tar.xz
serverdata-c8385ed28192a88ad07b74714e2a712e07515716.zip
Refactor how trait is selected (internal code only)
-rw-r--r--npc/025-1/phoenix.txt57
1 files changed, 32 insertions, 25 deletions
diff --git a/npc/025-1/phoenix.txt b/npc/025-1/phoenix.txt
index 5e80f4151..88b4deb86 100644
--- a/npc/025-1/phoenix.txt
+++ b/npc/025-1/phoenix.txt
@@ -4,6 +4,36 @@
// Notes:
// Phoenix Rebirth
+// ChooseTrait()
+function script ChooseTrait {
+ mesc l("Please select a trait.");
+ mesc l("This choice CANNOT be undone later."), 1;
+ menuint
+ l("Cancel"), 0,
+ rif(!(PCBONUS & PCB_ATKBONUS), l("Atk +25")), PCB_ATKBONUS,
+ rif(!(PCBONUS & PCB_MATKBONUS), l("Matk +25")), PCB_MATKBONUS,
+ rif(!(PCBONUS & PCB_DEFBONUS), l("Def +20")), PCB_DEFBONUS,
+ rif(!(PCBONUS & PCB_MDEFBONUS), l("MDEF +10")), PCB_MDEFBONUS,
+ rif(!(PCBONUS & PCB_EVDBONUS), l("Evasion +20")), PCB_EVDBONUS,
+ rif(!(PCBONUS & PCB_HITBONUS), l("Accuracy +25")), PCB_HITBONUS,
+ rif(!(PCBONUS & PCB_CRITBONUS), l("Crit +5%")), PCB_CRITBONUS,
+ rif(!(PCBONUS & PCB_DOUBLEATK), l("Double Attack +5%")), PCB_DOUBLEATK,
+ rif(!(PCBONUS & PCB_ALLSTATS), l("All Stats +1")), PCB_ALLSTATS,
+ rif(!(PCBONUS & PCB_HPBONUS), l("HP +500")), PCB_HPBONUS,
+ rif(!(PCBONUS & PCB_MPBONUS), l("MP +200")), PCB_MPBONUS,
+ rif(!(PCBONUS & PCB_ASPDBONUS), l("Atk. Speed +10")), PCB_ASPDBONUS,
+ rif(!(PCBONUS & PCB_WSPDBONUS), l("Walk +5%")), PCB_WSPDBONUS,
+ rif(!(PCBONUS & PCB_WEIGHTBONUS), l("Max Weight +1kg")), PCB_WEIGHTBONUS,
+ rif(!(PCBONUS & PCB_EXPBONUS), l("EXP Gain +10%")), PCB_EXPBONUS,
+ rif(!(PCBONUS & PCB_NOKNOCKBACK), l("Knockback Immunity")), PCB_NOKNOCKBACK,
+ rif(REBIRTH && !(PCBONUS & PCB_SPLASHMASTER), l("AoE (not stackable)")), PCB_SPLASHMASTER,
+ rif(REBIRTH && !(PCBONUS & PCB_RANGEMASTER), l("Atk Range +1")), PCB_RANGEMASTER,
+ rif(REBIRTH < 5 && !(PCBONUS & PCB_LEGENDARY), l("No penalty against Legendary mobs")), PCB_LEGENDARY;
+ if (@menuret == 0) return false;
+ PCBONUS=PCBONUS|@menuret;
+ return true;
+}
+
025-1,66,21,0 script Phoenix Rebirth NPC_BRGUARD_SPEAR,{
setpcblock(PCBLOCK_HARD, true);
.@phoenix = true;
@@ -83,31 +113,8 @@ OnMain:
close;
setnpcdialogtitle l("Rebirth Trait Selection");
- mesc l("Please select a trait.");
- mesc l("This choice CANNOT be undone later."), 1;
- menuint
- l("Cancel"), 0,
- rif(!(PCBONUS & PCB_ATKBONUS), l("Atk +25")), PCB_ATKBONUS,
- rif(!(PCBONUS & PCB_MATKBONUS), l("Matk +25")), PCB_MATKBONUS,
- rif(!(PCBONUS & PCB_DEFBONUS), l("Def +20")), PCB_DEFBONUS,
- rif(!(PCBONUS & PCB_MDEFBONUS), l("MDEF +10")), PCB_MDEFBONUS,
- rif(!(PCBONUS & PCB_EVDBONUS), l("Evasion +20")), PCB_EVDBONUS,
- rif(!(PCBONUS & PCB_HITBONUS), l("Accuracy +25")), PCB_HITBONUS,
- rif(!(PCBONUS & PCB_CRITBONUS), l("Crit +5%")), PCB_CRITBONUS,
- rif(!(PCBONUS & PCB_DOUBLEATK), l("Double Attack +5%")), PCB_DOUBLEATK,
- rif(!(PCBONUS & PCB_ALLSTATS), l("All Stats +1")), PCB_ALLSTATS,
- rif(!(PCBONUS & PCB_HPBONUS), l("HP +500")), PCB_HPBONUS,
- rif(!(PCBONUS & PCB_MPBONUS), l("MP +200")), PCB_MPBONUS,
- rif(!(PCBONUS & PCB_ASPDBONUS), l("Atk. Speed +10")), PCB_ASPDBONUS,
- rif(!(PCBONUS & PCB_WSPDBONUS), l("Walk +5%")), PCB_WSPDBONUS,
- rif(!(PCBONUS & PCB_WEIGHTBONUS), l("Max Weight +1kg")), PCB_WEIGHTBONUS,
- rif(!(PCBONUS & PCB_EXPBONUS), l("EXP Gain +10%")), PCB_EXPBONUS,
- rif(!(PCBONUS & PCB_NOKNOCKBACK), l("Knockback Immunity")), PCB_NOKNOCKBACK,
- rif(REBIRTH && !(PCBONUS & PCB_SPLASHMASTER), l("AoE (not stackable)")), PCB_SPLASHMASTER,
- rif(REBIRTH && !(PCBONUS & PCB_RANGEMASTER), l("Atk Range +1")), PCB_RANGEMASTER,
- rif(REBIRTH < 5 && !(PCBONUS & PCB_LEGENDARY), l("No penalty against Legendary mobs")), PCB_LEGENDARY;
- if (@menuret == 0) return;
- PCBONUS=PCBONUS|@menuret;
+ if (!ChooseTrait())
+ close;
// Okay, then a rebirth it is!
expandinventory(3);