Satvet, sup?
I've noticed this too, but i've change the core code to act as i wanted...
IN "CCharact.cpp" i've chenged the setPoison to:
Code:
bool CChar::SetPoison( int iSkill, int iTicks, CChar * pCharSrc )
{
ADDTOCALLSTACK("CChar::SetPoison");
const CSpellDef *pSpellDef = g_Cfg.GetSpellDef(SPELL_Poison);
if ( !pSpellDef )
return false;
// Release if paralyzed ?
if ( !pSpellDef->IsSpellType(SPELLFLAG_NOUNPARALYZE) )
{
CItem *pParalyze = LayerFind(LAYER_SPELL_Paralyze);
if ( pParalyze )
pParalyze->Delete();
}
CItem *pPoison = Spell_Effect_Create(SPELL_Poison, LAYER_FLAG_Poison, iSkill, 1 + Calc_GetRandVal(2) * TICK_PER_SEC, pCharSrc, false);
if ( !pPoison )
return false;
LayerAdd(pPoison, LAYER_FLAG_Poison);
pPoison->m_itSpell.m_spellcharges = iTicks; // effect duration
pPoison->SetTimeout(30); // FIX DG
if ( m_pClient && IsSetOF(OF_Buffs) )
{
m_pClient->removeBuff(BI_POISON);
m_pClient->addBuff(BI_POISON, 1017383, 1070722, static_cast<WORD>(pPoison->m_itSpell.m_spellcharges));
}
SysMessageDefault(DEFMSG_JUST_BEEN_POISONED);
StatFlag_Set(STATF_Poisoned);
UpdateStatsFlag();
return true;
}
Take a look at the method definition, at this part "1 + Calc_GetRandVal(2) * TICK_PER_SEC" it's the spell duration!
Sphere always treat the poison duration minimum: 10 segs to maximum: 30 segs", you can change this for any duration you want...
And in "CCharSpell.cpp" to:
Code:
case SPELL_Poison:
{
// Both potions and poison spells use this.
// m_itSpell.m_spelllevel = strength of the poison ! 0-1000
if ( iCharges <= 0 )
return false;
int iDmg = 0;
// The poison in your body is having an effect.
if ( iLevel < 50 )
return false;
if ( iLevel < 200 ) // Lesser
iLevel = 0;
else if ( iLevel < 400 ) // Normal
iLevel = 1;
else if ( iLevel < 800 ) // Greater
iLevel = 2;
else // Deadly.
iLevel = 3;
pItem->m_itSpell.m_spelllevel -= 50; // gets weaker too. Only on old formulas
iDmg = IMULDIV(Stat_GetMax(STAT_STR), iLevel * 2, 100);
pItem->SetTimeout(30); // FIX DG
static LPCTSTR const sm_Poison_Message[] =
{
g_Cfg.GetDefaultMsg(DEFMSG_SPELL_POISON_1),
g_Cfg.GetDefaultMsg(DEFMSG_SPELL_POISON_2),
g_Cfg.GetDefaultMsg(DEFMSG_SPELL_POISON_3),
g_Cfg.GetDefaultMsg(DEFMSG_SPELL_POISON_4)
};
TCHAR *pszMsg = Str_GetTemp();
sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_SPELL_LOOKS), sm_Poison_Message[iLevel]);
Emote(pszMsg, m_pClient);
SysMessagef(g_Cfg.GetDefaultMsg(DEFMSG_SPELL_YOUFEEL), sm_Poison_Message[iLevel]);
static const int sm_iPoisonMax[] = { 2, 4, 6, 8, 10 };
OnTakeDamage(maximum(sm_iPoisonMax[iLevel], iDmg), pItem->m_uidLink.CharFind(), DAMAGE_MAGIC|DAMAGE_POISON|DAMAGE_NODISTURB|DAMAGE_NOREVEAL, 0, 0, 0, 100, 0);
if ( IsSetOF(OF_Buffs) && m_pClient )
{
m_pClient->removeBuff(BI_POISON);
m_pClient->addBuff(BI_POISON, 1017383, 1070722, static_cast<WORD>(pItem->GetTimerAdjusted()));
}
break;
}
Another thing to look at: "SetTimeout(30);" (both files) in my shard, poisin deals damage every 3 seconds, you also can change this to any delay you want...
I basically ignored all script proccess and fixed the spell as i wanted directly in the core...
You can do something like in any spells you want... i also removed the OSI_MAGICFORMULA from the code cuz i don't use it.
Hope it helps again