Kamras
Member
I combined Two systems
Using Transformation idols 1.0.1
https://www.servuo.com/archive/transformation-idols.652/
Using Soul Binding Evolution Sword 1.0
http://www.runuo.com/community/resources/soul-binding-evolution-sword.203/
To make custom shrouds for use on my shard. The two systems were combined to make kind of a spirit shroud that I'm still fine tuning however the bigger problem is, I need these shrouds to be used via ondoubleclick and have it only be usable while it's actually equipped, in the backpack/bank/sub back or ground it needs to fail.
I'm making the ondoubleclick reference in the ' ShroudOfTheAnimalBase ' as that is set as the base for the other shroud items so they all fall back to ' ShroudOfTheAnimalBase ' .
I figured the simple option would be to do a check for mobile or playermobile , if false return however that did not work.
Here is the full Script.
Using Transformation idols 1.0.1
https://www.servuo.com/archive/transformation-idols.652/
Using Soul Binding Evolution Sword 1.0
http://www.runuo.com/community/resources/soul-binding-evolution-sword.203/
To make custom shrouds for use on my shard. The two systems were combined to make kind of a spirit shroud that I'm still fine tuning however the bigger problem is, I need these shrouds to be used via ondoubleclick and have it only be usable while it's actually equipped, in the backpack/bank/sub back or ground it needs to fail.
I'm making the ondoubleclick reference in the ' ShroudOfTheAnimalBase ' as that is set as the base for the other shroud items so they all fall back to ' ShroudOfTheAnimalBase ' .
I figured the simple option would be to do a check for mobile or playermobile , if false return however that did not work.
Here is the full Script.
Code:
using System;
using Server.Items;
using Server.Mobiles;
using Server.Spells;
/*
Sourced Header
Po0ka - April 2016
Version 1.0.1
Using Transformation idols 1.0.1
https://www.servuo.com/archive/transformation-idols.652/
Using Soul Binding Evolution Sword 1.0
http://www.runuo.com/community/resources/soul-binding-evolution-sword.203/
All Credit to the above authors for the original systems
*/
namespace Server.Items
{
public class ShroudOfTheAnimalBase : BaseOuterTorso
{
private static int m_TransformSound = 501;
private string m_StatueName;
private int m_BodyMod;
[CommandProperty( AccessLevel.GameMaster )]
public string StatueName
{
get { return m_StatueName; }
set { m_StatueName = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public int BodyMod
{
get { return m_BodyMod; }
set { m_BodyMod = value; }
}
public override string DefaultName
{
get { return String.Format( "{0} idol", m_StatueName ); }
}
[Constructable]
public ShroudOfTheAnimalBase( int itemid, string name, int body ) : base( itemid )
{
m_StatueName = name;
m_BodyMod = body;
ItemID = itemid;
Movable = true;
}
public ShroudOfTheAnimalBase( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (string) m_StatueName );
writer.Write( (int) m_BodyMod );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_StatueName = reader.ReadString();
m_BodyMod = reader.ReadInt();
}
public override void OnDoubleClick( Mobile from )
{
PlayerMobile pm = from as PlayerMobile;
if (this.Parent == from)
{
from.SendLocalizedMessage(502641); // You must equip this item to use it.
return;
}
else if ( from.Mounted )
{
from.SendLocalizedMessage( 1042561 ); // Please dismount first.
}
else if ( Factions.Sigil.ExistsOn( from ) )
{
from.SendLocalizedMessage(1010521); // You cannot polymorph while you have a Town Sigil
}
else if ( TransformationSpellHelper.UnderTransformation( from ) )
{
from.SendLocalizedMessage(1061633); // You cannot polymorph while in that form.
}
else if ( DisguiseTimers.IsDisguised( from ) )
{
from.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
}
else if (from.BodyMod == 183 || from.BodyMod == 184)
{
from.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
}
else
{
if (from.BodyMod != 0)
from.BodyMod = 0;
else
from.BodyMod = m_BodyMod;
from.PlaySound( m_TransformSound );
from.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
}
}
}
#region Custom Shrouds
[Flipable(0x2684, 0x2683)]
public class ShroudOfTheWolf : ShroudOfTheAnimalBase
{
private int BoundToSoul = 0;
[Constructable]
public ShroudOfTheWolf() : base( 0x2684, "Shroud Of The Wolf", 23 )
{
this.Name = "Shroud Of The Wolf";
this.Hue = 1967;
this.Weight = 0;
this.LootType = LootType.Blessed;
BoundToSoul = 0;
this.Attributes.BonusInt = 20;
this.Attributes.BonusHits = 150;
this.Attributes.BonusDex = 50;
this.Attributes.RegenMana = 20;
this.Attributes.RegenHits = 6;
this.Attributes.NightSight = 1;
this.Attributes.Luck = 495;
this.Attributes.AttackChance = 15;
}
public override Race RequiredRace
{
get
{
return Race.Human;
}
}
public override bool OnEquip( Mobile from )
{
from.Hidden = true;
Effects.SendTargetEffect(from, 0x3709, 32);
Effects.SendTargetEffect(from, 0x376A, 32);
from.SendMessage("You feel the Wolf Spirit fill your soul.");
//from.PublicOverheadMessage(MessageType.Regular, 0, true, "Your body is burdened with power.");
from.PlaySound(0x208);
if(BoundToSoul == 0)
{
BoundToSoul = from.Serial;
this.Name = from.Name.ToString() + "'s Wolf Shroud";
from.Emote( "*" + from.Name + " feels a weird energy overwhelming their body*" );
base.OnEquip( from );
return true;
}
else if(BoundToSoul == from.Serial)
{
base.OnEquip( from );
return true;
}
else
{
from.SendMessage( "The Wolf Spirit refuses your soul..." );
return false;
}
}
public override void OnRemoved(object parent)
{
if (parent is Mobile)
{
Mobile m = (Mobile)parent;
//m.Hidden = False;
Effects.SendTargetEffect(m, 0x3709, 32);
m.SendMessage("You feel the burden of power fade and the Wolf spirit subside...");
//from.PublicOverheadMessage(MessageType.Regular, 0, true, "You feel the burden of power fade and the Wolf spirit subside...");
m.PlaySound(0x208);
}
}
public override void AddNameProperty(ObjectPropertyList list)
{
base.AddNameProperty( list );
if(BoundToSoul == 0)
{
list.Add( "<BASEFONT COLOR=#669966>"/*Green*/ + "[Un-Bound]" + "<BASEFONT COLOR=#FFFFFF>"/*Back to White*/ );
}
else if (BoundToSoul >= 0)
{
list.Add( "<BASEFONT COLOR=#669966>"/*Green*/ + "[Soulbound]" + "<BASEFONT COLOR=#FFFFFF>"/*Back to White*/ );
}
}
public override bool Dye(Mobile from, DyeTub sender)
{
from.SendLocalizedMessage(sender.FailMessage);
return false;
}
public ShroudOfTheWolf( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) BoundToSoul );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
BoundToSoul = reader.ReadInt();
}
}
[Flipable(0x2684, 0x2683)]
public class ShroudOfTheSnake : ShroudOfTheAnimalBase
{
[Constructable]
public ShroudOfTheSnake() : base( 0x2684, "Shroud Of The Snake", 23 )
{
this.Name = "Shroud Of The Snake";
this.Hue = 1967;
this.Weight = 0;
this.LootType = LootType.Blessed;
this.Attributes.BonusInt = 20;
this.Attributes.BonusHits = 150;
this.Attributes.BonusDex = 50;
this.Attributes.RegenMana = 20;
this.Attributes.RegenHits = 6;
this.Attributes.NightSight = 1;
this.Attributes.Luck = 495;
this.Attributes.AttackChance = 15;
}
public override Race RequiredRace
{
get
{
return Race.Human;
}
}
public override bool Dye(Mobile from, DyeTub sender)
{
from.SendLocalizedMessage(sender.FailMessage);
return false;
}
public ShroudOfTheSnake( 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();
}
}
}