Shion
Initiate
Hi.
I need some help with this script. I don´t know why it´s not working.
The objective for this script it´s to prevent characters to recover stamina when running or if they are in warmode and focus is < 20).
So i used an override to the CanRegenStam method:
This script works fine when i use a Owner account ( that´s because owners don´t have Stam Loss when moving )
I put the "emote" sentences to debug in game.
But when i use a normal account and for example, start running this happens :
* The script works fine and prevent stam regen ( because CanRegenStam goes false)
* But if the character loses a point of stamina and continues running, ( CanRegenStam goes false only one more time and then the core does not ask again for CanRegenStam method.
So that´s my bug, i don´t know why this is happening.
I checked in the core but found nothing.
Here is the CheckStatTimers method using canRegenStam in the core:
Any ideas?
I need some help with this script. I don´t know why it´s not working.
The objective for this script it´s to prevent characters to recover stamina when running or if they are in warmode and focus is < 20).
So i used an override to the CanRegenStam method:
Code:
public override bool CanRegenStam
{
get
{
if ( ( (Skills[SkillName.Focus].Value < 20) && (Warmode == true) ) || ( ((Direction & Direction.Running) != 0) && ( Core.TickCount - LastMoveTime < 400 ) ) )
{
Emote("Stop");
return false;
}
else
{
Emote("Recovering");
return base.CanRegenStam;
}
}
}
This script works fine when i use a Owner account ( that´s because owners don´t have Stam Loss when moving )
I put the "emote" sentences to debug in game.
But when i use a normal account and for example, start running this happens :
* The script works fine and prevent stam regen ( because CanRegenStam goes false)
* But if the character loses a point of stamina and continues running, ( CanRegenStam goes false only one more time and then the core does not ask again for CanRegenStam method.
So that´s my bug, i don´t know why this is happening.
I checked in the core but found nothing.
Here is the CheckStatTimers method using canRegenStam in the core:
Code:
if (Stam < StamMax)
{
if (CanRegenStam)
{
if (m_StamTimer == null)
{
m_StamTimer = new StamTimer(this);
}
m_StamTimer.Start();
}
else if (m_StamTimer != null)
{
m_StamTimer.Stop();
}
}
Any ideas?