Reorganizes Project (#41)
This commit is contained in:
parent
08bf44af9a
commit
3614a66aee
3499 changed files with 79 additions and 55 deletions
141
Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ShadowFiend.cs
Normal file
141
Projects/Scripts/Mobiles/Monsters/Humanoid/Melee/ShadowFiend.cs
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class ShadowFiend : BaseCreature
|
||||
{
|
||||
private UnhideTimer m_Timer;
|
||||
|
||||
[Constructible]
|
||||
public ShadowFiend() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Body = 0xA8;
|
||||
|
||||
// this to allow shadow fiend to loot from corpses
|
||||
Backpack backpack = new Backpack();
|
||||
backpack.Movable = false;
|
||||
AddItem(backpack);
|
||||
|
||||
SetStr(46, 55);
|
||||
SetDex(121, 130);
|
||||
SetInt(46, 55);
|
||||
|
||||
SetHits(28, 33);
|
||||
SetStam(46, 55);
|
||||
|
||||
SetDamage(10, 22);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 20);
|
||||
SetDamageType(ResistanceType.Cold, 80);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 20, 25);
|
||||
SetResistance(ResistanceType.Fire, 20, 25);
|
||||
SetResistance(ResistanceType.Cold, 40, 45);
|
||||
SetResistance(ResistanceType.Poison, 60, 70);
|
||||
SetResistance(ResistanceType.Energy, 5, 10);
|
||||
|
||||
SetSkill(SkillName.MagicResist, 20.1, 30.0);
|
||||
SetSkill(SkillName.Tactics, 20.1, 30.0);
|
||||
SetSkill(SkillName.Wrestling, 20.1, 30.0);
|
||||
|
||||
Fame = 1000;
|
||||
Karma = -1000;
|
||||
|
||||
m_Timer = new UnhideTimer(this);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public ShadowFiend(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool DeleteCorpseOnDeath => true;
|
||||
|
||||
public override string DefaultName => "a shadow fiend";
|
||||
|
||||
public override bool CanRummageCorpses => true;
|
||||
|
||||
public override int GetIdleSound()
|
||||
{
|
||||
return 0x37A;
|
||||
}
|
||||
|
||||
public override int GetAngerSound()
|
||||
{
|
||||
return 0x379;
|
||||
}
|
||||
|
||||
public override int GetDeathSound()
|
||||
{
|
||||
return 0x381;
|
||||
}
|
||||
|
||||
public override int GetAttackSound()
|
||||
{
|
||||
return 0x37F;
|
||||
}
|
||||
|
||||
public override int GetHurtSound()
|
||||
{
|
||||
return 0x380;
|
||||
}
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
Backpack?.Destroy();
|
||||
|
||||
Effects.SendLocationEffect(Location, Map, 0x376A, 10, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Timer = new UnhideTimer(this);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
m_Timer?.Stop();
|
||||
|
||||
m_Timer = null;
|
||||
|
||||
base.OnAfterDelete();
|
||||
}
|
||||
|
||||
private class UnhideTimer : Timer
|
||||
{
|
||||
private ShadowFiend m_Owner;
|
||||
|
||||
public UnhideTimer(ShadowFiend owner) : base(TimeSpan.FromSeconds(30.0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
Priority = TimerPriority.OneSecond;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Owner.Deleted)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (Mobile m in m_Owner.GetMobilesInRange(3))
|
||||
if (m != m_Owner && m.Player && m.Hidden && m_Owner.CanBeHarmful(m) &&
|
||||
m.AccessLevel == AccessLevel.Player)
|
||||
m.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue