Dex to zero?
Hey, I'm trying to make a spell that sets a target's dex to 0 temporarily. First off, is this possible or would it just set dex to 1 as default? If that's what it does, is there a way to set stamina regen to 0? Because it's easy to set the current stamina to zero. I couldn't find where stam regen was defined..didn't see it in playermobiles. Here's my code if you need to see it:
[code:1]// created on 10/12/2003 at 3:21 PM
using System;
using Server.Targeting;
using Server.Network;
using Server.Mobiles;
namespace Server.Spells.Third
{
public class StopSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Stop", "Yun Junx",
SpellCircle.Third,
203,
9041,
Reagent.SpidersSilk
);
public StopSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 );
}
else if ( CheckHSequence( m ) )
{
Mobile source = Caster;
SpellHelper.Turn( source, m );
SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );
if ( m is BaseCreature )
{
BaseCreature b = m as BaseCreature;
b.CurrentSpeed = 60.0;
}
else if ( m is PlayerMobile )
{
SpellHelper.AddStatCurse( Caster, m, StatType.Dex ); //here, need to set regen to zero
}
if ( CheckResisted( m ) )
{
m.SendLocalizedMessage( 501783 );
}
TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[CastSkill].Value * 1.5 );
new InternalTimer( m, duration ).Start();
source.MovingParticles( m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
source.PlaySound( Core.AOS ? 0x15E : 0x44B );
}
FinishSequence();
}
private class InternalTimer : Timer
{
private Mobile m_Mobile;
public InternalTimer( Mobile m, TimeSpan duration ) : base( duration )
{
m_Mobile = m;
}
protected override void OnTick()
{
if ( m_Mobile is BaseCreature )
{
BaseCreature b = m_Mobile as BaseCreature;
b.CurrentSpeed = b.ActiveSpeed;
}
if ( m_Mobile is PlayerMobile )
{
//restore regen
}
}
}
private class InternalTarget : Target
{
private StopSpell m_Owner;
public InternalTarget( StopSpell owner ) : base( 12, false, TargetFlags.Harmful )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is Mobile )
m_Owner.Target( (Mobile)o );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}
[/code:1]
Also, does anybody know the email of the admins or anything? I left runuo for a few months with my old account 'wstsdwgr', but when I came back now it won't let me log into it even though I'm using the right password (that's why i made this new account). I'm guessing it's a bug or something? It'd be nice to get back to my old account, Thanks .
Hey, I'm trying to make a spell that sets a target's dex to 0 temporarily. First off, is this possible or would it just set dex to 1 as default? If that's what it does, is there a way to set stamina regen to 0? Because it's easy to set the current stamina to zero. I couldn't find where stam regen was defined..didn't see it in playermobiles. Here's my code if you need to see it:
[code:1]// created on 10/12/2003 at 3:21 PM
using System;
using Server.Targeting;
using Server.Network;
using Server.Mobiles;
namespace Server.Spells.Third
{
public class StopSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Stop", "Yun Junx",
SpellCircle.Third,
203,
9041,
Reagent.SpidersSilk
);
public StopSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 );
}
else if ( CheckHSequence( m ) )
{
Mobile source = Caster;
SpellHelper.Turn( source, m );
SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );
if ( m is BaseCreature )
{
BaseCreature b = m as BaseCreature;
b.CurrentSpeed = 60.0;
}
else if ( m is PlayerMobile )
{
SpellHelper.AddStatCurse( Caster, m, StatType.Dex ); //here, need to set regen to zero
}
if ( CheckResisted( m ) )
{
m.SendLocalizedMessage( 501783 );
}
TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[CastSkill].Value * 1.5 );
new InternalTimer( m, duration ).Start();
source.MovingParticles( m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
source.PlaySound( Core.AOS ? 0x15E : 0x44B );
}
FinishSequence();
}
private class InternalTimer : Timer
{
private Mobile m_Mobile;
public InternalTimer( Mobile m, TimeSpan duration ) : base( duration )
{
m_Mobile = m;
}
protected override void OnTick()
{
if ( m_Mobile is BaseCreature )
{
BaseCreature b = m_Mobile as BaseCreature;
b.CurrentSpeed = b.ActiveSpeed;
}
if ( m_Mobile is PlayerMobile )
{
//restore regen
}
}
}
private class InternalTarget : Target
{
private StopSpell m_Owner;
public InternalTarget( StopSpell owner ) : base( 12, false, TargetFlags.Harmful )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is Mobile )
m_Owner.Target( (Mobile)o );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}
[/code:1]
Also, does anybody know the email of the admins or anything? I left runuo for a few months with my old account 'wstsdwgr', but when I came back now it won't let me log into it even though I'm using the right password (that's why i made this new account). I'm guessing it's a bug or something? It'd be nice to get back to my old account, Thanks .