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!

Greywolf's Simple Paintball System 2.0 (maybe 1.0)

like i stated in there:

that is untested, so i am not sure if it will work or not
i am nopt at home, so i can not test it

But it gives the the idea of where to mod it at for adding something like that in
 

nadious

Sorceror
Yes, I'm well aware of that. I was just posting that to save someone else the trouble of getting the same error.
 

fcondon

Sorceror
Great system I have 2 questions though.

1.) anyone figure out how to make it tell you who eliminated you?

2.) How difficult would it be for someone who knows jack shit about coding to make a gate that would check and remove all the paintball equipment.

I know it is useless outside of the arena, but i don't like the idea of players being able to run around with the equipment outside of the arena. even though it dont work.
 

Stuart lil

Sorceror
fcondon;796902 said:
Great system I have 2 questions though.

1.) anyone figure out how to make it tell you who eliminated you?

2.) How difficult would it be for someone who knows jack shit about coding to make a gate that would check and remove all the paintball equipment.

I know it is useless outside of the arena, but i don't like the idea of players being able to run around with the equipment outside of the arena. even though it dont work.

2) i Belive you are looking for the Advanced player gate.. i think it can do this.

Try searching for it. GL
 

fcondon

Sorceror
I found it, and after checking it out and reading the posts, although it is a great gate, it don't fit what I was looking for.

Almost does, but he scrapped and took out the ability to add and remove items, which is the key thing I was looking for.

:(

Thanks for the suggestion though!
 
just have the "gate" (teleporter, etc) when they move over it, check their pack, person and bank for all items
if the item is of type base paintball gun, paint ammo, etc etc then add it to a list
then go through the list and delete all items on the list

this is something i use for a different event, but same pricable, just modify it
instead all item in world, have it check the pack, equipment and bank
or like i did here, this is just something for the gm to use after the event, he double clicks it, and poof, all items releated to the quest are gone
i also have a simular one set up for setting up the event :)

Code:
			ArrayList list = new ArrayList();
			foreach ( Item item in World.Items.Values )
			{
				if ( item is CastleScavangerQuestMetalChest ) list.Add( item );
				else if ( item is CastleScavangerQuestFindItem ) list.Add( item );
			}
			foreach ( Item item in list ) item.Delete();
			from.SendMessage("Quest Items Deleted");
 

fcondon

Sorceror
Ok... so taking your advice, and actually making my FIRST script, I am sure i have lots of errors, I would like to share it, and if anyone would be so kind as to correct anything, I would be grateful.

Basically it is a stone, I place at a location, when they are elimnated from the game they will be teleported to a room with this stone, when they click the stone it will scan and delete any trace of the paintball equipment, then teleport them to Britain.

here is the code.

Code:
using System; 
using Server; 
using Server.Mobiles; 
using Server.Items; 

namespace Server.Items 
{ 
   public class PaintballEndStone : Item 
   { 
       
      [Constructable] 
      public PaintballEndStone() : base ( 0xED4 ) 
      { 
         Movable = false; 
         Hue = 1109; 
         Name = "Teleportation Stone"; 
      }    
  
       
      public override void OnDoubleClick( Mobile from ) 
      { 

if (from != null && from.Alive)
         {
			ArrayList list = new ArrayList();
			foreach ( Item item in World.Items.Values )
			{
				if ( item is PaintBallPellets ) list.Add( item );
				else if ( item is BagOfPaintBall ) list.Add( item );
				else if ( item is PaintBallRobe ) list.Add( item );
				else if ( item is PaintBallGunStandard ) list.Add( item );
				else if ( item is PaintBallGunDefense ) list.Add( item );
				else if ( item is PaintBallGunOffense ) list.Add( item );
				else if ( item is PaintBallGunSemiAuto ) list.Add( item );
				else if ( item is PaintBallGunSniper ) list.Add( item );
			}
			foreach ( Item item in list ) item.Delete();
			from.SendMessage("Paintball Equipment Deleted");

		 	from.X = 1496;
			from.Y = 1628;
			from.Z = 10;
			from.Map = Map.Trammel;
         } 
      } 
   } 
}

