AdamD
Member
Hi all
Got a strange request/query
I want to modify the playermobile script so that one player in particular, gives off a poisonous cloud around them.
Meaning, when they get within 2 tiles of a vendor or animal, the animal/vendor is then poisoned, lol.
It's mostly for fun, I want to wind up a female friend of mine.
I thought, perhaps the code from the Pyre script could be somehow modified to work for this purpose, but was wanting some advice, as I can't get it to work.
While it compiles ok, nothing seems to happen when she is near anything.
I'm guessing it's not as simple as copying/pasting code from one script to another lol
This is the section I added to the playermobile code:
Got a strange request/query
I want to modify the playermobile script so that one player in particular, gives off a poisonous cloud around them.
Meaning, when they get within 2 tiles of a vendor or animal, the animal/vendor is then poisoned, lol.
It's mostly for fun, I want to wind up a female friend of mine.
I thought, perhaps the code from the Pyre script could be somehow modified to work for this purpose, but was wanting some advice, as I can't get it to work.
While it compiles ok, nothing seems to happen when she is near anything.
I'm guessing it's not as simple as copying/pasting code from one script to another lol
This is the section I added to the playermobile code:
bool tick = false;
public virtual void OnThink()
{
if (this.Account.Username == "FriendsAccount")
{
tick = !tick;
if (tick)
return;
List<Mobile> targets = new List<Mobile>();
if (Map != null)
foreach (Mobile m in GetMobilesInRange(2))
if (this != m && SpellHelper.ValidIndirectTarget(this, m) && CanBeHarmful(m, false) && (!Core.AOS || InLOS(m)))
targets.Add(m);
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = targets;
AOS.Damage(m, this, 5, 0, 100, 0, 0, 0);
m.Poison = Poison.Lethal;
m.Title = "Poisoned!";
}
}
}