UniqueItem found = null;
foreach (Item i in World.Items.Values)
{
if (i is UniqueItem) found = i as UniqueItem;
}
if (found != null)
{
Mobile m = found.RootParent;
if (m != null)
{
AddLabel(20,20,m.Name);
}
else AddLabel(20,20,"Nobody is carrying the item.");
}
using System;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
using Server.Prompts;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
public class Probandogump : Item
{
[Constructable]
public Probandogump() : this( null )
{
}
[Constructable]
public Probandogump( string name ) : base( 0x2258 )
{
Name = "Deed check key test";
Hue = 1153;
Movable = false;
LootType = LootType.Blessed;
}
public override void OnSingleClick( Mobile from )
{
//PrivateOverheadMessage( MessageType.Label, 25, true, "[Epico]", from.NetState );
PrivateOverheadMessage( MessageType.Label, 2548, true, "[Checks for a key]", from.NetState );
base.OnSingleClick( from );
}
public Probandogump( Serial serial ) : base( serial )
{
}
public override void OnDoubleClick( Mobile from )
{
from.SendGump( new testkeygump( 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 testkeygump : Gump
{
private Mobile m_Mobile;
private Item m_Deed;
public testkeygump (Mobile from, Item deed ) : base( 30, 20 )
{
m_Mobile = from;
m_Deed = deed;
Keyyew found = null;
foreach (Item i in World.Items.Values)
{
if (i is Keyyew) found = i as Keyyew;
}
if (found != null)
{
Mobile m = found.RootParent;
if (m != null)
{
AddLabel(20,20,m.Name);
}
else AddLabel(20,20,"Nobody is carrying the item.");
}
}
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = sender.Mobile;
switch ( info.ButtonID )
{
case 1:
{
break;
}
}
}
}
}
CS0266: Line 92: Cannot implicitly convert type 'object' to 'Server.Mobile'.
An explicit conversion exists (are you missing a cast?)
Mobile m = null;
if (found.RootParent is Mobile)
{
m = found.RootParent as Mobile;
}
CS1501: Line 95: No overload for method 'AddLabel' takes '3' arguments
CS1501: Line 97: No overload for method 'AddLabel' takes '3' arguments
AddLabel(20, 20, 0x480, "This is my label"); // AddLabel(X, Y, Hue, Text);
CS0103: Line 104: The name 'sender' does not exist in the current context
using System;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
using Server.Prompts;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
public class Probandogump : Item
{
[Constructable]
public Probandogump() : this( null )
{
}
[Constructable]
public Probandogump( string name ) : base( 0x2258 )
{
Name = "Deed check key test";
Hue = 1153;
Movable = false;
LootType = LootType.Blessed;
}
public override void OnSingleClick( Mobile from )
{
//PrivateOverheadMessage( MessageType.Label, 25, true, "[Epico]", from.NetState );
PrivateOverheadMessage( MessageType.Label, 2548, true, "[Checks for a key]", from.NetState );
base.OnSingleClick( from );
}
public Probandogump( Serial serial ) : base( serial )
{
}
public override void OnDoubleClick( Mobile from )
{
from.SendGump( new testkeygump( 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 testkeygump : Gump
{
private Mobile m_Mobile;
private Item m_Deed;
public testkeygump (Mobile from, Item deed ) : base( 30, 20 )
{
m_Mobile = from;
m_Deed = deed;
Keyyew found = null;
foreach (Item i in World.Items.Values)
{
if (i is Keyyew) found = i as Keyyew;
}
if (found != null)
{
Mobile m = null;
if (found.RootParent is Mobile && m is PlayerMobile)
{
m = found.RootParent as Mobile;
}
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
AddPage(0);
AddBackground(7, 6, 584, 476, 9200);
AddHtml( 419, 54, 168, 129, @"Player carrying the item:", (bool)true, (bool)true);
AddImage(0, 3, 5500);
AddImage(40, 39, 5528);
AddButton(355, 430, 2450, 2451, 0, GumpButtonType.Reply, 0);
AddImage(80, 85, 22200);
AddLabel(445, 111, 1156, m.Name);
}
else
AddLabel(124, 435, 1152, @"Nobody is carrying the item.");
}
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
switch ( info.ButtonID )
{
case 1:
{
break;
}
}
}
}
}
if (found != null)
{
Mobile m = null;
if (found.RootParent is Mobile && m is PlayerMobile)
{
m = found.RootParent as Mobile;
}
using System;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
using Server.Prompts;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
public class Probandogump : Item
{
[Constructable]
public Probandogump() : this( null )
{
}
[Constructable]
public Probandogump( string name ) : base( 0x2258 )
{
Name = "Deed check key test";
Hue = 1153;
Movable = false;
LootType = LootType.Blessed;
}
public override void OnSingleClick( Mobile from )
{
//PrivateOverheadMessage( MessageType.Label, 25, true, "[Epico]", from.NetState );
PrivateOverheadMessage( MessageType.Label, 2548, true, "[Checks for a key]", from.NetState );
base.OnSingleClick( from );
}
public Probandogump( Serial serial ) : base( serial )
{
}
public override void OnDoubleClick( Mobile from )
{
from.SendGump( new testkeygump( 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 testkeygump : Gump
{
private Mobile m_Mobile;
private Item m_Deed;
public testkeygump (Mobile from, Item deed ) : base( 30, 20 )
{
m_Mobile = from;
m_Deed = deed;
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
AddPage(0);
AddBackground(7, 6, 584, 476, 9200);
AddHtml( 419, 54, 168, 129, @"Player carrying the item:", (bool)true, (bool)true);
AddImage(0, 3, 5500);
AddImage(40, 39, 5528);
AddButton(355, 430, 2450, 2451, 0, GumpButtonType.Reply, 0);
AddImage(80, 85, 22200);
Keyyew found = null;
foreach (Item i in World.Items.Values)
{
if (i is Keyyew) found = i as Keyyew;
}
if (found != null)
{
Mobile m = null;
if (found.RootParent is Mobile)
{
m = found.RootParent as Mobile;
}
if (m != null && m is PlayerMobile)
{
AddLabel(445, 111, 1156, m.Name);
}
else
{
AddLabel(124, 435, 1152, @"Nobody is carrying the item.");
}
}
}
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
switch ( info.ButtonID )
{
case 1:
{
break;
}
}
}
}
}
For some reason the gump is not showing the player carrying the item.
We use essential cookies to make this site work, and optional cookies to enhance your experience.