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!

need help

X-SirSly-X

Sorceror
I think you might also be able to add it in the constructor:

Code:
	[Constructable]
	public ControlCap()
	{
		Weight = 1;
		Name = "More Control Cap";
		Hue = 1153;
                          FollowersMax = FollowersMax + 1
		LootType = LootType.Blessed; 
	}

I might be wrong, but it's worth a shot.
 

jaynigs

Wanderer
X-SirSly-X said:
I think you might also be able to add it in the constructor:

Code:
	[Constructable]
	public ControlCap()
	{
		Weight = 1;
		Name = "More Control Cap";
		Hue = 1153;
                          FollowersMax = FollowersMax + 1
		LootType = LootType.Blessed; 
	}


I might be wrong, but it's worth a shot.


No, sorry it cannot be done this way.
 

mkiplm

Sorceror
still lots of errors can u just put in the script i ant the best scripter at all so u just make it plz


- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1519: (li
ne 18, column 17) Invalid token 'if' in class, struct, or interface member decla
ration
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1519: (li
ne 18, column 30) Invalid token 'is' in class, struct, or interface member decla
ration
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1519: (li
ne 18, column 40) Invalid token ')' in class, struct, or interface member declar
ation
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1519: (li
ne 21, column 41) Invalid token '+=' in class, struct, or interface member decla
ration
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 24, column 19) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 34, column 18) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 39, column 9) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 43, column 18) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 49, column 18) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1022: (li
ne 54, column 1) Type or namespace definition, or end-of-file expected
 

jaynigs

Wanderer
mkiplm said:
still lots of errors can u just put in the script i ant the best scripter at all so u just make it plz

I would edit this post, if a moderator sees this then this thread will be locked as this is turning into a request. I am trying to help you script this without breaking any rules..
 

jaynigs

Wanderer
Hmm, well it seems he has either given up, or it compiled...

I wanted to add that even if that compiles, you will get problems when the server is restarted and there was more things to add.. but alas, he left before it was complete... :rolleyes:
 

mkiplm

Sorceror
jaynigs said:
Hmm, well it seems he has either given up, or it compiled...

I wanted to add that even if that compiles, you will get problems when the server is restarted and there was more things to add.. but alas, he left before it was complete... :rolleyes:

well heres the script not if u got aim or somthing then u wont brake any rules
 

Attachments

  • +1controlcap.cs
    1 KB · Views: 4

jaynigs

Wanderer
No i do not have AIM, i will help you here if its all the same,

i have looked at your script you posted, you have not removed this line

problem 1

Code:
                if (  parent is Mobile )
		{
			Mobile from = (Mobile)parent;
             	        from.FollowersMax += 1;
                }

it is just thrown in the wrong place...

problem 2.

You have not changed OnRemoved to look like OnAdded.
 

mkiplm

Sorceror
jaynigs said:
No i do not have AIM, i will help you here if its all the same,

i have looked at your script you posted, you have not removed this line

problem 1

Code:
                if (  parent is Mobile )
		{
			Mobile from = (Mobile)parent;
             	        from.FollowersMax += 1;
                }

it is just thrown in the wrong place...

problem 2.

You have not changed OnRemoved to look like OnAdded.

well i can only script little stuff like weps not with all this crap so srry
 

mkiplm

Sorceror
thx u i only no so much so i will keep trying but u need to give me more dircestions like where to add and what to put
 

jaynigs

Wanderer
from your script.


Code:
		LootType = LootType.Blessed; 
	}

[B]                if (  parent is Mobile )
		{
			Mobile from = (Mobile)parent;
             	        from.FollowersMax += 1;
                }[/B]

remove the code in bold...

Then,

OnRemoved should look like OnAdded, except this part

Code:
from.FollowersMax += 1;
 

X-SirSly-X

Sorceror
here it is working, and tested:

Code:
//Created by Script Creator & JayNigs
using System;
using Server;
using Server.Items;
using Server.Mobiles;

public class ControlCap: SilverEarrings
{
	[Constructable]
	public ControlCap()
	{
		Weight = 1;
		Name = "More Control Cap";
		Hue = 1153;

		LootType = LootType.Blessed;
	}

	public override void OnAdded( object parent )
	{
		if (  parent is Mobile )
		{
			Mobile from = (Mobile)parent;
			from.FollowersMax += 1;
		}
	}

	public override void OnRemoved( object parent )
	{
		if (  parent is Mobile )
		{
			Mobile from = (Mobile)parent;
			from.FollowersMax -= 1;
		}
	}

	public ControlCap( Serial serial ) : base( serial )
	{
	}

	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();
	}
}
 

jaynigs

Wanderer
X-SirSly-X said:
here it is working, and tested:

Code:
//Created by Script Creator & JayNigs
using System;
using Server;
using Server.Items;
using Server.Mobiles;

public class ControlCap: SilverEarrings
{
	[Constructable]
	public ControlCap()
	{
		Weight = 1;
		Name = "More Control Cap";
		Hue = 1153;

		LootType = LootType.Blessed;
	}

	public override void OnAdded( object parent )
	{
		if (  parent is Mobile )
		{
			Mobile from = (Mobile)parent;
			from.FollowersMax += 1;
		}
	}

	public override void OnRemoved( object parent )
	{
		if (  parent is Mobile )
		{
			Mobile from = (Mobile)parent;
			from.FollowersMax -= 1;
		}
	}

	public ControlCap( Serial serial ) : base( serial )
	{
	}

	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();
	}
}


Ok, SirSly has done the work for you,

But, you now have another problem, when the server is restarted you followersmax will be reset to 5, and if a player has the earrings equiped and removed them , it will lower it to 4.
 

X-SirSly-X

Sorceror
here is a quick fix:

Code:
	public override void OnRemoved( object parent )
	{
		if (  parent is Mobile )
		{
			Mobile from = (Mobile)parent;
			from.FollowersMax -= 1;

			[COLOR="Red"]if (from.FollowersMax <= 5)
			{
				from.FollowersMax = 5;
			}[/COLOR]
		}
	}
 
Top