Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -1,181 +1,174 @@
|
|||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
using Server.ContextMenus;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public abstract class BaseFamiliar : BaseCreature
|
||||
{
|
||||
public BaseFamiliar()
|
||||
: base( AIType.AI_Melee, FightMode.Closest, 10, 1, .1, .1 )
|
||||
{
|
||||
}
|
||||
public abstract class BaseFamiliar : BaseCreature
|
||||
{
|
||||
private bool m_LastHidden;
|
||||
|
||||
public override bool BardImmune => true;
|
||||
public override Poison PoisonImmune => Poison.Lethal;
|
||||
public override bool Commandable => false;
|
||||
public BaseFamiliar()
|
||||
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, .1, .1)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool PlayerRangeSensitive => false;
|
||||
public BaseFamiliar(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private bool m_LastHidden;
|
||||
public override bool BardImmune => true;
|
||||
public override Poison PoisonImmune => Poison.Lethal;
|
||||
public override bool Commandable => false;
|
||||
|
||||
public virtual void RangeCheck()
|
||||
{
|
||||
if ( !Deleted && ControlMaster != null && !ControlMaster.Deleted )
|
||||
{
|
||||
int range = ( RangeHome - 2 );
|
||||
public override bool PlayerRangeSensitive => false;
|
||||
|
||||
if ( !InRange( ControlMaster.Location, RangeHome ) )
|
||||
{
|
||||
Mobile master = ControlMaster;
|
||||
public virtual void RangeCheck()
|
||||
{
|
||||
if (!Deleted && ControlMaster != null && !ControlMaster.Deleted)
|
||||
{
|
||||
int range = RangeHome - 2;
|
||||
|
||||
Point3D m_Loc = Point3D.Zero;
|
||||
if (!InRange(ControlMaster.Location, RangeHome))
|
||||
{
|
||||
Mobile master = ControlMaster;
|
||||
|
||||
if ( Map == master.Map )
|
||||
{
|
||||
int x = ( X > master.X ) ? ( master.X + range ) : ( master.X - range );
|
||||
int y = ( Y > master.Y ) ? ( master.Y + range ) : ( master.Y - range );
|
||||
Point3D m_Loc = Point3D.Zero;
|
||||
|
||||
for( int i = 0; i < 10; i++ )
|
||||
{
|
||||
m_Loc.X = x + Utility.RandomMinMax( -1, 1 );
|
||||
m_Loc.Y = y + Utility.RandomMinMax( -1, 1 );
|
||||
if (Map == master.Map)
|
||||
{
|
||||
int x = X > master.X ? master.X + range : master.X - range;
|
||||
int y = Y > master.Y ? master.Y + range : master.Y - range;
|
||||
|
||||
m_Loc.Z = Map.GetAverageZ( m_Loc.X, m_Loc.Y );
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
m_Loc.X = x + Utility.RandomMinMax(-1, 1);
|
||||
m_Loc.Y = y + Utility.RandomMinMax(-1, 1);
|
||||
|
||||
if ( Map.CanSpawnMobile( m_Loc ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
m_Loc.Z = Map.GetAverageZ(m_Loc.X, m_Loc.Y);
|
||||
|
||||
m_Loc = master.Location;
|
||||
}
|
||||
if (Map.CanSpawnMobile(m_Loc)) break;
|
||||
|
||||
if ( !Deleted )
|
||||
{
|
||||
SetLocation( m_Loc, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_Loc = master.Location;
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
Mobile master = ControlMaster;
|
||||
if (!Deleted) SetLocation(m_Loc, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( Deleted )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( master == null || master.Deleted )
|
||||
{
|
||||
DropPackContents();
|
||||
EndRelease( null );
|
||||
return;
|
||||
}
|
||||
public override void OnThink()
|
||||
{
|
||||
Mobile master = ControlMaster;
|
||||
|
||||
RangeCheck();
|
||||
if (Deleted) return;
|
||||
if (master == null || master.Deleted)
|
||||
{
|
||||
DropPackContents();
|
||||
EndRelease(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_LastHidden != master.Hidden )
|
||||
Hidden = m_LastHidden = master.Hidden;
|
||||
RangeCheck();
|
||||
|
||||
if ( AIObject != null && AIObject.WalkMobileRange( master, 5, true, 1, 1 ))
|
||||
{
|
||||
Warmode = master.Warmode;
|
||||
Combatant = master.Combatant;
|
||||
if (m_LastHidden != master.Hidden)
|
||||
Hidden = m_LastHidden = master.Hidden;
|
||||
|
||||
CurrentSpeed = 0.10;
|
||||
}
|
||||
else
|
||||
{
|
||||
Warmode = false;
|
||||
FocusMob = Combatant = null;
|
||||
if (AIObject != null && AIObject.WalkMobileRange(master, 5, true, 1, 1))
|
||||
{
|
||||
Warmode = master.Warmode;
|
||||
Combatant = master.Combatant;
|
||||
|
||||
CurrentSpeed = .01;
|
||||
}
|
||||
}
|
||||
CurrentSpeed = 0.10;
|
||||
}
|
||||
else
|
||||
{
|
||||
Warmode = false;
|
||||
FocusMob = Combatant = null;
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
CurrentSpeed = .01;
|
||||
}
|
||||
}
|
||||
|
||||
if ( from.Alive && Controlled && from == ControlMaster && from.InRange( this, 14 ) )
|
||||
list.Add( new ReleaseEntry( from, this ) );
|
||||
}
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
public virtual void BeginRelease( Mobile from )
|
||||
{
|
||||
if ( !Deleted && Controlled && from == ControlMaster && from.CheckAlive() )
|
||||
EndRelease( from );
|
||||
}
|
||||
if (from.Alive && Controlled && from == ControlMaster && from.InRange(this, 14))
|
||||
list.Add(new ReleaseEntry(from, this));
|
||||
}
|
||||
|
||||
public virtual void EndRelease( Mobile from )
|
||||
{
|
||||
if ( from == null || (!Deleted && Controlled && from == ControlMaster && from.CheckAlive()) )
|
||||
{
|
||||
Effects.SendLocationParticles( EffectItem.Create( Location, Map, EffectItem.DefaultDuration ), 0x3728, 1, 13, 2100, 3, 5042, 0 );
|
||||
PlaySound( 0x201 );
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
public virtual void BeginRelease(Mobile from)
|
||||
{
|
||||
if (!Deleted && Controlled && from == ControlMaster && from.CheckAlive())
|
||||
EndRelease(from);
|
||||
}
|
||||
|
||||
public virtual void DropPackContents()
|
||||
{
|
||||
Map map = Map;
|
||||
Container pack = Backpack;
|
||||
public virtual void EndRelease(Mobile from)
|
||||
{
|
||||
if (from == null || !Deleted && Controlled && from == ControlMaster && from.CheckAlive())
|
||||
{
|
||||
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3728, 1, 13,
|
||||
2100, 3, 5042, 0);
|
||||
PlaySound(0x201);
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
if ( map != null && map != Map.Internal && pack != null )
|
||||
{
|
||||
List<Item> list = new List<Item>( pack.Items );
|
||||
public virtual void DropPackContents()
|
||||
{
|
||||
Map map = Map;
|
||||
Container pack = Backpack;
|
||||
|
||||
for ( int i = 0; i < list.Count; ++i )
|
||||
list[i].MoveToWorld( Location, map );
|
||||
}
|
||||
}
|
||||
if (map != null && map != Map.Internal && pack != null)
|
||||
{
|
||||
List<Item> list = new List<Item>(pack.Items);
|
||||
|
||||
public BaseFamiliar( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
list[i].MoveToWorld(Location, map);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
int version = reader.ReadInt();
|
||||
|
||||
ValidationQueue<BaseFamiliar>.Add( this );
|
||||
}
|
||||
ValidationQueue<BaseFamiliar>.Add(this);
|
||||
}
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
DropPackContents();
|
||||
Delete();
|
||||
}
|
||||
public void Validate()
|
||||
{
|
||||
DropPackContents();
|
||||
Delete();
|
||||
}
|
||||
|
||||
private class ReleaseEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private BaseFamiliar m_Familiar;
|
||||
private class ReleaseEntry : ContextMenuEntry
|
||||
{
|
||||
private BaseFamiliar m_Familiar;
|
||||
private Mobile m_From;
|
||||
|
||||
public ReleaseEntry( Mobile from, BaseFamiliar familiar ) : base( 6118, 14 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Familiar = familiar;
|
||||
}
|
||||
public ReleaseEntry(Mobile from, BaseFamiliar familiar) : base(6118, 14)
|
||||
{
|
||||
m_From = from;
|
||||
m_Familiar = familiar;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if ( !m_Familiar.Deleted && m_Familiar.Controlled && m_From == m_Familiar.ControlMaster && m_From.CheckAlive() )
|
||||
m_Familiar.BeginRelease( m_From );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void OnClick()
|
||||
{
|
||||
if (!m_Familiar.Deleted && m_Familiar.Controlled && m_From == m_Familiar.ControlMaster &&
|
||||
m_From.CheckAlive())
|
||||
m_Familiar.BeginRelease(m_From);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,77 +2,77 @@ using System;
|
|||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class DarkWolfFamiliar : BaseFamiliar
|
||||
{
|
||||
public override string CorpseName => "a dark wolf corpse";
|
||||
public override string DefaultName => "a dark wolf";
|
||||
public class DarkWolfFamiliar : BaseFamiliar
|
||||
{
|
||||
private DateTime m_NextRestore;
|
||||
|
||||
public DarkWolfFamiliar()
|
||||
{
|
||||
Body = 99;
|
||||
Hue = 0x901;
|
||||
BaseSoundID = 0xE5;
|
||||
public DarkWolfFamiliar()
|
||||
{
|
||||
Body = 99;
|
||||
Hue = 0x901;
|
||||
BaseSoundID = 0xE5;
|
||||
|
||||
SetStr( 100 );
|
||||
SetDex( 90 );
|
||||
SetInt( 90 );
|
||||
SetStr(100);
|
||||
SetDex(90);
|
||||
SetInt(90);
|
||||
|
||||
SetHits( 60 );
|
||||
SetStam( 90 );
|
||||
SetMana( 0 );
|
||||
SetHits(60);
|
||||
SetStam(90);
|
||||
SetMana(0);
|
||||
|
||||
SetDamage( 5, 10 );
|
||||
SetDamage(5, 10);
|
||||
|
||||
SetDamageType( ResistanceType.Physical, 100 );
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance( ResistanceType.Physical, 40, 50 );
|
||||
SetResistance( ResistanceType.Fire, 25, 40 );
|
||||
SetResistance( ResistanceType.Cold, 25, 40 );
|
||||
SetResistance( ResistanceType.Poison, 25, 40 );
|
||||
SetResistance( ResistanceType.Energy, 25, 40 );
|
||||
SetResistance(ResistanceType.Physical, 40, 50);
|
||||
SetResistance(ResistanceType.Fire, 25, 40);
|
||||
SetResistance(ResistanceType.Cold, 25, 40);
|
||||
SetResistance(ResistanceType.Poison, 25, 40);
|
||||
SetResistance(ResistanceType.Energy, 25, 40);
|
||||
|
||||
SetSkill( SkillName.Wrestling, 85.1, 90.0 );
|
||||
SetSkill( SkillName.Tactics, 50.0 );
|
||||
SetSkill(SkillName.Wrestling, 85.1, 90.0);
|
||||
SetSkill(SkillName.Tactics, 50.0);
|
||||
|
||||
ControlSlots = 1;
|
||||
}
|
||||
ControlSlots = 1;
|
||||
}
|
||||
|
||||
private DateTime m_NextRestore;
|
||||
public DarkWolfFamiliar(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
public override string CorpseName => "a dark wolf corpse";
|
||||
public override string DefaultName => "a dark wolf";
|
||||
|
||||
if ( DateTime.UtcNow < m_NextRestore )
|
||||
return;
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
|
||||
m_NextRestore = DateTime.UtcNow + TimeSpan.FromSeconds( 2.0 );
|
||||
if (DateTime.UtcNow < m_NextRestore)
|
||||
return;
|
||||
|
||||
Mobile caster = ControlMaster;
|
||||
m_NextRestore = DateTime.UtcNow + TimeSpan.FromSeconds(2.0);
|
||||
|
||||
if ( caster == null )
|
||||
caster = SummonMaster;
|
||||
Mobile caster = ControlMaster;
|
||||
|
||||
if ( caster != null )
|
||||
++caster.Stam;
|
||||
}
|
||||
if (caster == null)
|
||||
caster = SummonMaster;
|
||||
|
||||
public DarkWolfFamiliar( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
if (caster != null)
|
||||
++caster.Stam;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,56 +1,56 @@
|
|||
namespace Server.Mobiles
|
||||
{
|
||||
public class DeathAdder : BaseFamiliar
|
||||
{
|
||||
public override string CorpseName => "a death adder corpse";
|
||||
public override string DefaultName => "a death adder";
|
||||
public class DeathAdder : BaseFamiliar
|
||||
{
|
||||
public DeathAdder()
|
||||
{
|
||||
Body = 0x15;
|
||||
Hue = 0x455;
|
||||
BaseSoundID = 219;
|
||||
|
||||
public DeathAdder()
|
||||
{
|
||||
Body = 0x15;
|
||||
Hue = 0x455;
|
||||
BaseSoundID = 219;
|
||||
SetStr(70);
|
||||
SetDex(150);
|
||||
SetInt(100);
|
||||
|
||||
SetStr( 70 );
|
||||
SetDex( 150 );
|
||||
SetInt( 100 );
|
||||
SetHits(50);
|
||||
SetStam(150);
|
||||
SetMana(0);
|
||||
|
||||
SetHits( 50 );
|
||||
SetStam( 150 );
|
||||
SetMana( 0 );
|
||||
SetDamage(1, 4);
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetDamage( 1, 4 );
|
||||
SetDamageType( ResistanceType.Physical, 100 );
|
||||
SetResistance(ResistanceType.Physical, 10);
|
||||
SetResistance(ResistanceType.Poison, 100);
|
||||
|
||||
SetResistance( ResistanceType.Physical, 10 );
|
||||
SetResistance( ResistanceType.Poison, 100 );
|
||||
SetSkill(SkillName.Wrestling, 90.0);
|
||||
SetSkill(SkillName.Tactics, 50.0);
|
||||
SetSkill(SkillName.MagicResist, 100.0);
|
||||
SetSkill(SkillName.Poisoning, 150.0);
|
||||
|
||||
SetSkill( SkillName.Wrestling, 90.0 );
|
||||
SetSkill( SkillName.Tactics, 50.0 );
|
||||
SetSkill( SkillName.MagicResist, 100.0 );
|
||||
SetSkill( SkillName.Poisoning, 150.0 );
|
||||
ControlSlots = 1;
|
||||
}
|
||||
|
||||
ControlSlots = 1;
|
||||
}
|
||||
public DeathAdder(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Poison HitPoison => (0.8 >= Utility.RandomDouble() ? Poison.Greater : Poison.Deadly);
|
||||
public override string CorpseName => "a death adder corpse";
|
||||
public override string DefaultName => "a death adder";
|
||||
|
||||
public DeathAdder( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override Poison HitPoison => 0.8 >= Utility.RandomDouble() ? Poison.Greater : Poison.Deadly;
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,201 +1,201 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class HordeMinionFamiliar : BaseFamiliar
|
||||
{
|
||||
public override string CorpseName => "a horde minion corpse";
|
||||
public override bool DisplayWeight => true;
|
||||
public class HordeMinionFamiliar : BaseFamiliar
|
||||
{
|
||||
private DateTime m_NextPickup;
|
||||
|
||||
public override string DefaultName => "a horde minion";
|
||||
public HordeMinionFamiliar()
|
||||
{
|
||||
Body = 776;
|
||||
BaseSoundID = 0x39D;
|
||||
|
||||
public HordeMinionFamiliar()
|
||||
{
|
||||
Body = 776;
|
||||
BaseSoundID = 0x39D;
|
||||
SetStr(100);
|
||||
SetDex(110);
|
||||
SetInt(100);
|
||||
|
||||
SetStr( 100 );
|
||||
SetDex( 110 );
|
||||
SetInt( 100 );
|
||||
SetHits(70);
|
||||
SetStam(110);
|
||||
SetMana(0);
|
||||
|
||||
SetHits( 70 );
|
||||
SetStam( 110 );
|
||||
SetMana( 0 );
|
||||
SetDamage(5, 10);
|
||||
|
||||
SetDamage( 5, 10 );
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetDamageType( ResistanceType.Physical, 100 );
|
||||
SetResistance(ResistanceType.Physical, 50, 60);
|
||||
SetResistance(ResistanceType.Fire, 50, 55);
|
||||
SetResistance(ResistanceType.Poison, 25, 30);
|
||||
SetResistance(ResistanceType.Energy, 25, 30);
|
||||
|
||||
SetResistance( ResistanceType.Physical, 50, 60 );
|
||||
SetResistance( ResistanceType.Fire, 50, 55 );
|
||||
SetResistance( ResistanceType.Poison, 25, 30 );
|
||||
SetResistance( ResistanceType.Energy, 25, 30 );
|
||||
SetSkill(SkillName.Wrestling, 70.1, 75.0);
|
||||
SetSkill(SkillName.Tactics, 50.0);
|
||||
|
||||
SetSkill( SkillName.Wrestling, 70.1, 75.0 );
|
||||
SetSkill( SkillName.Tactics, 50.0 );
|
||||
ControlSlots = 1;
|
||||
|
||||
ControlSlots = 1;
|
||||
Container pack = Backpack;
|
||||
|
||||
Container pack = Backpack;
|
||||
pack?.Delete();
|
||||
|
||||
pack?.Delete();
|
||||
pack = new Backpack();
|
||||
pack.Movable = false;
|
||||
pack.Weight = 13.0;
|
||||
|
||||
pack = new Backpack();
|
||||
pack.Movable = false;
|
||||
pack.Weight = 13.0;
|
||||
AddItem(pack);
|
||||
}
|
||||
|
||||
AddItem( pack );
|
||||
}
|
||||
public HordeMinionFamiliar(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private DateTime m_NextPickup;
|
||||
public override string CorpseName => "a horde minion corpse";
|
||||
public override bool DisplayWeight => true;
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
public override string DefaultName => "a horde minion";
|
||||
|
||||
if ( DateTime.UtcNow < m_NextPickup )
|
||||
return;
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
|
||||
m_NextPickup = DateTime.UtcNow + TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 10 ) );
|
||||
if (DateTime.UtcNow < m_NextPickup)
|
||||
return;
|
||||
|
||||
Container pack = Backpack;
|
||||
m_NextPickup = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10));
|
||||
|
||||
if ( pack == null )
|
||||
return;
|
||||
Container pack = Backpack;
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
if (pack == null)
|
||||
return;
|
||||
|
||||
foreach ( Item item in GetItemsInRange( 2 ) )
|
||||
{
|
||||
if ( item.Movable && item.Stackable )
|
||||
list.Add( item );
|
||||
}
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
int pickedUp = 0;
|
||||
foreach (Item item in GetItemsInRange(2))
|
||||
if (item.Movable && item.Stackable)
|
||||
list.Add(item);
|
||||
|
||||
for ( int i = 0; i < list.Count; ++i )
|
||||
{
|
||||
Item item = (Item)list[i];
|
||||
int pickedUp = 0;
|
||||
|
||||
if ( !pack.CheckHold( this, item, false, true ) )
|
||||
return;
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
Item item = (Item)list[i];
|
||||
|
||||
bool rejected;
|
||||
LRReason reject;
|
||||
if (!pack.CheckHold(this, item, false, true))
|
||||
return;
|
||||
|
||||
NextActionTime = Core.TickCount;
|
||||
bool rejected;
|
||||
LRReason reject;
|
||||
|
||||
Lift( item, item.Amount, out rejected, out reject );
|
||||
NextActionTime = Core.TickCount;
|
||||
|
||||
if ( rejected )
|
||||
continue;
|
||||
Lift(item, item.Amount, out rejected, out reject);
|
||||
|
||||
Drop( this, Point3D.Zero );
|
||||
if (rejected)
|
||||
continue;
|
||||
|
||||
if ( ++pickedUp == 3 )
|
||||
break;
|
||||
}
|
||||
}
|
||||
Drop(this, Point3D.Zero);
|
||||
|
||||
private void ConfirmRelease_Callback( Mobile from, bool okay, object state )
|
||||
{
|
||||
if ( okay )
|
||||
EndRelease( from );
|
||||
}
|
||||
if (++pickedUp == 3)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void BeginRelease( Mobile from )
|
||||
{
|
||||
Container pack = Backpack;
|
||||
private void ConfirmRelease_Callback(Mobile from, bool okay, object state)
|
||||
{
|
||||
if (okay)
|
||||
EndRelease(from);
|
||||
}
|
||||
|
||||
if ( pack != null && pack.Items.Count > 0 )
|
||||
from.SendGump( new WarningGump( 1060635, 30720, 1061672, 32512, 420, 280, ConfirmRelease_Callback, null ) );
|
||||
else
|
||||
EndRelease( from );
|
||||
}
|
||||
public override void BeginRelease(Mobile from)
|
||||
{
|
||||
Container pack = Backpack;
|
||||
|
||||
#region Pack Animal Methods
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
if ( !base.OnBeforeDeath() )
|
||||
return false;
|
||||
if (pack != null && pack.Items.Count > 0)
|
||||
from.SendGump(new WarningGump(1060635, 30720, 1061672, 32512, 420, 280, ConfirmRelease_Callback, null));
|
||||
else
|
||||
EndRelease(from);
|
||||
}
|
||||
|
||||
PackAnimal.CombineBackpacks( this );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
return true;
|
||||
}
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override DeathMoveResult GetInventoryMoveResultFor( Item item )
|
||||
{
|
||||
return DeathMoveResult.MoveToCorpse;
|
||||
}
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
public override bool IsSnoop( Mobile from )
|
||||
{
|
||||
if ( PackAnimal.CheckAccess( this, from ) )
|
||||
return false;
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
return base.IsSnoop( from );
|
||||
}
|
||||
#region Pack Animal Methods
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item item )
|
||||
{
|
||||
if ( CheckFeed( from, item ) )
|
||||
return true;
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
if (!base.OnBeforeDeath())
|
||||
return false;
|
||||
|
||||
if ( PackAnimal.CheckAccess( this, from ) )
|
||||
{
|
||||
AddToBackpack( item );
|
||||
return true;
|
||||
}
|
||||
PackAnimal.CombineBackpacks(this);
|
||||
|
||||
return base.OnDragDrop( from, item );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckNonlocalDrop( Mobile from, Item item, Item target )
|
||||
{
|
||||
return PackAnimal.CheckAccess( this, from );
|
||||
}
|
||||
public override DeathMoveResult GetInventoryMoveResultFor(Item item)
|
||||
{
|
||||
return DeathMoveResult.MoveToCorpse;
|
||||
}
|
||||
|
||||
public override bool CheckNonlocalLift( Mobile from, Item item )
|
||||
{
|
||||
return PackAnimal.CheckAccess( this, from );
|
||||
}
|
||||
public override bool IsSnoop(Mobile from)
|
||||
{
|
||||
if (PackAnimal.CheckAccess(this, from))
|
||||
return false;
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
PackAnimal.TryPackOpen( this, from );
|
||||
}
|
||||
return base.IsSnoop(from);
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
public override bool OnDragDrop(Mobile from, Item item)
|
||||
{
|
||||
if (CheckFeed(from, item))
|
||||
return true;
|
||||
|
||||
PackAnimal.GetContextMenuEntries( this, from, list );
|
||||
}
|
||||
#endregion
|
||||
if (PackAnimal.CheckAccess(this, from))
|
||||
{
|
||||
AddToBackpack(item);
|
||||
return true;
|
||||
}
|
||||
|
||||
public HordeMinionFamiliar( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
return base.OnDragDrop(from, item);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override bool CheckNonlocalDrop(Mobile from, Item item, Item target)
|
||||
{
|
||||
return PackAnimal.CheckAccess(this, from);
|
||||
}
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
public override bool CheckNonlocalLift(Mobile from, Item item)
|
||||
{
|
||||
return PackAnimal.CheckAccess(this, from);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
PackAnimal.TryPackOpen(this, from);
|
||||
}
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
PackAnimal.GetContextMenuEntries(this, from, list);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -3,111 +3,109 @@ using System.Collections;
|
|||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class ShadowWispFamiliar : BaseFamiliar
|
||||
{
|
||||
public override string CorpseName => "a shadow wisp corpse";
|
||||
public override string DefaultName => "a shadow wisp";
|
||||
public class ShadowWispFamiliar : BaseFamiliar
|
||||
{
|
||||
private DateTime m_NextFlare;
|
||||
|
||||
public ShadowWispFamiliar()
|
||||
{
|
||||
Body = 165;
|
||||
Hue = 0x901;
|
||||
BaseSoundID = 466;
|
||||
public ShadowWispFamiliar()
|
||||
{
|
||||
Body = 165;
|
||||
Hue = 0x901;
|
||||
BaseSoundID = 466;
|
||||
|
||||
SetStr( 50 );
|
||||
SetDex( 60 );
|
||||
SetInt( 100 );
|
||||
SetStr(50);
|
||||
SetDex(60);
|
||||
SetInt(100);
|
||||
|
||||
SetHits( 50 );
|
||||
SetStam( 60 );
|
||||
SetMana( 0 );
|
||||
SetHits(50);
|
||||
SetStam(60);
|
||||
SetMana(0);
|
||||
|
||||
SetDamage( 5, 10 );
|
||||
SetDamage(5, 10);
|
||||
|
||||
SetDamageType( ResistanceType.Energy, 100 );
|
||||
SetDamageType(ResistanceType.Energy, 100);
|
||||
|
||||
SetResistance( ResistanceType.Physical, 10, 15 );
|
||||
SetResistance( ResistanceType.Fire, 10, 15 );
|
||||
SetResistance( ResistanceType.Cold, 10, 15 );
|
||||
SetResistance( ResistanceType.Poison, 10, 15 );
|
||||
SetResistance( ResistanceType.Energy, 99 );
|
||||
SetResistance(ResistanceType.Physical, 10, 15);
|
||||
SetResistance(ResistanceType.Fire, 10, 15);
|
||||
SetResistance(ResistanceType.Cold, 10, 15);
|
||||
SetResistance(ResistanceType.Poison, 10, 15);
|
||||
SetResistance(ResistanceType.Energy, 99);
|
||||
|
||||
SetSkill( SkillName.Wrestling, 40.0 );
|
||||
SetSkill( SkillName.Tactics, 40.0 );
|
||||
SetSkill(SkillName.Wrestling, 40.0);
|
||||
SetSkill(SkillName.Tactics, 40.0);
|
||||
|
||||
ControlSlots = 1;
|
||||
}
|
||||
ControlSlots = 1;
|
||||
}
|
||||
|
||||
private DateTime m_NextFlare;
|
||||
public ShadowWispFamiliar(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
public override string CorpseName => "a shadow wisp corpse";
|
||||
public override string DefaultName => "a shadow wisp";
|
||||
|
||||
if ( DateTime.UtcNow < m_NextFlare )
|
||||
return;
|
||||
public override void OnThink()
|
||||
{
|
||||
base.OnThink();
|
||||
|
||||
m_NextFlare = DateTime.UtcNow + TimeSpan.FromSeconds( 5.0 + (25.0 * Utility.RandomDouble()) );
|
||||
if (DateTime.UtcNow < m_NextFlare)
|
||||
return;
|
||||
|
||||
FixedEffect( 0x37C4, 1, 12, 1109, 6 );
|
||||
PlaySound( 0x1D3 );
|
||||
m_NextFlare = DateTime.UtcNow + TimeSpan.FromSeconds(5.0 + 25.0 * Utility.RandomDouble());
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), Flare );
|
||||
}
|
||||
FixedEffect(0x37C4, 1, 12, 1109, 6);
|
||||
PlaySound(0x1D3);
|
||||
|
||||
private void Flare()
|
||||
{
|
||||
Mobile caster = ControlMaster;
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(0.5), Flare);
|
||||
}
|
||||
|
||||
if ( caster == null )
|
||||
caster = SummonMaster;
|
||||
private void Flare()
|
||||
{
|
||||
Mobile caster = ControlMaster;
|
||||
|
||||
if ( caster == null )
|
||||
return;
|
||||
if (caster == null)
|
||||
caster = SummonMaster;
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
if (caster == null)
|
||||
return;
|
||||
|
||||
foreach ( Mobile m in GetMobilesInRange( 5 ) )
|
||||
{
|
||||
if ( m.Player && m.Alive && !m.IsDeadBondedPet && m.Karma <= 0 && m.AccessLevel < AccessLevel.Counselor )
|
||||
list.Add( m );
|
||||
}
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
for ( int i = 0; i < list.Count; ++i )
|
||||
{
|
||||
Mobile m = (Mobile)list[i];
|
||||
bool friendly = true;
|
||||
foreach (Mobile m in GetMobilesInRange(5))
|
||||
if (m.Player && m.Alive && !m.IsDeadBondedPet && m.Karma <= 0 && m.AccessLevel < AccessLevel.Counselor)
|
||||
list.Add(m);
|
||||
|
||||
for ( int j = 0; friendly && j < caster.Aggressors.Count; ++j )
|
||||
friendly = ( caster.Aggressors[j].Attacker != m );
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)list[i];
|
||||
bool friendly = true;
|
||||
|
||||
for ( int j = 0; friendly && j < caster.Aggressed.Count; ++j )
|
||||
friendly = ( caster.Aggressed[j].Defender != m );
|
||||
for (int j = 0; friendly && j < caster.Aggressors.Count; ++j)
|
||||
friendly = caster.Aggressors[j].Attacker != m;
|
||||
|
||||
if ( friendly )
|
||||
{
|
||||
m.FixedEffect( 0x37C4, 1, 12, 1109, 3 ); // At player
|
||||
m.Mana += 1 - (m.Karma / 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int j = 0; friendly && j < caster.Aggressed.Count; ++j)
|
||||
friendly = caster.Aggressed[j].Defender != m;
|
||||
|
||||
public ShadowWispFamiliar( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
if (friendly)
|
||||
{
|
||||
m.FixedEffect(0x37C4, 1, 12, 1109, 3); // At player
|
||||
m.Mana += 1 - m.Karma / 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,55 +1,55 @@
|
|||
namespace Server.Mobiles
|
||||
{
|
||||
public class VampireBatFamiliar : BaseFamiliar
|
||||
{
|
||||
public override string CorpseName => "a vampire bat corpse";
|
||||
public override string DefaultName => "a vampire bat";
|
||||
public class VampireBatFamiliar : BaseFamiliar
|
||||
{
|
||||
public VampireBatFamiliar()
|
||||
{
|
||||
Body = 317;
|
||||
BaseSoundID = 0x270;
|
||||
|
||||
public VampireBatFamiliar()
|
||||
{
|
||||
Body = 317;
|
||||
BaseSoundID = 0x270;
|
||||
SetStr(120);
|
||||
SetDex(120);
|
||||
SetInt(100);
|
||||
|
||||
SetStr( 120 );
|
||||
SetDex( 120 );
|
||||
SetInt( 100 );
|
||||
SetHits(90);
|
||||
SetStam(120);
|
||||
SetMana(0);
|
||||
|
||||
SetHits( 90 );
|
||||
SetStam( 120 );
|
||||
SetMana( 0 );
|
||||
SetDamage(5, 10);
|
||||
|
||||
SetDamage( 5, 10 );
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetDamageType( ResistanceType.Physical, 100 );
|
||||
SetResistance(ResistanceType.Physical, 10, 15);
|
||||
SetResistance(ResistanceType.Fire, 10, 15);
|
||||
SetResistance(ResistanceType.Cold, 10, 15);
|
||||
SetResistance(ResistanceType.Poison, 10, 15);
|
||||
SetResistance(ResistanceType.Energy, 10, 15);
|
||||
|
||||
SetResistance( ResistanceType.Physical, 10, 15 );
|
||||
SetResistance( ResistanceType.Fire, 10, 15 );
|
||||
SetResistance( ResistanceType.Cold, 10, 15 );
|
||||
SetResistance( ResistanceType.Poison, 10, 15 );
|
||||
SetResistance( ResistanceType.Energy, 10, 15 );
|
||||
SetSkill(SkillName.Wrestling, 95.1, 100.0);
|
||||
SetSkill(SkillName.Tactics, 50.0);
|
||||
|
||||
SetSkill( SkillName.Wrestling, 95.1, 100.0 );
|
||||
SetSkill( SkillName.Tactics, 50.0 );
|
||||
ControlSlots = 1;
|
||||
}
|
||||
|
||||
ControlSlots = 1;
|
||||
}
|
||||
public VampireBatFamiliar(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public VampireBatFamiliar( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override string CorpseName => "a vampire bat corpse";
|
||||
public override string DefaultName => "a vampire bat";
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue