CODE |
using System; using System.Collections; using System.Collections.Generic; using Server; using Server.Items; using Server.Targeting; using Server.ContextMenus; using Server.Gumps; using Server.Misc; using Server.Network; using Server.Spells; using Server.Mobiles; namespace Server.Mobiles { [CorpseName( "Chakademus' corpse" )] public class Chakademus : Mobile { public virtual bool IsInvulnerable{ get{ return true; } } [Constructable] public Chakademus() { Name = "Chakademus"; Title = "The Ethereal Conjourer"; Body = 400; CantWalk = true; Boots b = new Boots(); b.Hue = 1; AddItem( b ); LongPants lp = new LongPants(); lp.Hue = 292; AddItem( lp ); FancyShirt fs = new FancyShirt(); fs.Hue = 1153; AddItem( fs ); AddItem( new LongHair(1150)); } public Chakademus( Serial serial ) : base( serial ) { } public override void GetContextMenuEntries( Mobile from, ArrayList list ) { base.GetContextMenuEntries( from, list ); list.Add( new ChakademusEntry( from, this ) ); } 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(); } public class ChakademusEntry : ContextMenuEntry { private Mobile m_Mobile; private Mobile m_Giver; public ChakademusEntry( Mobile from, Mobile giver ) : base( 6146, 3 ) { m_Mobile = from; m_Giver = giver; } public override void OnClick() { if( !( m_Mobile is PlayerMobile ) ) return; PlayerMobile mobile = (PlayerMobile) m_Mobile; { if ( ! mobile.HasGump( typeof( ChakademusGump ) ) ) { mobile.SendGump( new ChakademusGump( mobile )); mobile.AddToBackpack( new EtherealBox() ); } } } } public override bool OnDragDrop( Mobile from, Item dropped ) { Mobile m = from; PlayerMobile mobile = m as PlayerMobile; Account acct=(Account)from.Account; bool EtherealMist = Convert.ToBoolean( acct.GetTag("EtherealMistRecieved") ); if ( mobile != null) { if( dropped is EtherealMist ) { if(dropped.Amount!=1) { this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "Right, lets see now", mobile.NetState ); return false; } if ( !EtherealMist ) //added account tag check { dropped.Delete(); mobile.AddToBackpack( new EtherealHorse() ); mobile.SendMessage( "There you go, your ethereal horse, as promised." ); acct.SetTag( "EtherealMistRecieved", "true" ); } else //what to do if account has already been tagged { mobile.SendMessage("I am sorry, I can only give you one."); mobile.AddToBackpack( new EtherealMist( 1 ) ); dropped.Delete(); } } else { this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "Thx but I dont need that", mobile.NetState ); } } return false; } } } |