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!

[2.0 final] PvPHelperCommands

[2.0 final] PvPHelperCommands

PvPHelperCommands for RunUO 2.0 final
by Bryan Fury

This is a small package that adds a few usefull [commands to your server:
  • [PopPouch
    pops a trapped pouch to break para
  • [BandageSelf
    use a bandage and apply to self
  • [DrinkCure
    drink a greater cure potion
  • [DrinkHeal
    drink a greater heal potion
  • [DrinkRefresh
    drink a total refresh potion
  • [DrinkAgility
    drink a greater agility potion
  • [DrinkStrength
    drink a greater strength potion
The [DrinkXXX commands auto un/re-equip the users hands if needed.
So you don't have to use Razor for them to work properly.

Thanks a lot David and Lord Greywolf, without your kind help I would have never been able to finish this projekt.
Special thanks to milvaen - from his [bs / [bandself command script I've stolen a few codeparts shamelessly. ^^

In order to make the [PopPouch command work you have to make two little changes to your TrapableContainer.cs

1.) Find these lines in TrapableContainer.cs (around line 20):
Code:
[CommandProperty( AccessLevel.GameMaster )]
	public TrapType TrapType
	{
		get
		{
			return m_TrapType;
		}
		set
		{
			m_TrapType = value;
		}
	}
and add those lines to the Set-part:
Code:
if (( TrapType == TrapType.MagicTrap )&&(this.ItemID == 0xE79 ))
{
	Hue = 38;
	Name = "a pouch [trapped]";
}
else
{
	Hue = 0;
}
After these changes the code should look like:
Code:
[CommandProperty( AccessLevel.GameMaster )]
	public TrapType TrapType
	{
		get
		{
			return m_TrapType;
		}
		set
		{
			m_TrapType = value;

			if (( TrapType == TrapType.MagicTrap )&&(this.ItemID == 0xE79 ))
			{
				Hue = 38;
				Name = "a pouch [trapped]";
			}
			else
			{
				Hue = 0;
			}
		}
	}
2.) Find these lines in TrapableContainer.cs (around line 136):
Code:
case TrapType.MagicTrap:
{
	if ( from.InRange( loc, 1 ) )
		from.Damage( m_TrapPower );

	Effects.PlaySound( loc, Map, 0x307 );
	Effects.SendLocationEffect( new Point3D( loc.X - 1, loc.Y, loc.Z ), Map, 0x36BD, 15 );
	Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y, loc.Z ), Map, 0x36BD, 15 );
	Effects.SendLocationEffect( new Point3D( loc.X, loc.Y - 1, loc.Z ), Map, 0x36BD, 15 );
	Effects.SendLocationEffect( new Point3D( loc.X, loc.Y + 1, loc.Z ), Map, 0x36BD, 15 );
	Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z + 11 ), Map, 0x36BD, 15 );

	break;
}
and add those lines between the Effects-part and the break:
Code:
	Hue = 0; 
	Name = null;
After these changes the code should look like:
Code:
case TrapType.MagicTrap:
{
	if ( from.InRange( loc, 1 ) )
		from.Damage( m_TrapPower );

	Effects.PlaySound( loc, Map, 0x307 );
	Effects.SendLocationEffect( new Point3D( loc.X - 1, loc.Y, loc.Z ), Map, 0x36BD, 15 );
	Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y, loc.Z ), Map, 0x36BD, 15 );
	Effects.SendLocationEffect( new Point3D( loc.X, loc.Y - 1, loc.Z ), Map, 0x36BD, 15 );
	Effects.SendLocationEffect( new Point3D( loc.X, loc.Y + 1, loc.Z ), Map, 0x36BD, 15 );
	Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z + 11 ), Map, 0x36BD, 15 );

	Hue = 0; 
	Name = null;

	break;
}
Now save your TrapableContainer.cs. If you trap pouches after these changes they should look like this:

If they do you are able to use the [PopPouch command after copying the scripts from this package to your custom folder.

I hope you'll find these commands as usefull as I do! :)

Best regards,
Bryan Fury
 

Attachments

  • PvPHelperCommands.zip
    7.3 KB · Views: 114

M_0_h

Page
There might be a problem with using the itemID if someone uses the same ID for another container or something... wouldn't it be better to check do a check like GetType() == Pouch or something?

But apart from that the script looks nice, good idea! :)
 
M_0_h;833326 said:
There might be a problem with using the itemID if someone uses the same ID for another container or something... wouldn't it be better to check do a check like GetType() == Pouch or something?

To be honest I never thought about it. But you might be right. ;)
 
always wanted just this.

Already had the bandage self one. Coulda swore I had the drink potions but may have been a previous bugged version long since removed. But the pop pouch I definately didn't have and thank you for creating.

One bug tho.......

Your zip file is double zipped and kinda corrupt.

I had to unzip, then unzip the file inside, then open the components inside one at a time and copy paste to new text documents with the same names.

Just a mention and a tip for anyone else having the same download issues.
 
Stygian Stalker;833536 said:
Your zip file is double zipped and kinda corrupt.

I had to unzip, then unzip the file inside, then open the components inside one at a time and copy paste to new text documents with the same names.

Just a mention and a tip for anyone else having the same download issues.

Downloaded it 1 Min. ago and the file wasn't corrupt nor was it double zipped. Sorry, but I have no idea what went wrong when you downloadet it? :confused:
But nice to see you "fixed" that problem so the scripts work for you. :)
 

mumuboy

Sorceror
many shards color their pouches red when they are magic trapped by the spell and then players dclick the pouch to damage themselves. When they get damaged, it removes paralyze effects.
 
Top