wall spell (local.duration) problem - Satvet - 04-17-2017 10:02 AM
I want the wall to get up one by one. Is there something that can not be done?
- Can I be wrong?
Quote:![[Image: 8MWjla.png]](http://i.hizliresim.com/8MWjla.png)
Quote:// MAGICF_OSIFORMULAS 00200 // Calculate spell damage and duration based on OSI formulas
MagicFlags=0200
Quote:[Spell 24]
DEFNAME=s_wall_of_stone
NAME=Wall of Stone
SOUND=snd_SPELL_WALL_OF_STONE
RUNES=ISY
CAST_TIME=1.5
RESOURCES=i_reag_blood_moss,i_reag_garlic
RUNE_ITEM=i_rune_WALL_OF_STONE
SCROLL_ITEM=i_scroll_WALL_OF_STONE
FLAGS=SPELLFLAG_TARG_XYZ|SPELLFLAG_HARM|SPELLFLAG_FX_TARG|SPELLFLAG_FIELD|SPELLFLAG_NOUNPARALYZE
EFFECT_ID=0
EFFECT=0
DURATION=30.0,35.0 //<--Previous Ssystem
MANAUSE=9
SKILLREQ=MAGERY 30.0
INTERRUPT=100.0,100.0
ON=@SUCCESS
LOCAL.DURATION={300 350} //<--Not works.
LOCAL.FieldWidth=7 //<-- It works.
//LOCAL.EFFECTCOLOR=07a1 //<-- It works.
Also
Quote:[Spell 17]
DEFNAME=s_bless
NAME=Bless
SOUND=snd_SPELL_BLESS
RUNES=RS
CAST_TIME=1.5
RESOURCES=i_reag_garlic,i_reag_mandrake_root
RUNE_ITEM=i_rune_BLESS
SCROLL_ITEM=i_scroll_BLESS
FLAGS=SPELLFLAG_TARG_CHAR|SPELLFLAG_FX_TARG|SPELLFLAG_GOOD|spellflag_playeronly|spellflag_bless
EFFECT_ID=i_fx_BLESS_EFFECT
EFFECT=5,20 //<-- does random not give value?
LAYER=layer_spell_stats
DURATION=2*60.0,4*60.0
MANAUSE=9
SKILLREQ=MAGERY 30.0
INTERRUPT=100.0,100.0
Always gives the same value. (11)
![[Image: gqvY12.png]](http://i.hizliresim.com/gqvY12.png)
One more thing.
Has the .shrink function changed?
Shrinked, not in the bag.
RE: wall spell local.duration problem - escribano - 04-18-2017 04:14 AM
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
RE: wall spell local.duration problem - Satvet - 04-18-2017 05:45 AM
Thank you so much for your interest, Escribano.
RE: wall spell local.duration problem - escribano - 04-18-2017 06:07 AM
I'm here to help
|