Page 1 of 1

Monsters don't cast spells until....

Posted: Sun Jun 27, 2010 11:46 am
by GuardianKnight
Noticed while i was re learning how to play yesterday. Wyrms won't cast spells until you hit them or they hit you physically. I literally just have to sit behind a wall and hit 1 button to tame them with no worry of being hit.

Seems to work with the other spawn in the area as well. Nothing will cast on you unless you touch it.

Re: Monsters don't cast spells until....

Posted: Sun Jun 27, 2010 12:03 pm
by Derrick
Yes, that's correct and accurate to OSI. It was applied to pets as well in Patch 131:
Subject: Patch 131 - June 25, 2010: Pets, AI, Housing, Fatigue, Guard
Derrick wrote:
  • Pets will no longer always be able to cast spells, but will instead use the same logic as non-tame creatures for this.

Re: Monsters don't cast spells until....

Posted: Sun Jun 27, 2010 12:32 pm
by GuardianKnight
So that's what that meant. Pets will no longer cast spells until they physically touch their target.

Re: Monsters don't cast spells until....

Posted: Sun Jun 27, 2010 12:42 pm
by Batlin
I believe an exception must be made for dragon types and daemon types (non-summoned ones). The OSI scripts contain explicit attacking code when a player comes within 8 tiles.

For example, for the daemon:

Code: Select all

// UO-C
on enterrange<0x08>(object target)
{
  if(isHuman(target))
  {
    if(!isDead(target))
    {
      attack(this, target);
    }
  }
  return(0x01);
}

Re: Monsters don't cast spells until....

Posted: Sun Jun 27, 2010 1:25 pm
by Derrick
Wow that's a nice find. It's similar to the way increased aggressiveness of those creatures work on UOSA, but not quite the same.
I'm not however convinced this initiated their ability to cast spells though, wouldn't that be in the spell-casting AI?

Re: Monsters don't cast spells until....

Posted: Sun Jun 27, 2010 1:46 pm
by Faust
I'm still wondering if the ability to cast was triggered when a magical creature is with in melee range.

I don't ever recall it happening until the creature was actually hit.

Hopefully the exact way it functions can be extracted from the original code.

Re: Monsters don't cast spells until....

Posted: Sun Jun 27, 2010 7:30 pm
by Pristiq
Yes. I also hope that Batlin can figure this one out. I just want to mention that in this thread in case something happens I can feel like I did something. :D