Discussion in   Coding Corner   started     10 years ago   September 24, 2014, 04:52:33 AM   by   sale

[Monster] Keeper of knowledge.

sale
Offline
9 Posts
Topic :   [Monster] Keeper of knowledge.
10 years ago  September 24, 2014, 04:52:33 AM

The idea is simple : some sort of librarian which is a mage that sometimes throw a random book on his oponent.

The interesting part is the throwing one. I plan to make some grave digger who could throw body parts to his target too :P

Code: [Select]
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
using Server.Misc;

namespace Server.Mobiles
{
[CorpseName( "a keeper of knowledge corpse" )]
    public class keeperofknowledge : BaseCreature
{

[Constructable]
public keeperofknowledge() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = NameList.RandomName( "The keeper of knowledge" );
Body = 78;
BaseSoundID = 412;

SetStr( 216, 305 );
SetDex( 96, 115 );
SetInt( 966, 1045 );

SetHits( 560, 595 );

SetDamage( 15, 27 );

SetDamageType( ResistanceType.Physical, 20 );
SetDamageType( ResistanceType.Cold, 40 );
SetDamageType( ResistanceType.Energy, 40 );

SetResistance( ResistanceType.Physical, 55, 65 );
SetResistance( ResistanceType.Fire, 25, 30 );
SetResistance( ResistanceType.Cold, 50, 60 );
SetResistance( ResistanceType.Poison, 50, 60 );
SetResistance( ResistanceType.Energy, 25, 30 );

SetSkill( SkillName.EvalInt, 120.1, 130.0 );
SetSkill( SkillName.Magery, 120.1, 130.0 );
SetSkill( SkillName.Meditation, 100.1, 101.0 );
SetSkill( SkillName.Poisoning, 100.1, 101.0 );
SetSkill( SkillName.MagicResist, 175.2, 200.0 );
SetSkill( SkillName.Tactics, 90.1, 100.0 );
SetSkill( SkillName.Wrestling, 75.1, 100.0 );
SetSkill( SkillName.Necromancy, 120.1, 130.0 );
SetSkill( SkillName.SpiritSpeak, 120.1, 130.0 );

Fame = 23000;
Karma = -23000;

VirtualArmor = 60;
PackNecroReg( 30, 275 );

}

public override void GenerateLoot()
{
AddLoot( LootPack.Average );
AddLoot( LootPack.Meager );
AddLoot( LootPack.Gems );
}

        private int[] thrownitems = new int[] {0xFF2,0xFEF,0xFF1,0xFF0};
private DateTime m_NextThrow;

public override void OnActionCombat()
{
Mobile combatant = Combatant;

if ( combatant == null || combatant.Deleted || combatant.Map != Map || !InRange( combatant, 12 ) || !CanBeHarmful( combatant ) || !InLOS( combatant ) )
return;
if ( DateTime.Now >= m_NextThrow )
{
Throw( combatant );
m_NextThrow = DateTime.Now + TimeSpan.FromSeconds( 1.0 + (5.0 * Utility.RandomDouble()) );
}
}

public void Throw( Mobile m )
{
DoHarmful( m );
            this.MovingParticles(m, thrownitems[ Utility.Random( thrownitems.Length ) ], 1, 0, false, false, 0, 0, 9502, 0, 0, EffectLayer.Head, 0);
new InternalTimer( m, this ).Start();
}

private class InternalTimer : Timer
{
private Mobile m_Mobile, m_From;
public InternalTimer( Mobile m, Mobile from ) : base( TimeSpan.FromSeconds( 1.0 ) )
{
m_Mobile = m;
m_From = from;
Priority = TimerPriority.TwoFiftyMS;
}
protected override void OnTick()
{
AOS.Damage( m_Mobile, m_From, Utility.RandomMinMax( 10, 20 ), 0, 100, 0, 0, 0 );
}
}

public keeperofknowledge( Serial serial ) : base( serial )
{
}

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

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

sale
Offline
9 Posts
#1 Re :   [Monster] Keeper of knowledge.
10 years ago  September 24, 2014, 04:53:27 AM

Oh and ... i made this for another server i used to dev for. So it might need some balancing for Evo.
Great ty for the submission