you can ignore this post, I posted it in the Script Support forum which I think it is better suited for, my apolagies.
 
no problem, but heads up - that is to delete all items of it, for like a gm to use, not for a player to use

BUT a simple fix would do it:

Code:
			foreach ( Item item in World.Items.Values )
			{
				if( item.RootParentEntity == from)
				{
					if ( item is PaintBallPellets ) list.Add( item );
					else if ( item is BagOfPaintBall ) list.Add( item );
					else if ( item is PaintBallRobe ) list.Add( item );
					else if ( item is PaintBallGunStandard ) list.Add( item );
					else if ( item is PaintBallGunDefense ) list.Add( item );
					else if ( item is PaintBallGunOffense ) list.Add( item );
					else if ( item is PaintBallGunSemiAuto ) list.Add( item );
					else if ( item is PaintBallGunSniper ) list.Add( item );
				}
			}

this way it only deletes them if on their person, in pack or in bank of the person using the stone
 

fcondon

Sorceror
Thanks a lot! I made that change. I can't seem to figure out why it wont compile though, this is the error I get in RunUO.

Code:
RunUO - [www.runuo.com] Version 2.0, Build 3344.39098
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Custom/Engines/Paint Ball/PaintballEndStone.cs:
    CS0246: Line 25: The type or namespace name 'ArrayList' could not be found (
are you missing a using directive or an assembly reference?)
    CS0246: Line 25: The type or namespace name 'ArrayList' could not be found (
are you missing a using directive or an assembly reference?)
    CS0246: Line 37: The type or namespace name 'PaintBallGunSniper' could not b
e found (are you missing a using directive or an assembly reference?)
    CS1579: Line 40: foreach statement cannot operate on variables of type 'Arra
yList' because 'ArrayList' does not contain a public definition for 'GetEnumerat
or'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

Any suggestions?
 
you need to add using lines at the top of the script

using System.Collections;

also instead of listing each gun seperately (and that one is probably mispelled is the error)
can do them all at once with

else if ( item is PaintBallGunBase ) list.Add( item );

that will delete all of the guns, since thay are all of that type :)
 

fcondon

Sorceror
Thank you so much, It works perfect now! For anyone interested the script is attached.

Again it is simply a stone that will teleport your players to a location (changeable in the script) and will delete all traces of the paintball equipment (minus the bag, in case they are dumb and put stuff in the bag, i didn't want bitching because it went poof, besides it's just a bag lol).

Basically I have the paintball system set up to send a player inside a closed off room after being elimnated. They can either watch the rest of the game or leave when ever they want by using the stone i made.

I do have 1 problem though, when it compiles it gives this message in the console. I'm not sure what it means or how to fix it, but I do know the stone works. So any ideas how to make the console stop saying this, please let me know!

Code:
RunUO - [www.runuo.com] Version 2.0, Build 3344.39098
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...done (0 errors, 0 warnings)
Scripts: Skipping VB.NET Scripts...done (use -vb to enable)
[COLOR="Red"]Scripts: Verifying...Warning: Server.Items.PaintballEndStone
       - No serialization constructor
       - No Serialize() method
       - No Deserialize() method[/COLOR]

done (3098 items, 828 mobiles)
Regions: Loading...done
World: Loading...done (75516 items, 1716 mobiles) (5.73 seconds)
Restricting client version to 6.0.13.0. Action to be taken: LenientKick
Xanthos.Utilities.ConfigParser attempting to load Data/AuctionConfig.xml...
Xanthos.Utilities.ConfigParser failed.
Listening: 127.0.0.1:3593
Listening: 192.168.1.109:3593
Jail System: Starting
Jail System: 0 jailed players loaded.
Lottery System Tick.
 

Attachments

  • PaintballEndStone.cs
    1 KB · Views: 13
