- ServUO Version
- Publish Unknown
- Ultima Expansion
- Mondain's Legacy
On my RunUO v 2.2 shard . . I have been trying to make a special Dragon that is impervious to arrows and bolts. I am probably way off, but the best my brain can think of for this is to use the 'OnDamage' section in the Dragon's script.
My problem is . . my efforts are not working and players using bows still slay the dragon from a distance with their Ranged weapons.
Here is my most recent try:
I know this 'OnDamage' section is being tested because the players are getting the message that arrows and bolts are deflected. However . . the ranged weapons are still killing the Dragon.
Can anyone (please) tell me how I could prevent ranged weapons from damaging this Dragon?
Your time and thoughts are appreciated.
My problem is . . my efforts are not working and players using bows still slay the dragon from a distance with their Ranged weapons.
Here is my most recent try:
Code:
public override void OnDamage( int amount, Mobile from, bool willKill )
{
if ( (from == null) || (from.Deleted) || !(from.Alive) || !(from.Map == this.Map) )
{
return;
}
if (!Summoned && from != null)
{
var ranged = from.FindItemOnLayer(Layer.TwoHanded);
if (ranged != null && ranged is BaseRanged)
{
double reflectmsg = Utility.RandomDouble();
if (reflectmsg < 0.25)
{
from.SendMessage( "The dragon's scales deflect arrows and bolts." );
}
this.Hits = (this.Hits + amount);
}
}
base.OnDamage( amount, from, willKill );
}
I know this 'OnDamage' section is being tested because the players are getting the message that arrows and bolts are deflected. However . . the ranged weapons are still killing the Dragon.
Can anyone (please) tell me how I could prevent ranged weapons from damaging this Dragon?
Your time and thoughts are appreciated.