jaynigs said:Not for me there isn't, maybe you have added the code to show the gump twice in the same script. check your playermobile under the onspeech method.
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Items;
using Server.Mobiles;
using Server.Misc;
using Server.Menus;
using Server.Menus.Questions;
using Server.Accounting;
using Server.Young;
namespace Server.Gumps
{
public class Young2 : Gump
{
private Mobile m_From;
public Mobile From{ get{ return m_From; } set{ m_From = value; } }
public static void Initialize()
{
EventSink.Login += new LoginEventHandler( EventSink_Login );
}
private static void EventSink_Login( LoginEventArgs args )
{
Mobile from = args.Mobile;
BankBox box = args.Mobile.BankBox;
int amount = 0;
Item[] gold = box.FindItemsByType( typeof( Gold ), true );
for (int i = 0; i < gold.Length; i++)
amount += gold[i].Amount;
if ( from is PlayerMobile && ((PlayerMobile)from).YoungPlayer && from.AccessLevel < AccessLevel.Counselor && from.Hits == from.HitsMax && !from.Criminal && from.Kills < 5 && from.Region.Name != "Haven" && from.Region.Name != "Jail") // staff kontrol
{
if (amount < 10000)
args.Mobile.SendGump( new Young2( args.Mobile ) );
}
}
public Young2(Mobile from) : base( 10, 10 )
{
AddBackground( 100, 25, 440, 110, 5054 );
AddImageTiled( 110, 35, 418, 92, 2624 );
AddAlphaRegion( 110, 35, 418, 92 );
AddPage( 0 );
Add( new GumpButton( 120, 50, 4005, 4006, 1, GumpButtonType.Reply, 2 ) );
Add( new GumpHtml( 150, 50, 350, 58, "<BODY><BODY><BASEFONT COLOR=BLACK><u>Young Player Haven Transport.</u> Select this option if you want to be transported to Haven.</BODY>", true, true );
}
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
switch ( info.ButtonID )
{
case 0: // Close/Cancel
{
break;
}
case 1: // General question
{
if ( from.Region is Regions.Jail )
{
from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
}
else if ( from.Region.Name == "Haven" )
{
from.SendLocalizedMessage( 1041529 );// You're already in Haven
}
else
{
from.Map = Map.Trammel;
from.Location = new Point3D( 3618, 2587, 0 );
}
}
break;
}
}
}
}
Faraway said:now everything seems okay but you can attack to a young player with your animals or monsters, i mean i've tested myself and i give an all kill order to my horse and it attacked to a young player.
public static bool Mobile_AllowHarmful( Mobile from, Mobile target )
{
if ( from == null || target == null )
return true;
Map map = from.Map;
if ( target is PlayerMobile && ((PlayerMobile)target).YoungPlayer && from is PlayerMobile )
{
from.SendMessage( "You cannot bring yourself to attack this young warrior" );
return false;
}
[B]else if ( target is PlayerMobile && ((PlayerMobile)target).YoungPlayer && from is BaseCreature )
{
return false;
}[/B]
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Menus;
using Server.Menus.Questions;
using Server.Accounting;
using Server.Mobiles;
using System.Collections;
using System.IO;
using System.Text;
namespace Server.Engines.Help
{
public class ContainedMenu : QuestionMenu
{
private Mobile m_From;
public ContainedMenu( Mobile from ) : base( "You already have an open help request. We will have someone assist you as soon as possible. What would you like to do?", new string[]{ "Leave my old help request like it is.", "Remove my help request from the queue." } )
{
m_From = from;
}
public override void OnCancel( NetState state )
{
m_From.SendLocalizedMessage( 1005306, "", 0x35 ); // Help request unchanged.
}
public override void OnResponse( NetState state, int index )
{
if ( index == 0 )
{
m_From.SendLocalizedMessage( 1005306, "", 0x35 ); // Help request unchanged.
}
else if ( index == 1 )
{
PageEntry entry = PageQueue.GetEntry( m_From );
if ( entry != null && entry.Handler == null )
{
m_From.SendLocalizedMessage( 1005307, "", 0x35 ); // Removed help request.
PageQueue.Remove( entry );
}
else
{
m_From.SendLocalizedMessage( 1005306, "", 0x35 ); // Help request unchanged.
}
}
}
}
public class HelpGump : Gump
{
public static void Initialize()
{
EventSink.HelpRequest += new HelpRequestEventHandler( EventSink_HelpRequest );
}
private static void EventSink_HelpRequest( HelpRequestEventArgs e )
{
foreach ( Gump g in e.Mobile.NetState.Gumps )
{
if ( g is HelpGump )
return;
}
if ( PageQueue.Contains( e.Mobile ) )
e.Mobile.SendMenu( new ContainedMenu( e.Mobile ) );
else
e.Mobile.SendGump( new HelpGump( e.Mobile ) );
}
private static bool IsYoung( Mobile m )
{
return ( m is PlayerMobile && ((PlayerMobile)m).YoungPlayer );
}
public static bool CheckCombat( Mobile m )
{
for ( int i = 0; i < m.Aggressed.Count; ++i )
{
AggressorInfo info = (AggressorInfo)m.Aggressed[i];
if ( DateTime.Now - info.LastCombatTime < TimeSpan.FromSeconds( 30.0 ) )
return true;
}
return false;
}
public HelpGump( Mobile from ) : base( 0, 0 )
{
from.CloseGump( typeof( HelpGump ) );
bool isYoung = IsYoung( from );
AddBackground( 50, 25, 540, 430, 2600 );
AddPage( 0 );
AddHtmlLocalized( 150, 50, 360, 40, 1001002, false, false ); // <CENTER><U>Ascendence Help Menu</U></CENTER>
AddButton( 425, 415, 2073, 2072, 0, GumpButtonType.Reply, 0 ); // Close
AddPage( 1 );
if ( isYoung )
{
AddButton( 80, 75, 5540, 5541, 2, GumpButtonType.Reply, 0 );
AddHtml( 110, 75, 450, 58, @"<u>My character is physically stuck in the game.</u> This choice only covers cases where your character is physically stuck in a location they cannot move out of. This option will only work two times in 24 hours.", true, true );
AddButton( 80, 170, 5540, 5541, 0, GumpButtonType.Page, 2 );
AddHtml( 110, 170, 450, 58, @"<u>Page a Game Master (GM).</font></u> If you are experiencing a problem in the game and requires in-game assistance, use this option.", true, true );
AddButton( 80, 265, 5540, 5541, 10, GumpButtonType.Reply, 0 );
AddHtml( 110, 265, 450, 58, @"<u>Ascendence Web Site</u> Go to the Ascendence website!", true, true );
AddButton( 80, 340, 5540, 5541, 11, GumpButtonType.Reply, 0 );
AddHtml( 110, 340, 450, 58, @"<u>Help</u> Lists all commands available to players.", true, true );
}
else
{
AddButton( 80, 75, 5540, 5541, 2, GumpButtonType.Reply, 0 );
AddHtml( 110, 75, 450, 74, @"<u>My character is physically stuck in the game.</u> This choice only covers cases where your character is physically stuck in a location they cannot move out of. This option will only work two times in 24 hours.", true, true );
AddButton( 80, 170, 5540, 5541, 0, GumpButtonType.Page, 2 );
AddHtml( 110, 170, 450, 74, @"<u>Page a Game Master (GM).</font></u> If you are experiencing a problem in the game and requires in-game assistance, use this option.", true, true );
AddButton( 80, 265, 5540, 5541, 10, GumpButtonType.Reply, 0 );
AddHtml( 110, 265, 450, 58, @"<u>Ascendence Web Site</u> Go to the Ascendence website!!", true, true );
AddButton( 80, 340, 5540, 5541, 11, GumpButtonType.Reply, 0 );
AddHtml( 110, 340, 450, 58, @"<u>Help</u> Lists all commands available to players.", true, true );
}
AddPage( 2 );
AddButton( 80, 90, 5540, 5541, 6, GumpButtonType.Reply, 2 );
AddHtml( 110, 90, 450, 74, @"<u>Page a Game Master (GM).</u> If you are experiencing a problem in the game and requires in-game assistance, use this option. ", true, true );
AddPage( 3 );
}
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
PageType type = (PageType)(-1);
switch ( info.ButtonID )
{
case 0: // Close/Cancel
{
from.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.
break;
}
case 1: // General question
{
type = PageType.Question;
break;
}
case 2: // Stuck
{
if ( from.Region is Server.Regions.Jail )
{
from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
}
else if ( from.CanUseStuckMenu() && from.Region.CanUseStuckMenu( from ) && !CheckCombat( from ) && !from.Frozen && !from.Criminal && from.Kills < 5 )
{
StuckMenu menu = new StuckMenu( from, from, true );
menu.BeginClose();
from.SendGump( menu );
}
else
{
type = PageType.Stuck;
}
break;
}
case 3: // Report bug or contact Origin
{
type = PageType.Bug;
break;
}
case 4: // Game suggestion
{
type = PageType.Suggestion;
break;
}
case 5: // Account management
{
type = PageType.Account;
break;
}
case 6: // Other
{
type = PageType.Other;
break;
}
case 7: // Harassment: verbal/exploit
{
type = PageType.Harassment;
break;
}
case 8: // Harassment: physical
{
type = PageType.PhysicalHarassment;
break;
}
case 9: // Young player transport
{
if ( IsYoung( from ) )
{
if ( from.Region is Regions.Jail )
{
from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
}
else if ( from.Region.Name == "Haven" )
{
from.SendLocalizedMessage( 1041529 ); // You're already in Haven
}
else
{
from.Map = Map.Trammel;
from.Location = new Point3D( 3618, 2587, 0 );
}
}
break;
}
case 10: // Launch your web site <-### By Cl0n3 ###->
{
state.LaunchBrowser( "http://www.ascendence.us" );
break;
}
case 11: // List of commands
{
Mobile m = from;
ArrayList list = new ArrayList();
foreach ( CommandEntry entry in Server.Commands.Entries.Values )
{
if ( m.AccessLevel >= entry.AccessLevel )
list.Add( entry );
}
list.Sort();
StringBuilder sb = new StringBuilder();
if ( list.Count > 0 )
sb.Append( ((CommandEntry)list[0]).Command );
for ( int i = 1; i < list.Count; ++i )
{
string v = ((CommandEntry)list[i]).Command;
if ( (sb.Length + 1 + v.Length) >= 256 )
{
m.SendAsciiMessage( 0x482, sb.ToString() );
sb = new StringBuilder();
sb.Append( v );
}
else
{
sb.Append( ' ' );
sb.Append( v );
}
}
if ( sb.Length > 0 )
m.SendAsciiMessage( 0x482, sb.ToString() );
break;
}
if ( type != (PageType)(-1) && PageQueue.CheckAllowedToPage( from ) )
from.SendGump( new PagePromptGump( from, type ) );
}
}
}
}
jaynigs said:Well, to start with, you cannot do this in trammel with or without the young system, so, you must be in felucca or in a guild. Also, since youngs are not allowed into felucca then i dont see your confusion, i have added checks for allow harmful to youngs although ive not fully tested everything. This system is an osi style system, osi has trammel and new players start in trammel. If you have a shard where your players start in felucca then the current version of this system is not recommended for your shard at this time.[/B][/CODE]
Faraway said:Thank you for your helps, i've removed the trammmel in the begining and i've changed some settings in my shard. Young System works perfect and i really want to thank you for sharing this and helping a lot. But changes also comes with some troubles, is there a way to prevent that young players can not enter to champion areas, i will do some region settings for champion areas because most of young players are using this system for champions and i got a lot of complains.
Crackerjack said:Ok I have another question now regarding the Young System. Actually its more along the lines of I screwed up one of my scripts and couldnt find the backup copy. Anyways, on my help menu, everything is working fine except for being able to page a GM now. You can choose the option, but after you click on it, nothing will happen. I tried going back and comparing the base file with what I had, but since I had already made a few changes, found it hard to pinpoint the problem. Now I ask some of the super scripters out there to help me track the problem. I believe it lies in my helpgump.cs file, but like I said before, don't know the exact problem.
ponch said:-When entering the game, a new player will get an invitation to Haven, unless he has more than 10k gold in his bank.
Code:using System; using System.Collections; using Server; using Server.Gumps; using Server.Network; using Server.Items; using Server.Mobiles; using Server.Misc; using Server.Menus; using Server.Menus.Questions; using Server.Accounting; using Server.Young; namespace Server.Gumps { public class Young2 : Gump { private Mobile m_From; public Mobile From{ get{ return m_From; } set{ m_From = value; } } public static void Initialize() { EventSink.Login += new LoginEventHandler( EventSink_Login ); } private static void EventSink_Login( LoginEventArgs args ) { Mobile from = args.Mobile; BankBox box = args.Mobile.BankBox; int amount = 0; Item[] gold = box.FindItemsByType( typeof( Gold ), true ); for (int i = 0; i < gold.Length; i++) amount += gold[i].Amount; if ( from is PlayerMobile && ((PlayerMobile)from).YoungPlayer && from.AccessLevel < AccessLevel.Counselor && from.Hits == from.HitsMax && !from.Criminal && from.Kills < 5 && from.Region.Name != "Haven" && from.Region.Name != "Jail") // staff kontrol { if (amount < 10000) args.Mobile.SendGump( new Young2( args.Mobile ) ); } } public Young2(Mobile from) : base( 10, 10 ) { AddBackground( 100, 25, 440, 110, 5054 ); AddImageTiled( 110, 35, 418, 92, 2624 ); AddAlphaRegion( 110, 35, 418, 92 ); AddPage( 0 ); Add( new GumpButton( 120, 50, 4005, 4006, 1, GumpButtonType.Reply, 2 ) ); Add( new GumpHtml( 150, 50, 350, 58, "<BODY><BODY><BASEFONT COLOR=BLACK><u>Young Player Haven Transport.</u> Select this option if you want to be transported to Haven.</BODY>", true, true ); } public override void OnResponse( NetState state, RelayInfo info ) { Mobile from = state.Mobile; switch ( info.ButtonID ) { case 0: // Close/Cancel { break; } case 1: // General question { if ( from.Region is Regions.Jail ) { from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that! } else if ( from.Region.Name == "Haven" ) { from.SendLocalizedMessage( 1041529 );// You're already in Haven } else { from.Map = Map.Trammel; from.Location = new Point3D( 3618, 2587, 0 ); } } break; } } } }
jaynigs said:There is an edited helpgump.cs included with the youngsystem files. Why not just Use that?
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
PageType type = (PageType)(-1);
switch ( info.ButtonID )
{
case 0: // Close/Cancel
{
from.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.
break;
}
case 1: // General question
{
type = PageType.Question;
break;
}
case 2: // Stuck
{
if ( from.Region is Server.Regions.Jail )
{
from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
}
else if ( from.CanUseStuckMenu() && from.Region.CanUseStuckMenu( from ) && !CheckCombat( from ) && !from.Frozen && !from.Criminal && from.Kills < 5 )
{
StuckMenu menu = new StuckMenu( from, from, true );
menu.BeginClose();
from.SendGump( menu );
}
else
{
type = PageType.Stuck;
}
break;
}
case 3: // Report bug or contact Origin
{
type = PageType.Bug;
break;
}
case 4: // Game suggestion
{
type = PageType.Suggestion;
break;
}
case 5: // Account management
{
type = PageType.Account;
break;
}
case 6: // Other
{
type = PageType.Other;
break;
}
case 7: // Harassment: verbal/exploit
{
type = PageType.Harassment;
break;
}
case 8: // Harassment: physical
{
type = PageType.PhysicalHarassment;
break;
}
case 9: // Young player transport
{
if ( IsYoung( from ) )
{
if ( from.Region is Regions.Jail )
{
from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
}
else if ( from.Region.Name == "Haven" )
{
from.SendLocalizedMessage( 1041529 ); // You're already in Haven
}
else
{
from.Map = Map.Trammel;
from.Location = new Point3D( 3618, 2587, 0 );
}
}
break;
}
case 10: // Launch your web site <-### By Cl0n3 ###->
{
state.LaunchBrowser( "http://www.ascendence.us" );
break;
}
case 11: // List of commands
}
}
jaynigs said:Hi there.
Yes, i will fix the issue with wind, but a temporary fix would be to remove the wandering healers from wind for now.
You can set the character starting locations in charactercreation.cs , this isnt really part of the young player system. A forum search will reveal this answer.
As for the transport abuse it is noted, i would like to know what happens on osi, but since it is meant to aid young players who are a bit stuck, i dont see the real issue with that.
Saxum said:Thanks for your fast reply. Well, is it possible to make it so they will get send to Haven when they die? I mean, only to Haven. And about the starting locations.. If I set it to Haven everyone will start there, not only the youngplayers.
jaynigs said:Well, since thats not what happens on osi, thats why my script doesnt do that. You can just change the ondeath method in playermobile to set the location as haven.
Also in charactercreation you do checks if they are young before sending them to haven.
Okay I'm fine with that. Just wanted to let you know I found another bug and that's that the whole name of the ticket is not displayed in AoS. The message breaks after Ticket Marked NEW.jaynigs said:Well, it needs to be scripted and im certainly not going to do it for you, my system is as per osi, if its not satisfactory in these areas then i suggest that you look at some base scripts and make it work as you want it to.