look at other scripts, they have 3 serial/deserial sections in them
will see the word version in 2 of them and serial is in the other one

you need to add that to the stone also, so it can be remade on restarts
 

fcondon

Sorceror
ahhh, gotcha! So this should do it then eh?

Code:
using System; 
using Server; 
using Server.Mobiles; 
using Server.Items;
using System.Collections;

namespace Server.Items 
{ 
   public class PaintballEndStone : Item 
   { 
       
      [Constructable] 
      public PaintballEndStone() : base ( 0xED4 ) 
      { 
         Movable = false; 
         Hue = 1109; 
         Name = "Teleportation Stone"; 
      }    

[COLOR="Red"]      public PaintballEndStone( Serial serial ) : base( serial ) 
      { 
      }    

      public override void Serialize( GenericWriter writer ) 
      { 
         base.Serialize( writer ); 

         writer.Write( (int) 0 ); // version 
      }   

		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}[/COLOR]
       
      public override void OnDoubleClick( Mobile from ) 
      { 

if (from != null && from.Alive)
         {
			ArrayList list = new ArrayList();
			foreach ( Item item in World.Items.Values )
			{
				if( item.RootParentEntity == from)
				{
					if ( item is PaintBallPellets ) list.Add( item );
					else if ( item is PaintBallRobe ) list.Add( item );
					else if ( item is PaintBallGunBase ) list.Add( item );
				}
			}
			foreach ( Item item in list ) item.Delete();
			from.SendMessage("Paintball Equipment Deleted");

		 	from.X = 1339;
			from.Y = 1995;
			from.Z = 0;
			from.Map = Map.Trammel;
         } 
      } 
   } 
}

The first time it compiled it bitched about my old stone not being serialized. Asked to delete it, then crashed. After restarting it however It compiles, and doesn't give any warnings or such. I restarted the server a few times making sure no wierd errors showed up, all seems good, so here it is reuploaded for anyone who wants it.

BTW, thanks for all the help Greywolf, and for the awesome system.
 

Attachments

  • PaintballEndStone.cs
    1.4 KB · Views: 17

fcondon

Sorceror
New BaseGun & Stone to remove all items.

Ok so attached is a slightly modified PaintBallGunBase.cs and a new hand-held stone I made for staff to use.

The modified PaintBallGunBase.cs file has a couple things I changed and added to it.

First, when a player is eliminated for having the wrong robe on, it will no longer change the hue of whatever robe they do have on.

and secondly I added the function I made a stone for, I realized I could just add it to the script itself. So now when they are eliminated (in any way) the equipment will be removed from there body.

One note on this however, is I did not make it delete the bag the equipment came in. This is because I didn't want a dumb player to put stuff in it, and for it to go poof and them whine about it. I just removed the rename code from the bag script itself, so when it's all said and done they just have a normal bag in there inventory.

The stone only works for admins and when they double clicks the stone it will delete every piece of paintball equipment from the world. (ground, players online, and off, etc.)

I tested both over and over, and no problems. please let me know if you come across any. I hope i'm not stepping on Grewwolf's toes here, it's a great system, and I simply made a few adjustments to fit my needs that I thought others would appreciate.

Thanks for the great system, and the help learning the code. :)
 

Attachments

  • PaintBallGunBase.cs
    4.7 KB · Views: 20
  • PainballEquipmentRemove.cs
    1.6 KB · Views: 19

redsnow

Sorceror
This is a really good idea Greywolf, thanks for posting it.

I am wondering if I am doing something wrong here, (latest svn)

1. I put in a custom region (in a box) named it like in paintballgunbase.cs
2. Gave two players the bags
3. The players got totaly naked, then put on the paint ball robe, and paintball gun
4. added 3 bots

This takes place in Fel. green acres

the bots shoot once each then freeze
only one player will shoot then nothing, they cannot shoot the bots or eachother

They can wrestle tho, just not shoot eachother


