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!

[young]

Marcus247

Wanderer
[young]

I am tring to make a little newbied [Young] System. I need some information, how do I make a player:

1)Not able to attack other players or players attack them.

2)Monsters not able to attack a player unless the player attacks the monster.

That's all I really need to know how to do. (I have no clue on how to do this)
 

Marcus247

Wanderer
I havn't really done anything but this,

[code:1]using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Prompts;
using Server.Targeting;
using Server.Misc;


namespace Server.Young
{

public class Renounce
{

public static void Initialize()
{
//Register our speech handler
EventSink.Speech += new SpeechEventHandler( EventSink_Speech );
}


private static void EventSink_Speech( SpeechEventArgs args )
{
Mobile from = args.Mobile;

string ShoutName = from.Name;

if ( args.HasKeyword( 0x0035 ) ) // i renounce my young player status
{
Server.Young.Status.YoungStatus( 2, args.Mobile, ShoutName );
Console.WriteLine( " - '{0}' Renounces Young Player Status.", ShoutName );
}
}
}

public class Status
{

public static string YoungStatus( int youngcheck, Mobile m, string name )
{
if (((PlayerMobile)m).Young != 2)
if ( youngcheck == 1 )
{
((PlayerMobile)m).Young = 1;
((PlayerMobile)m).OrigName = name;
name = name+" [Young]";
} else {
((PlayerMobile)m).Young = 2;
((PlayerMobile)m).Name = ((PlayerMobile)m).OrigName;
}

return name;
}

public static bool IsYoung( Mobile m )
{
int Young = ((PlayerMobile)m).Young;

if (Young == 1)
{
return true;
} else {
return false;
}

}
}
}[/code:1]

I can't make them blessed or immortal cause it doesn't allow the player to attack a monster...
 

Ceday

Page
i didnt use this one before, dont know exactly what it does but give it a try:
public virtual bool CheckAttack ( Server.Mobile m )

override it in PlayerMobile..If he is young it should return "false"
btw, you could also check agressive lists..
 
Top