Full Version : Question on making dryad attack monsters
xmlspawner >>Scripting Support >>Question on making dryad attack monsters


<< Prev | Next >>

Erica- 01-25-2008
Hi ArteGordon was wondering how i can make this guy here like on osi the dryad he should attack changeling and direwolfs, spite,irk ect ect but hes nothing doing that this guy is like the pixies attack bad monsters what am i missing here for him to do that heres the script.
Thanks.
CODE
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
[CorpseName( "a dryad corpse" )]
public class DryadA : BaseCreature
{
 public override bool InitialInnocent{ get{ return true; } }

 [Constructable]
 public DryadA() : base( AIType.AI_Mage, FightMode.Evil, 10, 1, 0.2, 0.4 )
 {
  Name = "a Dryad";
  Body = 266;
  BaseSoundID = 0x467;

  SetStr( 135, 150 );
  SetDex( 153, 166 );
  SetInt( 253, 281 );

  SetHits( 302, 314 );
  SetStam( 153, 166 );
  SetMana( 253, 281 );

  SetDamage( 11, 20 );

  SetDamageType( ResistanceType.Physical, 100 );

  SetResistance( ResistanceType.Physical, 41, 50 );
  SetResistance( ResistanceType.Fire, 15, 24 );
  SetResistance( ResistanceType.Cold, 40, 45 );
  SetResistance( ResistanceType.Poison, 30, 40 );
  SetResistance( ResistanceType.Energy, 25, 32 );

  SetSkill( SkillName.Wrestling, 71.5, 77.8 );
  SetSkill( SkillName.Tactics, 70.1, 77.3 );
  SetSkill( SkillName.MagicResist, 100.7, 118.8 );  
  SetSkill( SkillName.Magery, 72.1, 77.3 );
  SetSkill( SkillName.EvalInt, 71.0, 79.5 );
  SetSkill( SkillName.Meditation, 80.1, 89.7 );
 }
 
 public override void GenerateLoot()
 {
  AddLoot( LootPack.AosRich, 3 );
 }
 
 public override double WeaponAbilityChance{ get{ return 0.05; } }
 public override int Meat{ get{ return 1; } }
 
 public override WeaponAbility GetWeaponAbility()
 {
   AreaPeace();
 
  return null;
 }
 
 public virtual int PeaceRange{ get{ return 5; } }
 public virtual TimeSpan PeaceDuration{ get{ return TimeSpan.FromMinutes( 1 ); } }
 
 public virtual void AreaPeace()
 {
  IPooledEnumerable eable = Map.GetClientsInRange( Location, PeaceRange );
 
  foreach( Server.Network.NetState state in eable )
  {
   if ( state.Mobile is PlayerMobile && state.Mobile.CanSee( this )  )
   {
    PlayerMobile player = (PlayerMobile) state.Mobile;
   
    if ( player.PeacedUntil < DateTime.Now )
    {
     player.PeacedUntil = DateTime.Now + PeaceDuration;
     player.SendLocalizedMessage( 1072065 ); // You gaze upon the dryad's beauty, and forget to continue battling!
    }
   }
  }
 }
 
 public override int GetDeathSound() { return 0x57A; }
 public override int GetAttackSound() { return 0x57B; }
 public override int GetIdleSound() { return 0x57C; }
 public override int GetAngerSound() { return 0x57D; }
 public override int GetHurtSound() { return 0x57E; }
 
 public DryadA( Serial serial ) : base( serial )
 {
 }

 public override void Serialize( GenericWriter writer )
 {
  base.Serialize( writer );
 
  writer.Write( (int) 0 ); // version
 }

 public override void Deserialize( GenericReader reader )
 {
  base.Deserialize( reader );
 
  int version = reader.ReadInt();
 }
}
}


Erica- 01-25-2008
Found Where to fix this gotta fix OppositionGroup script and edit the Dryad as well plus RunUO has bugs on this as pixies should attack quagmires, whipping vines ,dire wolf and its not in the OppositionGroup .

ArteGordon- 01-25-2008
you can change the opposition group, or you can just override the IsEnemy method and add tests for the various mob types that you want it to fight. I suppose it depends on whether you want the other mobs to attack the Dryads too.

Like

CODE

public override bool IsEnemy( Mobile m )
{
 if(m is DireWolf || m is Sprite || m is Changeling)
    return true;

 return base.IsEnemy(m);
}


You will also want to change the fightmode from Evil to Closest.

Erica- 01-25-2008
i think I'll have to make new opposition group since RunUO is missing stuff.