any suggestions?
 
the guns are mad to be used only in the region specified in there, and it has to be an EXACT Match including CaPs

if (defender.Player && defender.Region.Name == "The Paintball Areana" )
 

redsnow

Sorceror
I get a message telling me "you are attacking XXXX", but nothing shoots after the first shot.

I even tried to edit out the region part...

Code:
using System;
using Server.Network;
using Server.Items;

namespace Server.Items
{
	public class PaintBallGunBase : BaseRanged
	{
		public override int EffectID{ get{ return 0x1BFE; } }
		public override Type AmmoType{ get{ return typeof( PaintBallPellets ); } }
		public override Item Ammo{ get{ return new PaintBallPellets(); } }

		public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.Block; } }
		public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.ForceOfNature; } }

		public override int AosStrengthReq{ get{ return 0; } }
		public override int AosMinDamage{ get{ return 1; } }
		public override int AosMaxDamage{ get{ return 1; } }
		public override int AosSpeed{ get{ return 25; } }

		public override int OldStrengthReq{ get{ return 0; } }
		public override int OldMinDamage{ get{ return 1; } }
		public override int OldMaxDamage{ get{ return 1; } }
		public override int OldSpeed{ get{ return 25; } }

		public override int DefMaxRange{ get{ return 10; } }

		public override int InitMinHits{ get{ return 0; } }
		public override int InitMaxHits{ get{ return 0; } }

		[Constructable]
		public PaintBallGunBase() : base( 3920 )
		{
	 	 	WeaponAttributes.SelfRepair = 20;
			Attributes.NightSight = 1;
			Weight = 1.0;
			Hue = Utility.RandomMetalHue();
		}

		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			//if (defender.Player && defender.Region.Name == "The Paintball Areana" )
            if (defender.Player)
            {
                Item paintrobe = defender.FindItemOnLayer(Layer.OuterTorso);
                defender.SendMessage("You feel wet paint on you");
                if (paintrobe == null)
                {
                    defender.SendMessage("You have NO Robe ON!!!!!!");
                    defender.SendMessage("You are Eliminated");
                    defender.X = 1445;
                    defender.Y = 1687;
                    defender.Z = 0;
                    defender.Map = Map.Trammel;
                }
                else if (paintrobe.Hue == 6) paintrobe.Hue = 11;
                else if (paintrobe.Hue == 11) paintrobe.Hue = 21;
                else if (paintrobe.Hue == 21) paintrobe.Hue = 31;
                else if (paintrobe.Hue == 31) paintrobe.Hue = 38;
                else if (paintrobe.Hue == 38)
                {
                    paintrobe.Hue = 6;
                    defender.X = 1445;
                    defender.Y = 1687;
                    defender.Z = 0;
                    defender.Map = Map.Trammel;
                    defender.SendMessage("You were Eliminated");
                    this.Name = this.Name + "/";
                }
                else
                {
                    paintrobe.Hue = 6;
                    defender.X = 1445;
                    defender.Y = 1687;
                    defender.Z = 0;
                    defender.Map = Map.Trammel;
                    defender.SendMessage("You were Eliminated for an improper robe");
                }

            }
            //else if ( defender.Region.Name == "The Paintball Areana" )
            else 
			{
				attacker.SendMessage( "You stunned the bot for a moment" );
				defender.Freeze( TimeSpan.FromSeconds( 10.0 ) );
			}

			damageBonus = -10;

			base.OnHit( attacker, defender, damageBonus );
		}

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

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}
 

redsnow

Sorceror
Thanks for the help, both players have 1k worth of paint balls. If you can think of anything im missing please let me know, ill keep working on it as well.


Again thanks for the release and support.
 

redsnow

Sorceror
Sorry to Double post, however i have an update.


It appears its not just this system its also the one found (here) I got that one and had the same results. Something in the SVN is blocking repeated operation? I tried PVP with bows and arrows and that seem to work...

Any suggestions where to look?
 
Top