From 705118604dd0f0b5b9c275f40d319378ec2f69ab Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 28 Apr 2021 08:50:00 -0300 Subject: Fix Luca's exploit. Correct live server data accordingly. A good thing we have the Evolved project or this would be obviously impossible. --- world/map/db/const-quest.txt | 1 + world/map/npc/002-1/luca.txt | 26 +++++++++++++++----------- world/map/npc/functions/clear_vars.txt | 30 ++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/world/map/db/const-quest.txt b/world/map/db/const-quest.txt index 16f93480..8e434049 100644 --- a/world/map/db/const-quest.txt +++ b/world/map/db/const-quest.txt @@ -137,6 +137,7 @@ FLAG_LUCA_GOT_SIX_SKILLS 262144 // player learned all six Focus Skills FLAG_LUCA_2SKILLS_MAXED 524288 // player got 2 Focus Skills at lvl 9 FLAG_LUCA_4SKILLS_MAXED 1048576 // player got 4 Focus Skills at lvl 9 FLAG_LUCA_6SKILLS_MAXED 2097152 // player got 6 Focus Skills at lvl 9 +FLAG_LUCA_FIX 4194304 // fixed a bug // Flags for the battle caves. BATTLE_CAVE1 1 diff --git a/world/map/npc/002-1/luca.txt b/world/map/npc/002-1/luca.txt index 405df455..4a05b757 100644 --- a/world/map/npc/002-1/luca.txt +++ b/world/map/npc/002-1/luca.txt @@ -50,6 +50,8 @@ L_teach_soon: goto L_Close; L_teach: + // Bugfix death + if (!(FLAGS & FLAG_LUCA_FIX)) goto L_Nev; if (getskilllv(SKILL_POOL)) goto L_teachmore; mes "[Luca the Hunter]"; @@ -235,20 +237,23 @@ L_teachmore: set @raging, getskilllv(SKILL_RAGING); set @lvl9skills, 0; - if (@mallard == 9) + if (@mallard >= 9) set @lvl9skills, @lvl9skills + 1; - if (@brawling == 9) + if (@brawling >= 9) set @lvl9skills, @lvl9skills + 1; - if (@speed == 9) + if (@speed >= 9) set @lvl9skills, @lvl9skills + 1; - if (@poison == 9) + if (@poison >= 9) set @lvl9skills, @lvl9skills + 1; - if (@astralsoul == 9) + if (@astralsoul >= 9) set @lvl9skills, @lvl9skills + 1; - if (@raging == 9) + if (@raging >= 9) set @lvl9skills, @lvl9skills + 1; - if ((FLAGS & (FLAG_LUCA_GOT_SIX_SKILLS + FLAG_LUCA_2SKILLS_MAXED + FLAG_LUCA_4SKILLS_MAXED + FLAG_LUCA_6SKILLS_MAXED)) == (FLAG_LUCA_GOT_SIX_SKILLS + FLAG_LUCA_2SKILLS_MAXED + FLAG_LUCA_4SKILLS_MAXED + FLAG_LUCA_6SKILLS_MAXED)) goto L_CheckSkillsEnd; + if ((FLAGS & FLAG_LUCA_GOT_SIX_SKILLS) && + (FLAGS & FLAG_LUCA_2SKILLS_MAXED) && + (FLAGS & FLAG_LUCA_4SKILLS_MAXED) && + (FLAGS & FLAG_LUCA_6SKILLS_MAXED)) goto L_CheckSkillsEnd; if (!(@mallard && @brawling && @speed && @poison && @astralsoul && @raging) || (FLAGS & FLAG_LUCA_GOT_SIX_SKILLS)) goto L_Check2Skills; mes "[Luca the Hunter]"; @@ -266,7 +271,7 @@ L_teachmore: goto L_Check2Skills; L_Check2Skills: - if (!@lvl9skills >= 2 || (FLAGS & FLAG_LUCA_2SKILLS_MAXED)) goto L_Check4Skills; + if (@lvl9skills < 2 || (FLAGS & FLAG_LUCA_2SKILLS_MAXED)) goto L_Check4Skills; mes "[Luca the Hunter]"; mes "I sense you have maxed out two Focus Skills!"; mes "For that I give you a reward!"; @@ -282,7 +287,7 @@ L_Check2Skills: goto L_Check4Skills; L_Check4Skills: - if (!@lvl9skills >= 4 || (FLAGS & FLAG_LUCA_4SKILLS_MAXED)) goto L_Check6Skills; + if (@lvl9skills < 4 || (FLAGS & FLAG_LUCA_4SKILLS_MAXED)) goto L_Check6Skills; mes "[Luca the Hunter]"; mes "I sense you have maxed out four Focus Skills!"; mes "For that I give the next reward!"; @@ -298,7 +303,7 @@ L_Check4Skills: goto L_Check6Skills; L_Check6Skills: - if (!@lvl9skills >= 6 || (FLAGS & FLAG_LUCA_6SKILLS_MAXED)) goto L_CheckSkillsEnd; + if (@lvl9skills < 6 || (FLAGS & FLAG_LUCA_6SKILLS_MAXED)) goto L_CheckSkillsEnd; mes "[Luca the Hunter]"; mes "I sense you have maxed out six Focus Skills!"; mes "For that I give the final reward!"; @@ -321,7 +326,6 @@ L_InvFull: goto L_CheckSkillsEnd; L_CheckSkillsEnd: - goto L_teachmore2; L_teachmore2: diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt index e98def7d..2abfb118 100644 --- a/world/map/npc/functions/clear_vars.txt +++ b/world/map/npc/functions/clear_vars.txt @@ -18,6 +18,7 @@ function|script|ClearVariables callsub S_Flags; callsub S_Bitmask; callsub S_BlueSage; + callsub S_Luca; callsub S_Easter; callsub S_Easter2008; @@ -236,6 +237,35 @@ S_BlueSage: set QUEST_BlueSage, QUEST_BlueSage & ~((1<<5)|(1<<6)|(1<<7)); return; +S_Luca: + if (FLAGS & FLAG_LUCA_FIX) goto S_Return; + if (FLAGS & FLAG_LUCA_6SKILLS_MAXED) goto S_Luca6; + if (FLAGS & FLAG_LUCA_4SKILLS_MAXED) goto S_Luca4; + if (FLAGS & FLAG_LUCA_2SKILLS_MAXED) goto S_Luca2; + goto S_LucaX; + +S_Luca6: + if (countitem("AssassinMask") < 1) goto S_Return; + delitem "AssassinMask", 1; + set FLAGS, FLAGS ^ FLAG_LUCA_6SKILLS_MAXED; + goto S_Luca4; + +S_Luca4: + if (countitem("AssassinPants") < 1) goto S_Return; + delitem "AssassinPants", 1; + set FLAGS, FLAGS ^ FLAG_LUCA_4SKILLS_MAXED; + goto S_Luca2; + +S_Luca2: + if (countitem("AssassinBoots") < 1) goto S_Return; + delitem "AssassinBoots", 1; + set FLAGS, FLAGS ^ FLAG_LUCA_2SKILLS_MAXED; + goto S_LucaX; + +S_LucaX: + set FLAGS, FLAGS | FLAG_LUCA_FIX; + return; + S_Flags: if (Open_Underground_Palace_Barrier) set FLAGS, FLAGS | FLAG_OPENED_UNDERGROUND; -- cgit v1.2.3-60-g2f50