sahisahi
Member
For some reason the spell doesnt ''hurt'' the target, i can see the damage number above the target head and the *X is attacking you*
when the target dies its just doesnt register the kill, hopefully someone can take look at it
I had similar issue weeks ago with a different item-spell, the issue was at the next line:
since the item had an Owner i had to add ''this.Owner'' on that line in order to make the item-spell hurt the target
THanks
when the target dies its just doesnt register the kill, hopefully someone can take look at it
I had similar issue weeks ago with a different item-spell, the issue was at the next line:
since the item had an Owner i had to add ''this.Owner'' on that line in order to make the item-spell hurt the target
Code:
Spells.SpellHelper.Damage(TimeSpan.FromSeconds(1.0), mm, this.Owner, Utility.RandomMinMax(MinDamage, MaxDamage), 100, 0, 0, 0, 0);
THanks
Code:
using System;
using Server.Targeting;
using Server.Network;
using Server.Misc;
using Server.Items;
using System.Collections;
using Server.Mobiles;
using Server.Spells;
using Server.ACC.CSS.Systems.Necromancy;
using Server.ACC.CSS.Systems.Chivalry;
using Server.ACC.CSS.Systems.Ancient;
using Server.ACC.CSS.Systems.Ranger;
using Server.ACC.CSS.Systems.Bard;
namespace Server.ACC.CSS.Systems.Cleric
{
public class ClericTrialByFireSpell : ClericSpell
{
private static SpellInfo m_Info = new SpellInfo(
"", "",
//SpellCircle.Third,
212,
9041
);
public override SpellCircle Circle
{
get { return SpellCircle.First; }
}
public override TimeSpan GetCastDelay()
{
return TimeSpan.FromSeconds(0.1);
}
// public override int RequiredTithing{ get{ return 25; } }
public override double RequiredSkill{ get{ return 0.0; } }
public override int RequiredMana{ get{ return 0; } }
public ClericTrialByFireSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public void HarmfulSpell(Mobile m)
{
if (m is PlayerMobile)
{
Caster.DoHarmful(m, true);
((PlayerMobile)m).DoHarmful(Caster);
// ((PlayerMobile)m).DoHarmful(Owner);
}
}
public override void OnCast()
{
if (SphereSpellTarget is Mobile)
Target((Mobile)SphereSpellTarget);
}
public override bool CheckCast( )
{
if (SphereSpellTarget is Item)
{
Caster.SendMessage("You cannot cast that on items.");
return false;
}
return base.CheckCast();
}
/*public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}*/
public void Target( Mobile m)
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
// PlayerMobile mobile = (PlayerMobile)Caster;
Container pack = Caster.Backpack;
m.PlaySound( 0x208 );
m.FixedParticles( 0x3709, 1, 30, 9934, 0, 7, EffectLayer.Waist );
((PlayerMobile)Caster).LastIgnite = DateTime.UtcNow;
//
SpellHelper.Turn( Caster, m );
// this.Caster.DoHarmful(m, true);
// Caster.DoHarmful(m, true);
((PlayerMobile)Caster).DoHarmful(m);
double damage = 2;
if ( Core.AOS )
{
SpellHelper.Damage( TimeSpan.Zero, m, Caster, damage, 0, 1, 0, 0, 0 );
HarmfulSpell(m);
}
else
{
SpellHelper.Damage( TimeSpan.Zero, m, Caster, damage );
HarmfulSpell(m);
}
BeginBurn( m, Caster );
}
FinishSequence();
}
////////////////////////////////////////////////////////
private static Hashtable m_Table = new Hashtable();
public static bool IsBurning( Mobile m )
{
return m_Table.Contains( m );
}
public static void BeginBurn( Mobile m, Mobile from )
{
Timer t = (Timer)m_Table[m];
if ( t != null )
t.Stop();
t = new InternalTimer( from, m );
m_Table[m] = t;
t.Start();
m.YellowHealthbar = true;
}
public static void DoBurn( Mobile m, Mobile from, int level )
{
if ( m.Alive )
{
int damage = Utility.RandomMinMax( level, level * 0 );
//if ( !m.Player )
// damage *= 2;
m.PlaySound( 0x208 );
m.Damage( damage, m );
m.FixedParticles( 0xf53, 0, 33, 1260, EffectLayer.Head, 0x100);
}
else
{
EndBurn( m, false );
}
}
public static void EndBurn( Mobile m, bool message )
{
Timer t = (Timer)m_Table[m];
if ( t == null )
return;
t.Stop();
m_Table.Remove( m );
m.YellowHealthbar = false;
}
private class InternalTimer : Timer
{
private Mobile m_From;
private Mobile m_Mobile;
private int m_Count;
public InternalTimer( Mobile from, Mobile m ) : base( TimeSpan.FromSeconds( 3.0 ), TimeSpan.FromSeconds( 3.0 ) )
{
m_From = from;
m_Mobile = m;
Priority = TimerPriority.TwoFiftyMS;
}
protected override void OnTick()
{
if (m_Mobile == null) return;
DoBurn( m_Mobile, m_From, 10 - m_Count );
if ( ++m_Count == 10 )
EndBurn( m_Mobile, true );
}
}
/////////////////////////////////////////////////////
private class InternalTarget : Target
{
private ClericTrialByFireSpell m_Owner;
public InternalTarget( ClericTrialByFireSpell 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();
}
}
}
}