From db2bde9ae2fdf9e5bf4fb6f6aec35daa80728da7 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Sat, 19 Jun 2010 10:42:30 +0000 Subject: [PATCH] Support for Aurora Borealis --- hch/CSpellHandler.h | 1 + server/CGameHandler.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/hch/CSpellHandler.h b/hch/CSpellHandler.h index f781a9e3a..4d57731dc 100644 --- a/hch/CSpellHandler.h +++ b/hch/CSpellHandler.h @@ -17,6 +17,7 @@ * Full text of license available in license.txt file, in main folder * */ +typedef ui16 spelltype; class DLL_EXPORT CSpell { diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 064a821c6..9f61a9299 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -1579,10 +1579,20 @@ void CGameHandler::giveSpells( const CGTownInstance *t, const CGHeroInstance *h cs.learn = true; for(int i=0; imageGuildLevel(),h->getSecSkillLevel(7)+2);i++) { - for(int j=0; jspellsAtLevel(i+1,true) && jspells[i].size(); j++) + if (t->subID == 8 && vstd::contains(t->builtBuildings, 26)) //Aurora Borealis { - if(!vstd::contains(h->spells,t->spells[i][j])) - cs.spells.insert(t->spells[i][j]); + std::vector spells; + getAllowedSpells(spells, i); + for (int j = 0; j < spells.size(); ++j) + cs.spells.insert(spells[j]); + } + else + { + for(int j=0; jspellsAtLevel(i+1,true) && jspells[i].size(); j++) + { + if(!vstd::contains(h->spells,t->spells[i][j])) + cs.spells.insert(t->spells[i][j]); + } } } if(cs.spells.size())