| Deleting already learned skills from a hero? | |
|
phoenix4ever

 
     
Legendary Hero
Heroes is love, Heroes is life
|
posted September 24, 2026 09:44 PM |
|
|
Deleting already learned skills from a hero?
I can't remember if I have perhaps asked this before, but is there any way to delete learned skills from a hero?
I would prefer if there was a map object, which let you pay 2000 gold to "unlearn" a skill, similar to learning a skill from a university.
But since that is not case, is there any other way to delete an unwanted skill from a hero?
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted September 24, 2026 09:51 PM |
|
Edited by AlexSpl at 21:56, 24 Sep 2026.
|
ForgetSecSkill
Code:
#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable : 4005)
#pragma warning(disable : 4010)
#include "stdafx.h"
#include "....headersHoMM3API.h"
Patcher* _P;
PatcherInstance* _PI;
void __stdcall forgetSecSkill(HiHook* h, char const* cText, int iMBType, int x, int y,
int iResType1, int iResExtra1, int iResType2, int iResExtra2,
int iSpecial, int iTimeout, int iResType3, int iResExtra3)
{
if (iResExtra1 && iMBType == 1)
iMBType = 2;
CALL_12(void, __fastcall, h->GetDefaultFunc(), cText, iMBType, x, y,
iResType1, iResExtra1, iResType2, iResExtra2, iSpecial, iTimeout, iResType3, iResExtra3);
if (iResExtra1 && pWindowManager->dialogReturn == 0x7806)
{
pWindowManager->dialogReturn = 0;
hero* gpHero = *(hero**)0x698B70;
if (gpHero)
{
int skill = (iResExtra1 - 3) / 3;
TSkillMastery mastery = (TSkillMastery)((iResExtra1 - 3) % 3 + 1);
--gpHero->SSLevel[skill];
if (mastery == eMasteryBasic)
{
--gpHero->numSSs;
for (int i = 0; i < 28; ++i)
if (gpHero->SSOrder > gpHero->SSOrder[skill])
--gpHero->SSOrder;
gpHero->SSOrder[skill] = 0;
}
heroWindow* heroWnd = *(heroWindow**)0x698AC8;
CALL_1(void, __thiscall, 0x4E1CC0, heroWnd);
CALL_4(void, __thiscall, *(int*)(*(int*)heroWnd + 0x14), heroWnd, true, -65535, 65535);
}
}
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
static bool plugin_On = false;
if (DLL_PROCESS_ATTACH == ul_reason_for_call)
{
if (!plugin_On)
{
plugin_On = true;
_P = GetPatcher();
_PI = _P->CreateInstance((char*)"HD.Plugin.H3.ForgetSecSkill");
_PI->WriteHiHook(0x4DE843, CALL_, EXTENDED_, FASTCALL_, forgetSecSkill);
}
}
return TRUE;
}
Or, you just can use /nwcgrail
|
|
purerogue3

 
   
Famous Hero
|
posted September 24, 2026 10:34 PM |
|
|
|
alex already has the cut and paste response ready
|
|
Phoenix4ever

 
     
Legendary Hero
Heroes is love, Heroes is life
|
posted September 24, 2026 11:30 PM |
|
|
nwcgrail what does that do?
Been a very long time since I used cheats in this game.
|
| |
|
|