From c53c2268207a3a049bb607364cd62b91b7dc40af Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Wed, 6 Jul 2011 14:25:12 +0000 Subject: [PATCH] Support for Titan's Thunder (creating Spellbook) & Titan's Lightning Bolt. --- client/CBattleInterface.cpp | 4 +++- config/spell_info.txt | 2 +- lib/CArtHandler.cpp | 2 ++ lib/CGameInterface.cpp | 4 ++-- server/CGameHandler.cpp | 1 + 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/client/CBattleInterface.cpp b/client/CBattleInterface.cpp index a5e99a3a4..4dd66b67a 100644 --- a/client/CBattleInterface.cpp +++ b/client/CBattleInterface.cpp @@ -3015,6 +3015,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc ) break; //for 15 and 16 cases } case 17: //lightning bolt + case 57: //Titan's Thunder case 77: //thunderbolt displayEffect(1, sc->tile); displayEffect(spell.mainEffectAnim, sc->tile); @@ -3050,6 +3051,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc ) if(sc->castedByHero) { boost::algorithm::replace_first(text, "%s", curInt->cb->battleGetFightingHero(sc->side)->name); + boost::algorithm::replace_first(text, "%s", CGI->spellh->spells[sc->id]->name); //spell name boost::algorithm::replace_first(text, "%s", curInt->cb->battleGetStackByID(*sc->affectedCres.begin(), false)->getCreature()->namePl ); //target } else @@ -3143,7 +3145,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc ) } } } - if (!customSpell) + if (!customSpell) //TODO: should not get here for direct damage spells boost::algorithm::replace_first(text, "%s", CGI->spellh->spells[sc->id]->name); //simple spell name if (text.size()) console->addText(text); diff --git a/config/spell_info.txt b/config/spell_info.txt index a3f7f5ba6..6963d5d8d 100644 --- a/config/spell_info.txt +++ b/config/spell_info.txt @@ -57,7 +57,7 @@ 54 -1 19 0 0 0 X 55 1 28 0 0 0 0 56 1 17 0 0 0 0 -57 -1 -1 0 0 0 0 +57 -1 38 0 0 0 0 58 1 7 0 0 0 X 59 -1 35 0 0 0-1 0-2 60 -1 21 0 0 0 0 diff --git a/lib/CArtHandler.cpp b/lib/CArtHandler.cpp index 75a90dade..a6e1d4b2e 100644 --- a/lib/CArtHandler.cpp +++ b/lib/CArtHandler.cpp @@ -1010,6 +1010,8 @@ void CArtifactInstance::move(ArtifactLocation &src, ArtifactLocation &dst) { removeFrom(src.hero, src.slot); putAt(dst.hero, dst.slot); + if (artType->id == 135 && dst.slot == Arts::RIGHT_HAND && !dst.hero->hasSpellbook()) //Titan's Thunder creates new spellbook on equip + dst.hero->giveArtifact(0); } CArtifactInstance * CArtifactInstance::createNewArtifactInstance(CArtifact *Art) diff --git a/lib/CGameInterface.cpp b/lib/CGameInterface.cpp index c925fef8a..058a6f096 100644 --- a/lib/CGameInterface.cpp +++ b/lib/CGameInterface.cpp @@ -57,8 +57,8 @@ rett * createAny(std::string dllname, std::string methodName) return ret; } - -//Currently AI libraries use "lib" prefix only on non-win systems. + +//Currently AI libraries use "lib" prefix only on non-win systems. //May be applied to Win systems as well to remove this ifdef #ifdef _WIN32 std::string getAIFileName(std::string input) diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 0956ed146..6723304a2 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -3450,6 +3450,7 @@ void CGameHandler::handleSpellCasting( int spellID, int spellLvl, THex destinati case 24: //death ripple case 25: //destroy undead case 26: //armageddon + case 57: //Titan's Lightning bolt case 77: //Thunderbolt (thunderbirds) { StacksInjured si;