|
@@ -37,6 +37,8 @@
|
|
|
#include "../../lib/spells/CSpellHandler.h"
|
|
|
#include "../../lib/CTownHandler.h"
|
|
|
#include "../../lib/GameConstants.h"
|
|
|
+#include "../../lib/StartInfo.h"
|
|
|
+#include "../../lib/mapping/CCampaignHandler.h"
|
|
|
#include "../../lib/mapObjects/CGHeroInstance.h"
|
|
|
#include "../../lib/mapObjects/CGTownInstance.h"
|
|
|
|
|
@@ -874,7 +876,16 @@ void CCastleBuildings::enterMagesGuild()
|
|
|
|
|
|
if(hero && !hero->hasSpellbook()) //hero doesn't have spellbok
|
|
|
{
|
|
|
- if(LOCPLINT->cb->getResourceAmount(Res::GOLD) < 500) //not enough gold to buy spellbook
|
|
|
+ const StartInfo *si = LOCPLINT->cb->getStartInfo();
|
|
|
+ // it would be nice to find a way to move this hack to config/mapOverrides.json
|
|
|
+ if(si && si->campState && si->campState->camp && // We're in campaign,
|
|
|
+ (si->campState->camp->header.filename == "DATA/YOG.H3C") && // which is "Birth of a Barbarian",
|
|
|
+ (hero->subID == 45)) // and the hero is Yog (based on Solmyr)
|
|
|
+ {
|
|
|
+ // "Yog has given up magic in all its forms..."
|
|
|
+ LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[736]);
|
|
|
+ }
|
|
|
+ else if(LOCPLINT->cb->getResourceAmount(Res::GOLD) < 500) //not enough gold to buy spellbook
|
|
|
{
|
|
|
openMagesGuild();
|
|
|
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[213]);
|