using System;
using Server;
using Server.Network;
using Server.Items;
using Server.Mobiles;
namespace Server.Items
{
[FlipableAttribute( 0xDF1, 0xDF0 )]
public class StaffOfJupiter : BaseStaff
{
public override int ArtifactRarity{ get{ return 69; } }
public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.WhirlwindAttack; } }
public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.ParalyzingBlow; } }
public override int AosStrengthReq{ get{ return 25; } }
public override int AosMinDamage{ get{ return 20; } }
public override int AosMaxDamage{ get{ return 25; } }
public override int AosSpeed{ get{ return 40; } }
public override int OldStrengthReq{ get{ return 25; } }
public override int OldMinDamage{ get{ return 20; } }
public override int OldMaxDamage{ get{ return 25; } }
public override int OldSpeed{ get{ return 40; } }
public override int DefMaxRange{ get{return 3; } }
private int fModDiv = 75;
[Constructable]
public StaffOfJupiter() : base( 0xDF1 )
{
Name = "Jupiter's Staff of Skeletal Summoning";
Weight = 5.0;
Hue = 1152;
AccuracyLevel = WeaponAccuracyLevel.Supremely;
DurabilityLevel = WeaponDurabilityLevel.Indestructible;
DamageLevel = WeaponDamageLevel.Vanq;
WeaponAttributes.SelfRepair = 5;
Attributes.ReflectPhysical = 100;
Attributes.DefendChance = 100;
Attributes.Luck = 200;
Attributes.CastRecovery = 5;
Attributes.CastSpeed = 5;
Attributes.SpellChanneling = 1;
Attributes.SpellDamage = 55;
Attributes.WeaponDamage = 25;
Attributes.LowerManaCost = 55;
WeaponAttributes.HitLowerAttack = 100;
WeaponAttributes.HitLowerDefend = 100;
Attributes.AttackChance = 90;
WeaponAttributes.HitLeechMana = 55;
WeaponAttributes.HitLeechHits = 100;
WeaponAttributes.HitLeechStam = 55;
WeaponAttributes.HitDispel = 100;
WeaponAttributes.HitHarm = 100;
WeaponAttributes.HitFireball = 100;
WeaponAttributes.HitLightning = 100;
Attributes.RegenMana = 5;
Attributes.RegenHits = 5;
Attributes.RegenStam = 5;
LootType = LootType.Blessed;
}
public override void GetDamageTypes( out int phys, out int fire, out int cold, out int pois, out int nrgy )
{
phys = 100;
nrgy = 75;
pois = 75;
fire = 75;
cold = 75;
}
public override void OnDoubleClick( Mobile from )
{
if ( Parent != from )
{
from.SendMessage( "You must equip this item to use it." );
return;
}
if( from.Skills[SkillName.Necromancy].Value < 10 )
{
from.SendMessage( "Your necromancy skill is not high enough to summon." );
return;
}
IPooledEnumerable eable = from.Map.GetItemsInRange(from.Location, 10 ) ;
foreach( Item c in eable )
{
if( c is Corpse)
{
Corpse corpse = (Corpse)c;
if( !corpse.Owner.Player )
{
if( from.Skills[SkillName.Necromancy].Value >= 90 )
{
BaseCreature.Summon(new SkeletalMage(),from,c.Location, 0x48D, TimeSpan.FromSeconds(from.Skills[SkillName.SpiritSpeak].Value * 3) );
from.Mana -=15;
c.Delete();
eable.Free();
return;
}
if( from.Skills[SkillName.Necromancy].Value >= 50 )
{
BaseCreature.Summon(new SkeletalKnight(),from,c.Location, 0x48D, TimeSpan.FromSeconds(from.Skills[SkillName.SpiritSpeak].Value * 3) );
from.Mana -= 12;
c.Delete();
eable.Free();
return;
}
BaseCreature.Summon(new Skeleton(),from,c.Location, 0x48D, TimeSpan.FromSeconds(from.Skills[SkillName.SpiritSpeak].Value * 3) );
from.Mana -= 10;
c.Delete();
eable.Free();
return;
}
}
}
from.SendMessage("You must be near a corpse to raise it");
eable.Free();
}
public override bool OnEquip( Mobile from )
{
if( from.Skills[SkillName.Necromancy].Value >= 10 )
{
double fMod = (from.Skills[SkillName.Necromancy].Value + from.Skills[SkillName.SpiritSpeak].Value) / fModDiv ;
from.FollowersMax += (int)fMod;
}
base.OnEquip(from);
return true;
}
public override void OnRemoved( object o )
{
if( o is Mobile)
{
if( ((Mobile)o).Skills[SkillName.Necromancy].Value >= 10 )
{
double fMod = (((Mobile)o).Skills[SkillName.Necromancy].Value + ((Mobile)o).Skills[SkillName.SpiritSpeak].Value) / fModDiv ;
((Mobile)o).FollowersMax -= (int)fMod;
}
}
base.OnRemoved( o );
}
public StaffOfJupiter( 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();
}
}
}