summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--world/map/db/const-quest.txt30
-rw-r--r--world/map/db/const.txt1
-rw-r--r--world/map/db/item_db.conf4
-rw-r--r--world/map/db/item_db_weapon.txt4
-rw-r--r--world/map/npc/099-7/boss.txt8
-rw-r--r--world/map/npc/099-7/chronos.txt73
-rw-r--r--world/map/npc/functions/clear_vars.txt16
7 files changed, 103 insertions, 33 deletions
diff --git a/world/map/db/const-quest.txt b/world/map/db/const-quest.txt
index aa8512ba..6f3f7148 100644
--- a/world/map/db/const-quest.txt
+++ b/world/map/db/const-quest.txt
@@ -129,16 +129,26 @@ FLAG_SANTAS_HELPER 1024 // player gave presents to Santa's helper
FLAG_HURNSMINE_CHEST 2048 // player opened the chest with the short sword in Hurnscald mines
FLAG_GOT_BEANIEHAT 4096 // player got Beanie Copter Hat from Milly
FLAG_DECLINED_BEANIEHAT 8192 // player declined Beanie Copter Hat from Milly
-FLAG_KESHLAM_FLAWEDLENS 16384 // player got the Flawed Lens from Keshlam's Chest
-FLAG_KESHLAM_RAREDROP 32768 // player got the super rare from Keshlam's Chest
-FLAG_BEHEADER_MASK 65536 // traded with The Beheader
-FLAG_GOT_BEHEADER_SWORD 131072 // Obtained the Beheader Sword
-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
-FLAG_XMAS21 8388608 // Christmas 2021 Rewards
+//FLAG_ 16384 // not used at the moment
+//FLAG_ 32768 // not used at the moment
+FLAG_BEHEADER_MASK 65536 // traded with The Beheader
+FLAG_GOT_BEHEADER_SWORD 131072 // Obtained the Beheader Sword
+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
+FLAG_XMAS21 8388608 // Christmas 2021 Rewards
+FLAG_KESHLAM_REPACKED 16777216 // Moved FLAG_KESHLAM_FLAWEDLENS (16384) and FLAG_KESHLAM_RAREDROP (32768) to KESHLAM_STATE
+
+// Flags set in the KESHLAM_STATE variable:
+FLAG_KESHLAM_FLAWEDLENS 65536 // player got the Flawed Lens from Keshlam's Chest
+FLAG_KESHLAM_RAREDROP 131072 // player got the super rare from Keshlam's Chest
+// Constants related to Chronos
+// BOSS_MEDALS is using bits 1-8 (BYTE_0_SHIFT, BYTE_0_MASK)
+// BOSS_MEDALS_AVAILABLE is using bits 9-16 (BYTE_1_SHIFT, BYTE_1_MASK)
+CHRONOS_BOSS_MEDALS_MAX 255
+// constants can only be -2147483648 till 2147483647 so its not possible to make the mask 4293918720
// Flags for the battle caves.
BATTLE_CAVE1 1
diff --git a/world/map/db/const.txt b/world/map/db/const.txt
index f277da84..6490a6f5 100644
--- a/world/map/db/const.txt
+++ b/world/map/db/const.txt
@@ -150,6 +150,7 @@ SC_COOLDOWN_R 74
SC_COOLDOWN_AR 75
SC_COOLDOWN_ENCH 76
SC_COOLDOWN_KOY 77
+SC_COOLDOWN_UPMARMU 78
// Emotions
EMOTE_DISGUST 1
diff --git a/world/map/db/item_db.conf b/world/map/db/item_db.conf
index e3ecdd4f..45eb5110 100644
--- a/world/map/db/item_db.conf
+++ b/world/map/db/item_db.conf
@@ -719,7 +719,7 @@ item_db: (
Buy: 8000
Sell: 4000
Weight: 100
- Atk: 120
+ Atk: 125
Range: 1
Slots: 0
Loc: "EQP_HAND_R"
@@ -1038,7 +1038,7 @@ item_db: (
bonus2 bHPDrainRate, 100, -2;
bonus bAspdRate, 20;
bonus bMaxHP, -150;
- bonus bSpeedAddRate, 20;
+ bonus bSpeedAddRate, 10;
bonus bDefRate, -40;
bonus bDef2Rate, -35;
bonus bMatkRate, -9; // @EVOL2
diff --git a/world/map/db/item_db_weapon.txt b/world/map/db/item_db_weapon.txt
index 0689a2a7..14e847a8 100644
--- a/world/map/db/item_db_weapon.txt
+++ b/world/map/db/item_db_weapon.txt
@@ -28,7 +28,7 @@
581, CrescentRod, 4, 8000, 4000, 1500, 100, 0, 1, 0, 0, 2, 2, 0, 1, 1, 0, {}, {callfunc "UnreleasedItem";}
582, StaffOfFire, 4, 8000, 4000, 1500, 100, 0, 1, 0, 0, 2, 2, 0, 1, 1, 0, {}, {callfunc "UnreleasedItem";}
583, StaffOfIce, 4, 8000, 4000, 1500, 100, 0, 1, 0, 0, 2, 2, 0, 1, 1, 0, {}, {callfunc "UnreleasedItem";}
-584, Jackal, 4, 8000, 4000, 100, 120, 0, 1, 0, 0, 2, 2, 0, 1, 10, 0, {}, {bonus bMaxHP, 50; bonus2 bHPDrainRate, 100, 5; bonus bCriticalDef, 2; bonus bStr, 1; bonus bAspdRate, 1; bonus bHit, 5;}
+584, Jackal, 4, 8000, 4000, 100, 125, 0, 1, 0, 0, 2, 2, 0, 1, 10, 0, {}, {bonus bMaxHP, 50; bonus2 bHPDrainRate, 100, 5; bonus bCriticalDef, 2; bonus bStr, 1; bonus bAspdRate, 1; bonus bHit, 5;}
587, Sword, 4, 1000, 500, 200, 15, 0, 1, 0, 0, 2, 2, 0, 1, 1, 0, {}, {callfunc "UnreleasedItem";}
588, BastardSword, 4, 1000, 500, 200, 15, 0, 1, 0, 0, 2, 2, 0, 1, 1, 0, {}, {callfunc "UnreleasedItem";}
590, DragonSword, 4, 8000, 4000, 100, 141, -2, 1, 0, 0, 2, 2, 0, 1, 3, 0, {}, {bonus bMaxHP, -100; bonus2 bHPDrainRate, 100, -1; bonus bCriticalDef, -2; bonus bStr, 5; bonus bAspdRate, 2; bonus bHit, 5;}
@@ -40,7 +40,7 @@
758, WoodenStaff, 4, 4000, 2000, 1000, 50, 0, 1, 10, 0, 2, 34, 0, 1, 10, 0, {}, {set @bStat, Int; set @minbStatVal, 60; callfunc "RequireStat";}
762, TerraniteArrow, 10, 80, 20, 1, 50, 0, 0, 0, 0, 2, 32768, 0, 0, 0, 0, {}, {bonus bCritical, 20; set @AmmoType, AMMO_BOW; callfunc "CheckAmmo";}
867, IceGladius, 4, 2000, 1000, 1000, 110, 0, 1, 0, 0, 2, 2, 0, 1, 1, 0, {}, {bonus bLuk, 1;}
-878, BansheeBow, 4, 101000, 40000, 900, 140, 0, 6, -9, 0, 2, 34, 0, 90, 11, 0, {}, {set @bStat, Dex; set @minbStatVal, 80; callfunc "RequireStat"; bonus2 bHPDrainRate, 100, -2; bonus bAspdRate, 20; bonus bMaxHP, -150; bonus bSpeedAddRate, 20; bonus bDefRate, -40; bonus bDef2Rate, -35; set @LauncherType, AMMO_BOW; callfunc "CheckLauncher";}
+878, BansheeBow, 4, 101000, 40000, 900, 140, 0, 6, -9, 0, 2, 34, 0, 90, 11, 0, {}, {set @bStat, Dex; set @minbStatVal, 80; callfunc "RequireStat"; bonus2 bHPDrainRate, 100, -2; bonus bAspdRate, 20; bonus bMaxHP, -150; bonus bSpeedAddRate, 10; bonus bDefRate, -40; bonus bDef2Rate, -35; set @LauncherType, AMMO_BOW; callfunc "CheckLauncher";}
903, SlingShot, 4, 500, 50, 10, 5, 0, 4, 0, 0, 2, 34, 0, 1, 11, 0, {}, {set @LauncherType, AMMO_SLING; callfunc "CheckLauncher";}
904, SlingBullet, 10, 1, 0, 1, 3, 0, 0, 0, 0, 2, 32768, 0, 0, 0, 0, {}, {set @AmmoType, AMMO_SLING; callfunc "CheckAmmo";}
//ID, Name, Type, Price, Sell, Weight, ATK, DEF, Range, Mbonus, Slot, Gender, Loc, wLV, eLV, View, Mode, {UseScript}, {EquipScript}
diff --git a/world/map/npc/099-7/boss.txt b/world/map/npc/099-7/boss.txt
index 3980b2bb..7d68bca8 100644
--- a/world/map/npc/099-7/boss.txt
+++ b/world/map/npc/099-7/boss.txt
@@ -657,7 +657,7 @@ OnTimer150000:
// Who wants a rare drop?
099-7,38,126,0|script|Chest#keshlam|111
{
- if (FLAGS & FLAG_KESHLAM_RAREDROP) goto L_Finished;
+ if (KESHLAM_STATE & FLAG_KESHLAM_RAREDROP) goto L_Finished;
mes "[Chest]";
mes "Would you try to open it?";
mes "##1Cost: 1000 Treasure Keys";
@@ -676,13 +676,13 @@ L_Yes:
&& countitem("TreasureKey") > 1000)
goto L_TooMany;
delitem "TreasureKey", 1000;
- if (FLAGS & FLAG_KESHLAM_FLAWEDLENS) goto L_Rare;
+ if (KESHLAM_STATE & FLAG_KESHLAM_FLAWEDLENS) goto L_Rare;
goto L_FlawedLens;
L_FlawedLens:
getitem "FlawedLens", 1;
getexp 30000000, 0;
- set FLAGS, FLAGS | FLAG_KESHLAM_FLAWEDLENS;
+ set KESHLAM_STATE, KESHLAM_STATE | FLAG_KESHLAM_FLAWEDLENS;
mes "[Chest]";
mes "You opened it and found...! Some flawed lens?! Meh.";
next;
@@ -693,7 +693,7 @@ L_FlawedLens:
L_Rare:
getexp 15000000, 0;
- set FLAGS, FLAGS | FLAG_KESHLAM_RAREDROP;
+ set KESHLAM_STATE, KESHLAM_STATE | FLAG_KESHLAM_RAREDROP;
if (rand(4) == 1) goto L_Amulet; // 25% chance
goto L_Ring; // 75% chance
diff --git a/world/map/npc/099-7/chronos.txt b/world/map/npc/099-7/chronos.txt
index ec3eef49..c0e0c9e8 100644
--- a/world/map/npc/099-7/chronos.txt
+++ b/world/map/npc/099-7/chronos.txt
@@ -1,4 +1,4 @@
-// Cronos, the lord of time and apparently a shopkeeper
+// Chronos, the lord of time and apparently a shopkeeper
// There's also Father Time in the GM stuff
099-7,95,27,0|script|Chronos|313
@@ -6,6 +6,7 @@
cleararray @items$, "", getarraysize(@items$); // must be cleared here if someone used the close button last time then items would remain in list
cleararray @item_names$, "", getarraysize(@item_names$);
cleararray @shopopt$, "", getarraysize(@shopopt$);
+
mes "[Chronos]";
mes "\"I'm Chronos, lord of time, the immortal, the head editor of the Almanach, the... Alright, let's forget that.\"";
if (BOSS_POINTS < .price) goto L_Close;
@@ -16,30 +17,69 @@
if ($CHRONOS_STOCK < 1) goto L_Maxed;
set @cur_date, 0;
next;
+
// Boss Points validation
set @cur, BOSS_POINTS / .price;
- set @dif, @cur - #BOSS_MEDALS;
+ set @BOSS_MEDALS, (KESHLAM_STATE & BYTE_0_MASK);
+ set @BOSS_MEDALS_AVAILABLE, (KESHLAM_STATE & BYTE_1_MASK) >> BYTE_1_SHIFT;
+ if ( @BOSS_MEDALS >= CHRONOS_BOSS_MEDALS_MAX) goto L_CantGiveMedals;
+
+ set @dif, @cur - @BOSS_MEDALS;
if (@dif >= 1) goto L_GiveMedals;
mes "[Chronos]";
mes "\"You haven't made any progress, so I can't give you any Boss Medals at this time.\"";
mes "";
+ goto L_CheckAvailableMedals;
+
+L_CantGiveMedals:
+ mes "[Chronos]";
+ mes "\"You reached the maximum possible Boss Medals I can keep track for you already so I will not look if you deserve more sorry.\"";
+ mes "";
+ goto L_CheckAvailableMedals;
- if (#BOSS_MEDALS_AVAILABLE >= 1) goto L_Qestion;
+L_CheckAvailableMedals:
+ if (@BOSS_MEDALS_AVAILABLE >= 1) goto L_Question;
mes "[Chronos]";
mes "\"Sadly there are no Boss Medals for you to do shopping left.\"";
goto L_Close;
L_GiveMedals:
- set #BOSS_MEDALS, #BOSS_MEDALS + @dif;
- set #BOSS_MEDALS_AVAILABLE, #BOSS_MEDALS_AVAILABLE + @dif;
+ set @BOSS_MEDALS, @BOSS_MEDALS + @dif;
+ if (@BOSS_MEDALS > CHRONOS_BOSS_MEDALS_MAX) goto L_ExededMaxMedals;
+ set @BOSS_MEDALS_AVAILABLE, @BOSS_MEDALS_AVAILABLE + @dif;
+ set KESHLAM_STATE, (KESHLAM_STATE & ~(BYTE_0_MASK + BYTE_1_MASK)) | @BOSS_MEDALS | @BOSS_MEDALS_AVAILABLE << BYTE_1_SHIFT;
mes "[Chronos]";
mes "\"For your deeds, I shall bestow upon you " + @dif + " Boss Medals. Use them wisely, they are the results of your hard effort.";
- mes "Boss Medals are earned each " + .price + " boss points. They are account-bound and cannot be given to other players, not even other versions of you.";
+ mes "Boss Medals are earned each " + .price + " boss points. They are character-bound and cannot be given to other players, not even other versions of you.";
mes "I will keep them for you until you evolved a bit.\"";
next;
- goto L_Qestion;
+ if (@BOSS_MEDALS == CHRONOS_BOSS_MEDALS_MAX) goto L_MaxedMedals;
+ goto L_Question;
-L_Qestion:
+L_MaxedMedals:
+ wgm "=> Player `"+strcharinfo(0) + "` reached maximum possible Boss Medals (" + CHRONOS_BOSS_MEDALS_MAX + ") from Chronos.";
+ debugmes "=> Player `"+strcharinfo(0) + "` reached maximum possible Boss Medals (" + CHRONOS_BOSS_MEDALS_MAX + ") from Chronos.";
+ mes "[Chronos]";
+ mes "\"Oh you just reached the maximum possible Boss Medals I can keep track for you this means I can't give you more in the future.";
+ mes "I just reached out telepatically to the invisible forces that keep this world into motion and told them what happened to you, so they are aware of your situation.\"";
+ next;
+ goto L_Question;
+
+L_ExededMaxMedals:
+ set @cur, CHRONOS_BOSS_MEDALS_MAX - (@BOSS_MEDALS - @dif);
+ set @BOSS_MEDALS, CHRONOS_BOSS_MEDALS_MAX;
+ set @BOSS_MEDALS_AVAILABLE, @BOSS_MEDALS_AVAILABLE + @cur;
+ set @dif, @dif - @cur;
+ set KESHLAM_STATE, (KESHLAM_STATE & ~(BYTE_0_MASK + BYTE_1_MASK)) | @BOSS_MEDALS | @BOSS_MEDALS_AVAILABLE << BYTE_1_SHIFT;
+ wgm "=> Player `"+strcharinfo(0) + "` exeded maximum possible Boss Medals (" + CHRONOS_BOSS_MEDALS_MAX + ") from Chronos by " + @dif + " .";
+ debugmes "=> Player `"+strcharinfo(0) + "` exeded maximum possible Boss Medals (" + CHRONOS_BOSS_MEDALS_MAX + ") from Chronos by " + @dif + " .";
+ mes "[Chronos]";
+ mes "\"Oh you just exeded the maximum possible Boss Medals I can keep track for you by " + @dif + " so I can only bestow upon you " + @cur + " Boss Medals now and this means I can't give you more in the future.";
+ mes "I just reached out telepatically to the invisible forces that keep this world into motion and told them what happened to you, maybe they can help you.\"";
+ next;
+ goto L_Question;
+
+L_Question:
// Shopkeeping
mes "[Chronos]";
mes "\"All things shall pass, but with the limited time you have, please enjoy shopkeeping.\"";
@@ -62,19 +102,19 @@ L_Shop:
set @shopoptcounter, 0;
setarray @shopopt$, "", "", "", "", "";
- if(#BOSS_MEDALS_AVAILABLE < 1) goto L_Close;
+ if(@BOSS_MEDALS_AVAILABLE < 1) goto L_Close;
set @shopopt$[@shopoptcounter], "1 Boss Medal";
set @shopoptcounter, @shopoptcounter + 1;
- if(#BOSS_MEDALS_AVAILABLE < 2) goto L_ShopMenuCreated;
+ if(@BOSS_MEDALS_AVAILABLE < 2) goto L_ShopMenuCreated;
set @shopopt$[@shopoptcounter], "2 Boss Medals";
set @shopoptcounter, @shopoptcounter + 1;
- if(#BOSS_MEDALS_AVAILABLE < 3) goto L_ShopMenuCreated;
+ if(@BOSS_MEDALS_AVAILABLE < 3) goto L_ShopMenuCreated;
set @shopopt$[@shopoptcounter], "3 Boss Medals";
set @shopoptcounter, @shopoptcounter + 1;
- if(#BOSS_MEDALS_AVAILABLE < 4) goto L_ShopMenuCreated;
+ if(@BOSS_MEDALS_AVAILABLE < 4) goto L_ShopMenuCreated;
set @shopopt$[@shopoptcounter], "4 Boss Medals";
set @shopoptcounter, @shopoptcounter + 1;
goto L_ShopMenuCreated;
@@ -83,7 +123,7 @@ L_ShopMenuCreated:
set @shopopt$[@shopoptcounter], "I must think about this again, good bye.";
mes "";
mes "[Chronos]";
- mes "\"You have " + #BOSS_MEDALS_AVAILABLE + " Boss Medals left.";
+ mes "\"You have " + @BOSS_MEDALS_AVAILABLE + " Boss Medals left.";
mes "For which amount of Boss Medals you want to get a reward?\"";
menu
@shopopt$[0], L_MenuItems,
@@ -173,7 +213,7 @@ L_rewards_choice:
"Yes", L_Yes;
// to prevent fast key pressers and clickers from doing an error put No first as it's the highlighted item then.
// but its not able to handle if someone moves the mouse on the wrong menu item and double clicks.
-
+
L_Yes:
getinventorylist;
if ((checkweight(@item$, 1) == 0) || (@inventorylist_count == 100)) goto L_InvFull;
@@ -184,7 +224,8 @@ L_Yes:
mes "\"Here's your " + @item_names$[@index] + ", good bye.\"";
wgm "=> Player `"+strcharinfo(0) + "` obtained the following item from Chronos: "+ @item_names$[@index];
debugmes "=> Player `"+strcharinfo(0) + "` obtained the following item from Chronos: "+ @item_names$[@index];
- set #BOSS_MEDALS_AVAILABLE, #BOSS_MEDALS_AVAILABLE - @num_medals;
+ set @BOSS_MEDALS_AVAILABLE, @BOSS_MEDALS_AVAILABLE - @num_medals;
+ set KESHLAM_STATE, (KESHLAM_STATE & ~BYTE_1_MASK) | @BOSS_MEDALS_AVAILABLE << BYTE_1_SHIFT;
set $CHRONOS_STOCK, $CHRONOS_STOCK - 1;
set @cur_date, (gettime(7) << 5) | (gettime(6) << 1);
set #CHRONOS, @cur_date;
@@ -206,6 +247,8 @@ L_InvFull:
goto L_Close;
L_Close:
+ set @BOSS_MEDALS, 0;
+ set @BOSS_MEDALS_AVAILABLE, 0;
set @cur, 0;
set @dif, 0;
set @num_medals, 0;
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
index 00173429..23577434 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_Bitmask;
callsub S_BlueSage;
callsub S_Luca;
+ callsub S_Keshlam;
callsub S_Valentine2021;
@@ -80,6 +81,21 @@ S_LucaX:
set FLAGS, FLAGS | FLAG_LUCA_FIX;
return;
+S_Keshlam:
+ if (FLAGS & FLAG_KESHLAM_REPACKED) goto S_Return;
+ set KESHLAM_STATE, #BOSS_MEDALS | (#BOSS_MEDALS_AVAILABLE << BYTE_1_SHIFT);
+ set #BOSS_MEDALS, 0;
+ set #BOSS_MEDALS_AVAILABLE, 0;
+ // old
+ // FLAG_KESHLAM_FLAWEDLENS 16384 shift 14
+ // FLAG_KESHLAM_RAREDROP 32768 shift 15
+ // new
+ // FLAG_KESHLAM_FLAWEDLENS 65536 shift 16
+ // FLAG_KESHLAM_RAREDROP 131072 shift 17
+ set KESHLAM_STATE, KESHLAM_STATE | ((FLAGS & 16384) >> 14) << 16 | ((FLAGS & 32768) >> 15) << 17;
+ set FLAGS, FLAGS | FLAG_KESHLAM_REPACKED ^ 16384 ^ 32768;
+ return;
+
S_Flags:
if (Open_Underground_Palace_Barrier)
set FLAGS, FLAGS | FLAG_OPENED_UNDERGROUND;