Reorganizes Project (#41)
This commit is contained in:
parent
08bf44af9a
commit
3614a66aee
3499 changed files with 79 additions and 55 deletions
190
Projects/Scripts/Mobiles/Special/HarrowerTentacles.cs
Normal file
190
Projects/Scripts/Mobiles/Special/HarrowerTentacles.cs
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class HarrowerTentacles : BaseCreature
|
||||
{
|
||||
private DrainTimer m_Timer;
|
||||
|
||||
public HarrowerTentacles(Mobile harrower = null) :
|
||||
base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Harrower = harrower;
|
||||
Body = 129;
|
||||
|
||||
SetStr(901, 1000);
|
||||
SetDex(126, 140);
|
||||
SetInt(1001, 1200);
|
||||
|
||||
SetHits(541, 600);
|
||||
|
||||
SetDamage(13, 20);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 20);
|
||||
SetDamageType(ResistanceType.Fire, 20);
|
||||
SetDamageType(ResistanceType.Cold, 20);
|
||||
SetDamageType(ResistanceType.Poison, 20);
|
||||
SetDamageType(ResistanceType.Energy, 20);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 55, 65);
|
||||
SetResistance(ResistanceType.Fire, 35, 45);
|
||||
SetResistance(ResistanceType.Cold, 35, 45);
|
||||
SetResistance(ResistanceType.Poison, 35, 45);
|
||||
SetResistance(ResistanceType.Energy, 35, 45);
|
||||
|
||||
SetSkill(SkillName.Meditation, 100.0);
|
||||
SetSkill(SkillName.MagicResist, 120.1, 140.0);
|
||||
SetSkill(SkillName.Swords, 90.1, 100.0);
|
||||
SetSkill(SkillName.Tactics, 90.1, 100.0);
|
||||
SetSkill(SkillName.Wrestling, 90.1, 100.0);
|
||||
|
||||
Fame = 15000;
|
||||
Karma = -15000;
|
||||
|
||||
VirtualArmor = 60;
|
||||
|
||||
m_Timer = new DrainTimer(this);
|
||||
m_Timer.Start();
|
||||
|
||||
PackReg(50);
|
||||
PackNecroReg(15, 75);
|
||||
}
|
||||
|
||||
public HarrowerTentacles(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string CorpseName => "a tentacles corpse";
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Harrower{ get; set; }
|
||||
|
||||
public override string DefaultName => "tentacles of the harrower";
|
||||
|
||||
public override bool AutoDispel => true;
|
||||
public override bool Unprovokable => true;
|
||||
public override Poison PoisonImmune => Poison.Lethal;
|
||||
public override bool DisallowAllMoves => true;
|
||||
|
||||
public override void CheckReflect(Mobile caster, ref bool reflect)
|
||||
{
|
||||
reflect = true;
|
||||
}
|
||||
|
||||
public override int GetIdleSound()
|
||||
{
|
||||
return 0x101;
|
||||
}
|
||||
|
||||
public override int GetAngerSound()
|
||||
{
|
||||
return 0x5E;
|
||||
}
|
||||
|
||||
public override int GetDeathSound()
|
||||
{
|
||||
return 0x1C2;
|
||||
}
|
||||
|
||||
public override int GetAttackSound()
|
||||
{
|
||||
return -1; // unknown
|
||||
}
|
||||
|
||||
public override int GetHurtSound()
|
||||
{
|
||||
return 0x289;
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
AddLoot(LootPack.FilthyRich, 2);
|
||||
AddLoot(LootPack.MedScrolls, 3);
|
||||
AddLoot(LootPack.HighScrolls, 2);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(Harrower);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Harrower = reader.ReadMobile();
|
||||
|
||||
m_Timer = new DrainTimer(this);
|
||||
m_Timer.Start();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
m_Timer?.Stop();
|
||||
m_Timer = null;
|
||||
|
||||
base.OnAfterDelete();
|
||||
}
|
||||
|
||||
private class DrainTimer : Timer
|
||||
{
|
||||
private HarrowerTentacles m_Owner;
|
||||
|
||||
public DrainTimer(HarrowerTentacles owner) : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Owner.Deleted)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
IPooledEnumerable<Mobile> eable = m_Owner.GetMobilesInRange<Mobile>(9);
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (m == m_Owner || !(m_Owner.CanBeHarmful(m) || m.Player && m.Alive))
|
||||
continue;
|
||||
|
||||
if (!(m is BaseCreature bc) || !(bc.Controlled || bc.Summoned || bc.Team != m_Owner.Team))
|
||||
continue;
|
||||
|
||||
m_Owner.DoHarmful(m);
|
||||
|
||||
m.FixedParticles(0x374A, 10, 15, 5013, 0x455, 0, EffectLayer.Waist);
|
||||
m.PlaySound(0x1F1);
|
||||
|
||||
int drain = Utility.RandomMinMax(14, 30);
|
||||
|
||||
m_Owner.Hits += drain;
|
||||
|
||||
if (m_Owner.Harrower != null)
|
||||
m_Owner.Harrower.Hits += drain;
|
||||
|
||||
m.Damage(drain, m_Owner);
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue