diff --git a/Source/debug.cpp b/Source/debug.cpp index 0b2fcbe97..930a15a29 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -115,6 +115,38 @@ void __cdecl MaxSpellsCheat() } } +void __fastcall SetSpellLevelCheat(char spl, int spllvl) +{ + *(_QWORD *)plr[myplr]._pMemSpells |= 1i64 << (spl - 1); + plr[myplr]._pSplLvl[spl] = spllvl; +} + +void __cdecl SetAllSpellsCheat() +{ + SetSpellLevelCheat(SPL_FIREBOLT, 8); + SetSpellLevelCheat(SPL_CBOLT, 11); + SetSpellLevelCheat(SPL_HBOLT, 10); + SetSpellLevelCheat(SPL_HEAL, 7); + SetSpellLevelCheat(SPL_HEALOTHER, 5); + SetSpellLevelCheat(SPL_LIGHTNING, 9); + SetSpellLevelCheat(SPL_FIREWALL, 5); + SetSpellLevelCheat(SPL_TELEKINESIS, 3); + SetSpellLevelCheat(SPL_TOWN, 3); + SetSpellLevelCheat(SPL_FLASH, 3); + SetSpellLevelCheat(SPL_RNDTELEPORT, 2); + SetSpellLevelCheat(SPL_MANASHIELD, 2); + SetSpellLevelCheat(SPL_WAVE, 4); + SetSpellLevelCheat(SPL_FIREBALL, 3); + SetSpellLevelCheat(SPL_STONE, 1); + SetSpellLevelCheat(SPL_CHAIN, 1); + SetSpellLevelCheat(SPL_GUARDIAN, 4); + SetSpellLevelCheat(SPL_ELEMENT, 3); + SetSpellLevelCheat(SPL_NOVA, 1); + SetSpellLevelCheat(SPL_GOLEM, 2); + SetSpellLevelCheat(SPL_FLARE, 1); + SetSpellLevelCheat(SPL_BONESPIRIT, 1); +} + void __fastcall PrintDebugPlayer(bool bNextPlayer) { char dstr[128]; // [esp+Ch] [ebp-80h] diff --git a/Source/debug.h b/Source/debug.h index 26b615208..b77dd91ab 100644 --- a/Source/debug.h +++ b/Source/debug.h @@ -14,6 +14,8 @@ void __cdecl GiveGoldCheat(); void __cdecl StoresCheat(); void __cdecl TakeGoldCheat(); void __cdecl MaxSpellsCheat(); +void __fastcall SetSpellLevelCheat(char spl, int spllvl); +void __cdecl SetAllSpellsCheat(); void __fastcall PrintDebugPlayer(bool bNextPlayer); void __cdecl PrintDebugQuest(); void __fastcall PrintDebugMonster(int m); diff --git a/Source/diablo.cpp b/Source/diablo.cpp index f837a03cf..abb859403 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -52,6 +52,7 @@ int debug_mode_key_i; int dbgplr; int dbgqst; int dbgmon; +int arrowdebug; int frameflag; int frameend; int framerate; @@ -1713,6 +1714,28 @@ LABEL_27: zoomflag = zoomflag == 0; return; #ifdef _DEBUG + case ')': + case '0': + if ( debug_mode_key_inverted_v ) + { + if ( arrowdebug > 2 ) + arrowdebug = 0; + if ( !arrowdebug ) + { + plr[myplr]._pIFlags &= ~ISPL_FIRE_ARROWS; + plr[myplr]._pIFlags &= ~ISPL_LIGHT_ARROWS; + } + if ( arrowdebug == 1 ) + plr[myplr]._pIFlags |= ISPL_FIRE_ARROWS; + if ( arrowdebug == 2 ) + plr[myplr]._pIFlags |= ISPL_LIGHT_ARROWS; + arrowdebug++; + } + return; + case ':': + if ( !currlevel && debug_mode_key_w ) + SetAllSpellsCheat(); + return; case '[': if ( !currlevel && debug_mode_key_w ) TakeGoldCheat(); diff --git a/Source/diablo.h b/Source/diablo.h index fe8ba0aff..a1cbcaee5 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -89,6 +89,7 @@ extern int debug_mode_key_i; extern int dbgplr; extern int dbgqst; extern int dbgmon; +extern int arrowdebug; extern int frameflag; extern int frameend; extern int framerate; diff --git a/Support/debug.md b/Support/debug.md index eb11f0f88..971f2c2ee 100644 --- a/Support/debug.md +++ b/Support/debug.md @@ -26,7 +26,7 @@ In-game hotkeys - `F2` -> display dungeon information [NOT YET IMPLEMENTED] - `F3` -> display number of items on the ground/cursor item - `F4` -> display quest status information -- `0`/`)` -> cycle through active item flags [NOT YET IMPLEMENTED] +- `0`/`)` -> cycle between regular/magic arrows - `8`/`*` -> level up character - `~` -> refresh vendor items (Griswold premium and Adria) - `]` -> all spells level 10