Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: Deleting already learned skills from a hero? (started by phoenix4ever in September 2026)
Deleting already learned skills from a hero?
phoenix4ever
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?

 View Profile
AlexSpl
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

 View Profile
purerogue3
purerogue3


Famous Hero
posted September 24, 2026 10:34 PM

alex already has the cut and paste response ready

 View Profile
Phoenix4ever
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.

 View Profile
Jump To: « Prev Thread . . . Next Thread »
Post New Poll   Post New Topic   Post New Reply

Page compiled in 0.0411 seconds