RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Custom Playermobile help

Ravenal

Knight
but this is my main ALPlayerMobile.cs

[code:1]
// Awaken Lands Player Mobile Information, ONLY HEAD ADMIN EDIT
using System;
using System.IO;
using System.Collections;
using Server;
using Server.Misc;
using Server.Items;
using Server.Gumps;
using Server.Multis;
using Server.Engines.Help;
using Server.ContextMenus;
using Server.Network;
using Server.Mobiles;
using Server.RaceSystem;
using Server.DietySystem;
using Server.Spells;
using Server.Spells.Fifth;
using Server.Spells.Seventh;
using Server.Targeting;

namespace Server.Mobiles
{
public class ALPlayerMobile : PlayerMobile
{
private Mobile from;
private int m_StrCap = 100;
private int m_DexCap = 100;
private int m_IntCap = 100;
private bool m_ChangeForm = false;
private bool m_Healing = false;
private bool m_HealingTick = false;
private bool m_AtLocation = false;
private bool m_Alive = true;
private RaceEntry m_Race;
private DietyEntry m_Diety;
private bool m_AcceptNudity;
private bool m_Infravision = false;
private bool m_Serpantsight = false;
private string m_RareName;

public ALPlayerMobile()
{
}

public ALPlayerMobile( Serial s ) : base( s )
{
}

[CommandProperty( AccessLevel.Administrator )]
public string RareName
{
get{ return m_RareName; }
set{ m_RareName = value; InvalidateProperties(); }
}

[CommandProperty( AccessLevel.Administrator )]
public bool AcceptNudity
{
get{ return m_AcceptNudity; }
set{ m_AcceptNudity = value; }
}

public bool Serpantsight
{
get{ return m_Serpantsight; }
set{ m_Serpantsight = value; }
}

public bool Infravision
{
get{ return m_Infravision; }
set{ m_Infravision = value; }
}

public RaceEntry Race
{
get{ return m_Race; }
set{ m_Race = value; }
}

public DietyEntry Diety
{
get{ return m_Diety; }
set{ m_Diety = value; }
}

[CommandProperty( AccessLevel.Administrator )]
public bool AtLocation
{
get{ return m_AtLocation; }
set{ m_AtLocation = value; }
}

[CommandProperty( AccessLevel.Administrator )]
public bool Healing
{
get{ return m_Healing; }
set{ m_Healing = value; }
}

[CommandProperty( AccessLevel.Administrator )]
public bool HealingTick
{
get{ return m_HealingTick; }
set{ m_HealingTick = value; }
}

[CommandProperty( AccessLevel.Administrator )]
public bool ChangeForm
{
get{ return m_ChangeForm; }
set{ m_ChangeForm = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public int StrCap
{
get{ return m_StrCap; }
set{ m_StrCap = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public int DexCap
{
get{ return m_DexCap; }
set{ m_DexCap = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public int IntCap
{
get{ return m_IntCap; }
set{ m_IntCap = value; }
}

[CommandProperty( AccessLevel.Administrator )]
public bool IsAlive
{
get{ return m_Alive; }
set{ m_Alive = value; }
}

public override void OnDeath( Container c )
{
m_Alive = false;
base.OnDeath( c );
}

public override void OnAfterResurrect()
{
m_Alive = true;

RestoreBody();
base.OnAfterResurrect();
}

public override void AddNameProperties( ObjectPropertyList list )
{
base.AddNameProperties( list );

if ( m_Race != null )
list.Add( 1049644, "{0}", m_Race.RaceName );
if ( m_RareName != null )
list.Add( 1042971, "{0}", m_RareName );
}

public void RestoreBody()
{
if ( m_Race != null )
{
if ( Female )
{
BodyMod = m_Race.FemaleBodyMod;
}
else
{
BodyMod = m_Race.MaleBodyMod;
}
}
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)5 );//version +

// Version 6
writer.Write( (string)m_RareName );

// Version 5
if ( m_Diety == null )
writer.Write( (int)DietyType.None );
else
writer.Write( (int)m_Diety.Type );
// Version 4
writer.Write( (bool)m_Serpantsight );
writer.Write( (bool)m_Infravision );
// Version 3
writer.Write( (bool)m_AcceptNudity );

// Version 2
if ( m_Race == null )
writer.Write( (int)RaceType.None );
else
writer.Write( (int)m_Race.Type );

// Version 1
writer.Write( (bool)m_Alive );
writer.Write( (bool)m_AtLocation );
writer.Write( (bool)m_Healing );
writer.Write( (bool)m_HealingTick );
writer.Write( (bool)m_ChangeForm );
writer.Write( (int)m_StrCap );
writer.Write( (int)m_DexCap );
writer.Write( (int)m_IntCap );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();

switch( version )
{
case 5:
m_RareName = (string)reader.ReadString();
goto case 4;
case 4:
DietyType diety = (DietyType)reader.ReadInt();
m_Diety = PlayerDiety.Entries[(int)diety];
goto case 3;
case 3:
m_Infravision = (bool)reader.ReadBool();
m_Serpantsight = (bool)reader.ReadBool();
goto case 2;
case 2:
m_AcceptNudity = (bool)reader.ReadBool();
goto case 1;
case 1:
RaceType race = (RaceType)reader.ReadInt();
m_Race = PlayerRaces.Entries[(int)race];
goto case 0;
case 0:
m_Alive = (bool)reader.ReadBool();
m_AtLocation = (bool)reader.ReadBool();
m_Healing = (bool)reader.ReadBool();
m_HealingTick = (bool)reader.ReadBool();
m_ChangeForm = (bool)reader.ReadBool();
m_StrCap = (int)reader.ReadInt();
m_DexCap = (int)reader.ReadInt();
m_IntCap = (int)reader.ReadInt();
break;
}
RestoreBody();
}
}
}

[/code:1]
 

Ravenal

Knight
there is but it no sense to try convert for me... cuz my shard is in alpha stage, 2 weeks from now i think it will beta 1, for opening testing... to help fix small in game bugs lol...

And i had wiped more characters of ME than my other staff members overrall...
 

hcker2000

Wanderer
Ahh ok I see but what are u going to do when u need to add a variable later on after u open your shard up? Right now its just me and some other admins so im not woried to much about it but I dont want to have to wipe every account when i need to add a variable for a script.
 

Ravenal

Knight
Thats why i am getting all the main mobiles, i think 3 mobiles is good besides the Alliance Mobile will never bee seen by a staff member, it is in fact showing the admin thing right now cuz i am testing soon with 1 railothorn guard, basically doing this for all on death for basecreature or any creatures...

Code:
if ( Mobile is RiderofRailothorn )
{
m.OrcishaGuards += 160;
m.OrcishaElders += 80;
m.OrcishaClan += 55;
m.OrcishaMerchants += 110;
m.RailothornGuards -= 332;

m.SendMessage( "Your Faction with the {0} has Decreased: You are now {1}", riderofrail.AllianceName, this.AllianceTerm );
// So so
}
 

hcker2000

Wanderer
Ok I must just be realy bad at this im trying to make a stone that will tel me to a location but before it dose that it will write where the player is to TraveledFrom var.

i put this in my gump
[code:1]
public static void Initialize()
{
HNetMobile newfrom;
newfrom = (HNetMobile) me;
}
[/code:1]
I used me because from was already used.[/code]
 
Top