1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Yog is not able to buy a spellbook in his campaign anymore, as intended (#472)

* Yog is not able to buy a spellbook in his campaign anymore, as intended
This commit is contained in:
yupinov
2018-08-11 17:25:09 +02:00
committed by Alexander Shishkin
parent d1931c91d7
commit b56f862094

View File

@@ -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]);