Skip to content

Commit

Permalink
Fixed: Mass Curse spell not working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
coruja747 committed Dec 21, 2016
1 parent db0328b commit f1b5cff
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 19 deletions.
3 changes: 2 additions & 1 deletion docs/REVISIONS-56-SERIES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,5 @@ Fixed: Stealing skill not working correctly.
Changed: Users doesn't have to write AGREE=1 on sphere.ini to use nightly builds anymore. Sphere 56d nightlies are really stable and bug-free so it's safe to use on live servers.

21-12-2016, Coruja
Changed: Updated functionality of all polymorph-like spells (Polymorph, Horrific Beast, Lich Form, Vampiric Embrace, Wraith Form, Reaper Form, Stone Form)
Changed: Updated functionality of all polymorph-like spells (Polymorph, Horrific Beast, Lich Form, Vampiric Embrace, Wraith Form, Reaper Form, Stone Form)
Fixed: Mass Curse spell not working correctly.
34 changes: 25 additions & 9 deletions src/graysvr/CCharSpell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,9 @@ void CChar::Spell_Effect_Remove(CItem * pSpell)
m_pClient->removeBuff(BI_WEAKEN);
return;
case SPELL_Curse:
case SPELL_Mass_Curse:
{
if ( m_pPlayer )
if ( m_pPlayer && (spell == SPELL_Curse) )
{
SetDefNum("RESFIREMAX", GetDefNum("RESFIREMAX", true) + 10);
SetDefNum("RESCOLDMAX", GetDefNum("RESCOLDMAX", true) + 10);
Expand All @@ -757,7 +758,12 @@ void CChar::Spell_Effect_Remove(CItem * pSpell)
for (int i = STAT_STR; i < STAT_BASE_QTY; i++ )
Stat_AddMod(static_cast<STAT_TYPE>(i), iStatEffect);
if (m_pClient)
m_pClient->removeBuff(BI_CURSE);
{
if (spell == SPELL_Curse)
m_pClient->removeBuff(BI_CURSE);
else
m_pClient->removeBuff(BI_MASSCURSE);
}
return;
}
case SPELL_Agility:
Expand Down Expand Up @@ -922,10 +928,11 @@ void CChar::Spell_Effect_Add( CItem * pSpell )
{
CResourceDef *pCharDefNew = g_Cfg.ResourceGetDef(RESOURCE_ID(RES_CHARDEF, m_atMagery.m_SummonID));
LPCTSTR pszName = pCharDefNew->GetName();
_strlwr(const_cast<TCHAR *>(pszName));
if ( pszName[0] == '#' )
pszName = "creature";
strcpy(NumBuff[0], Str_GetArticleAndSpace(pszName));
strcpy(NumBuff[1], _strlwr(const_cast<TCHAR *>(pszName)));
strcpy(NumBuff[1], pszName);
NumBuff[0][strlen(NumBuff[0]) - 1] = '\0'; // trim whitespace from "a " / "an " strings
m_pClient->removeBuff(BI_POLYMORPH);
m_pClient->addBuff(BI_POLYMORPH, 1075824, 1075823, iTimerEffect, pNumBuff, 2);
Expand Down Expand Up @@ -1459,13 +1466,14 @@ void CChar::Spell_Effect_Add( CItem * pSpell )
}
return;
case SPELL_Curse:
case SPELL_Mass_Curse:
{
if ( pCaster != NULL && IsSetMagicFlags(MAGICF_OSIFORMULAS) )
{
iStatEffect = 8 + (pCaster->Skill_GetBase(SKILL_EVALINT) / 100) - (Skill_GetBase(SKILL_MAGICRESISTANCE) / 100);
pSpell->m_itSpell.m_spelllevel = iStatEffect;
}
if ( IsSetCombatFlags(COMBAT_ELEMENTAL_ENGINE) && m_pPlayer ) // Curse also decrease max resistances on players
if ( (spell == SPELL_Curse) && IsSetCombatFlags(COMBAT_ELEMENTAL_ENGINE) && m_pPlayer ) // Curse also decrease max resistances on players (not applied to Mass Curse)
{
SetDefNum("RESFIREMAX", GetDefNum("RESFIREMAX", true) - 10);
SetDefNum("RESCOLDMAX", GetDefNum("RESCOLDMAX", true) - 10);
Expand All @@ -1475,21 +1483,29 @@ void CChar::Spell_Effect_Add( CItem * pSpell )
for ( int i = STAT_STR; i < STAT_BASE_QTY; i++ )
Stat_AddMod(static_cast<STAT_TYPE>(i), -iStatEffect);

if (m_pClient && IsSetOF(OF_Buffs))
if ( m_pClient && IsSetOF(OF_Buffs) )
{
m_pClient->removeBuff(BI_CURSE);
BUFF_ICONS BuffIcon = BI_CURSE;
DWORD BuffCliloc = 1075835;
if ( spell == SPELL_Mass_Curse )
{
BuffIcon = BI_MASSCURSE;
BuffCliloc = 1075839;
}

m_pClient->removeBuff(BuffIcon);
for ( int idx = STAT_STR; idx < STAT_BASE_QTY; ++idx )
ITOA(iStatEffect, NumBuff[idx], 10);
if ( IsSetCombatFlags(COMBAT_ELEMENTAL_ENGINE) )
if ( (spell == SPELL_Curse) && IsSetCombatFlags(COMBAT_ELEMENTAL_ENGINE) )
{
for ( int idx = 3; idx < 7; ++idx )
ITOA(10, NumBuff[idx], 10);

m_pClient->addBuff(BI_CURSE, 1075835, 1075836, iTimerEffect, pNumBuff, 7);
m_pClient->addBuff(BuffIcon, BuffCliloc, 1075836, iTimerEffect, pNumBuff, 7);
}
else
{
m_pClient->addBuff(BI_CURSE, 1075835, 1075840, iTimerEffect, pNumBuff, 3);
m_pClient->addBuff(BuffIcon, BuffCliloc, 1075840, iTimerEffect, pNumBuff, 3);
}
}
}
Expand Down
64 changes: 55 additions & 9 deletions src/graysvr/graysvr.h
Original file line number Diff line number Diff line change
Expand Up @@ -839,15 +839,13 @@ enum BUFF_ICONS
BI_SPELLPLAGUE,
BI_GARGOYLEBERSERK,
BI_GARGOYLEFLY = 0x41E,
// All icons below were added only on client patch 7.0.29.0
BI_INSPIRE,
BI_INVIGORATE,
BI_RESILIENCE,
BI_PERSEVERANCE,
BI_TRIBULATIONDEBUFF,
BI_DESPAIR,
// BI_ARCANEEMPOWERMENT //already added 1026
BI_FISHBUFF = 1062,
BI_FISHPIE = 0x426,
BI_HITLOWERATTACK,
BI_HITLOWERDEFENSE,
BI_HITDUALWIELD,
Expand All @@ -864,9 +862,9 @@ enum BUFF_ICONS
BI_FORCEARROW,
BI_DISARM,
BI_SURGE,
BI_FEIT,
BI_FEINT,
BI_TALONSTRIKE,
BI_OHYSICATTACK, //STRACTICS SAY PHYCHICATTACK?
BI_PHYSICATTACK,
BI_CONSECRATE,
BI_GRAPESOFWRATH,
BI_ENEMYOFONEDEBUFF,
Expand Down Expand Up @@ -908,11 +906,59 @@ enum BUFF_ICONS
BI_CRIMINALSTATUS,
BI_ARMORPIERCE,
BI_SPLINTERINGEFFECT,
BI_SWINGSPEEDSWING,
BI_SWINGSPEEDDEBUFF,
BI_WRAITHFORM,
//BI_HONORABLEEXECUTION // already added on 1092
BI_CITYTRADEDEAL = 1126,
BI_QTY = 1126
BI_CITYTRADEDEAL = 0x466,
BI_HUMILITYDEBUFF,
BI_SPIRITUALITY,
BI_HUMILITY,
BI_RAMPAGE,
BI_STAGGERDEBUFF,
BI_TOUGHNESS,
BI_THRUST,
BI_PIERCEDEBUFF,
BI_PLAYINGTHEODDS,
BI_FOCUSEDEYE,
BI_ONSLAUGHTDEBUFF,
BI_ELEMENTALFURY,
BI_ELEMENTALFURYDEBUFF,
BI_CALLEDSHOT,
BI_KNOCKOUT,
BI_SAVINGTHROW,
BI_CONDUIT,
BI_ETHEREALBURST,
BI_MYSTICWEAPON,
BI_MANASHIELD,
BI_ANTICIPATEHIT,
BI_WARCRY,
BI_SHADOW,
BI_WHITETIGERFORM,
BI_BODYGUARD,
BI_HEIGHTENEDSENSES,
BI_TOLERANCE,
BI_DEATHRAY,
BI_DEATHRAYDEBUFF,
BI_INTUITION,
BI_ENCHANTEDSUMMONING,
BI_SHIELDBASH,
BI_WHISPERING,
BI_COMBATTRAINING,
BI_INJECTEDSTRIKEDEBUFF,
BI_INJECTEDSTRIKE,
BI_UNKNOWNTOMATO,
BI_PLAYINGTHEODDSDEBUFF,
BI_DRAGONTURTLEDEBUFF,
BI_BOARDING,
BI_POTENCY,
BI_THRUSTDEBUFF,
BI_FISTSOFFURY,
BI_BARRABHEMOLYMPHCONCENTRATE,
BI_JUKARIBURNPOILTICE,
BI_KURAKAMBUSHERSESSENCE,
BI_BARAKODRAFTOFMIGHT,
BI_URALITRANCETONIC,
BI_SAKKHRAPROPHYLAXIS,
BI_QTY = BI_SAKKHRAPROPHYLAXIS
};
// ---------------------------------------------------------------------------------------------

Expand Down

0 comments on commit f1b5cff

Please sign in to comment.