public override bool OnDragDrop(Mobile from, Item dropped) { if (!from.InRange(this.GetWorldLocation(), 1)) { from.SendMessage(89, "You are too far from the crate, step closer."); return(false); } else { if (dropped is BaseGranite) { if (dropped is Granite) { // NORMAL GRANITE Granite yourgranite = (Granite)dropped; dropped.Delete(); from.SendMessage(89, "The machine processes your granite."); Effects.PlaySound(from.Location, from.Map, 0x2F3); // Plays the earthquake sound Item spawn = new Sand(); spawn.MoveToWorld(new Point3D(this.X + 2, this.Y - 2, this.Z + 2), this.Map); return(true); } else { // Wrong Granite Type (Not Normal) if (dropped is BaseGranite) { BaseGranite yourgranite = (BaseGranite)dropped; dropped.Delete(); from.SendMessage(89, "The machine tries to processes the granite but fail's."); Effects.PlaySound(from.Location, from.Map, 0x208); // Plays the sound from.SendMessage(89, "You loose your piece of granite!!!"); return(true); } return(false); } } from.SendMessage(89, "This machine can only process normal granite."); return(false); } return(false); }
protected override void OnTarget(Mobile from, object targeted) { IPoint3D p = targeted as IPoint3D; Map map = from.Map; IEntity to; if (p is Mobile) { to = (Mobile)p; } else { to = new Entity(Serial.Zero, new Point3D(p), map); } Effects.SendMovingEffect(from, to, 0xF0B & 0x3FFF, 7, 0, false, false, 0x8F, 0); if (targeted is BaseCreature || targeted is PlayerMobile) { from.SendMessage("Nothing happens!"); return; } TimeSpan duration = TimeSpan.FromMinutes(10); if (targeted is Sand) { Sand sand = (Sand)targeted; if (sand.Amount < 20) { from.SendMessage("That probably wouldn't be enough sand!"); } else { SpellHelper.Summon(new SandVortex(), from, 0x217, duration, false, false); sand.Delete(); return; } // { //from.SendMessage( "Nothing happens!" ); //return; //} } /*if (targeted is StaticTarget) * { * StaticTarget obj = (StaticTarget)targeted; * * if ((obj.ItemID > 6025 && obj.ItemID < 6077) || (obj.ItemID > 13420 && obj.ItemID < 13529) || (obj.ItemID >= 0x5796 && obj.ItemID <= 0x57B2) ) * { * SpellHelper.Summon( new SummonedWaterElemental(), from, 0x217, duration, false, false ); * return; * } * else * { * //from.Target = new WThrowTarget(); * from.SendMessage( "Nothing happens!" ); * return; * } * }*/ if (IsSand(targeted)) { SpellHelper.Summon(new SandVortex(), from, 0x217, duration, false, false); } else { from.SendMessage("Nothing happens!"); return; } }