RedBeard

Member
This method doesn't seem to work any ideas?
I want it to work like a regular mass curse spell & check mobiles in a larger range
then spell would normally

public void MassCurse()

{

Map map = this.Map;

if (map == null)

return;

ArrayList targets = new ArrayList();

foreach (Mobile m in this.GetMobilesInRange(15))

{

if (m == this || !this.CanBeHarmful(m))

continue;

if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))

targets.Add(m);

else if (m.Player)

targets.Add(m);

}



for (int i = 0; i < targets.Count; ++i)

{

Mobile m = (Mobile)targets;

this.DoHarmful(m);

//Spells.SpellHelper

SpellHelper.AddStatCurse(m, this, StatType.Str);

SpellHelper.DisableSkillCheck = true;

SpellHelper.AddStatCurse(m, this, StatType.Dex);

SpellHelper.AddStatCurse(m, this, StatType.Int);

SpellHelper.DisableSkillCheck = false;

m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);

m.PlaySound(0x1FB);

m.SendMessage("I'm mass cursing you biotches!");



}

}

 
Last edited:
I figured it out, here is working version if anyone interested. I also added buff icon info.
Set to 10% chance OnGaveMelee from mobile it triggers quite often

Don't forget to add references:
using Server.Spells;
using Server.Targeting;


Code:
#region Mass Curse

public void MassCurse()

{

Map map = this.Map;

if (map == null)

return;

ArrayList targets = new ArrayList();

foreach (Mobile m in this.GetMobilesInRange(15))

{

if (m == this || !this.CanBeHarmful(m))

continue;

if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))

targets.Add(m);

else if (m.Player)

targets.Add(m);

}

for (int i = 0; i < targets.Count; ++i)

{

Mobile m = (Mobile)targets[i];

this.DoHarmful(m);

//Spells.SpellHelper

SpellHelper.AddStatCurse(this, m, StatType.Str);

SpellHelper.DisableSkillCheck = true;

SpellHelper.AddStatCurse(this, m, StatType.Dex);

SpellHelper.AddStatCurse(this, m, StatType.Int);

SpellHelper.DisableSkillCheck = false;

m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);

m.PlaySound(0x1FB);

int percentage = (int)(SpellHelper.GetOffsetScalar(this, m, true) * 100);

TimeSpan length = SpellHelper.GetDuration(this, m);

string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", percentage, percentage, percentage, 10, 10, 10, 10);

BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Curse, 1075835, 1075836, length, m, args.ToString()));

m.SendMessage("You have been cursed!");

}

}

#endregion
 

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back