Abracadabra2.0
Member
I actually have two questions. Both scripts are included for reference.
1. I am trying to create a custom monster that, upon death or nearing death (either is fine) the creature will blow up, using vita nex core effects. I tried to set it to happen if the creature's health was at or below 25, but it did not work. It compiles but does not function. Here is the code in question:
2. Another effect I've created is for the creature to spew oil when struck. This effect works as desired, however the item I'm using isn't quite right. It is basically a blood puddle set to convert to a flame after a few seconds. The problem is if I set the puddle image to Hue=1; I also get a black flame. Is there a way to have the puddle hue black but the flame hue as default?
1. I am trying to create a custom monster that, upon death or nearing death (either is fine) the creature will blow up, using vita nex core effects. I tried to set it to happen if the creature's health was at or below 25, but it did not work. It compiles but does not function. Here is the code in question:
Code:
public void DoSpecialAbilityBlowUp(Mobile target)
{
if (Hits <=25 )
{
this.Say(string.Format("Malfunction...detonation imminent!", target.Name));
//Timer.DelayCall(TimeSpan.FromSeconds(4), new TimerCallback(BlowUpEffect)).Start();
OnCoupDeGras(target);
}
}
public void BlowUpEffect(Mobile target)
{
new FireExplodeEffect(this, this.Map, 5, effectHandler: ExplosionDamage).Send();
}
public void OnCoupDeGras(Mobile from)
{
DoSpecialAbilityBlowUp(from);
}
public virtual void ExplosionDamage(EffectInfo info)
{
ArrayList list = new ArrayList();
Effects.PlaySound(info.Source.Location, info.Map, 0x027);
foreach (Mobile m in
info.Source.Location.GetMobilesInRange(info.Map, 0)
.Where(m => m != null && !m.Deleted && m.CanBeHarmful(m, false, true)))
{
if (m == this || !CanBeHarmful(m))
continue;
if (m.Player)
list.Add(m);
}
foreach (Mobile m in list)
{
DoHarmful(m);
int toExplode = Utility.RandomMinMax(7, 15);
m.Damage(toExplode, this);
}
}
2. Another effect I've created is for the creature to spew oil when struck. This effect works as desired, however the item I'm using isn't quite right. It is basically a blood puddle set to convert to a flame after a few seconds. The problem is if I set the puddle image to Hue=1; I also get a black flame. Is there a way to have the puddle hue black but the flame hue as default?