Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 09-08-2004, 09:23 AM   #1 (permalink)
 
Join Date: Sep 2004
Age: 17
Posts: 24
Default Poison Bow&Arrows scripts!

I modified the Arrow.cs and CompositeBow.cs, changed their scripts and name etc etc...

And blew the buttons off my keyboard twice.

I still haven't figured out a better way to shoot poisoned arrows without 1 million pages of script

Please post here if you find any bugs or something stuff like that.
Also if someone finds out a better hue for the arrows...

Description:

Poisons the target every succesfull hit (Lesser Poison), you can add the bow by typing [Add PoisonBow
and arrows, [Add PoisonArrow

Also this doesn't require any script modifications.

Note:*The scripts are modified versions of the ones stored in your folder automatically when you install RunUO*

Note#2: You should carefully watch the amount of the arrows, with GM Archery you usually poison your target very often.

Installation:

Just place the scripts in your Custom folder so everything stays arranged

(if doesn't work, try placing the PoisonArrow file in Scripts\Items\Resources\Arrows\ and the PoisonBow.cs in the Scripts\Items\Weapons\Ranged\ folder.)
Attached Files
File Type: cs PoisonArrow.cs (975 Bytes, 367 views)
File Type: cs PoisonBow.cs (2.1 KB, 362 views)
Shadeh is offline   Reply With Quote
Old 09-08-2004, 09:34 AM   #2 (permalink)
Cheese's Cream
Guest
 
Posts: n/a
Default

this is kinda cool
  Reply With Quote
Old 09-09-2004, 04:18 AM   #3 (permalink)
 
Join Date: Jul 2004
Age: 26
Posts: 2
Default

Quote:
Originally Posted by Cheese's Cream
this is kinda cool
Heh. This need added ammotipe swith.
Primary is offline   Reply With Quote
Old 09-09-2004, 04:25 AM   #4 (permalink)
Forum Expert
 
Join Date: Nov 2003
Posts: 252
Default

Is this what ya lookin for?
public override int EffectID{ get{ return 0xF42; } }
public override Type AmmoType{ get{ return typeof( PoisonArrow ); } }
public override Item Ammo{ get{ return new PoisonArrow(); } }
AutomatedPOM is offline   Reply With Quote
Old 09-09-2004, 08:31 AM   #5 (permalink)
 
Join Date: Sep 2004
Age: 17
Posts: 24
Default

Quote:
Originally Posted by AutomatedPOM
Is this what ya lookin for?
public override int EffectID{ get{ return 0xF42; } }
public override Type AmmoType{ get{ return typeof( PoisonArrow ); } }
public override Item Ammo{ get{ return new PoisonArrow(); } }
No

Because i have that in my poisonbow.cs xD

I meaned that I need a somekind of a way to make a normal bow to check if the player has poisonarrows in their inventory and if so, shoot them instead of normal arrows.
Shadeh is offline   Reply With Quote
Old 09-09-2004, 10:30 AM   #6 (permalink)
Forum Novice
 
Halciet's Avatar
 
Join Date: Jan 2004
Location: Chapel Hill, NC
Age: 26
Posts: 165
Send a message via ICQ to Halciet Send a message via AIM to Halciet
Default

You don't need to make new bows or anything of that nature. To make every bow/crossbow capable of firing poisoned ammunition, you just need to create two scripts and alter one:

1. Open Arrow.cs; use the find and replace to find all instances of "Arrow" and replace them with with "PoisonedArrow"

In the constructor, add
Code:
Name = "poisoned arrow";
So that it looks like this:

Code:
public PoisonedArrow( int amount ) : base( 0xF3F )
{
        Name = "poisoned arrow";
	Stackable = true;
	Weight = 0.1;
	Amount = amount;
}
Save the file as "PoisonedArrow.cs"

2. Open Bolt.cs; use the find and replace to find all instances of "Bolt" and replace them with "PoisonedBolt"

In the constructor, add
Code:
 Name = "poisoned bolt";
So that it looks like this:

Code:
public PoisonedBolt( int amount ) : base( 0x1BFB )
{
        Name = "poisoned bolt";
	Stackable = true;
	Weight = 0.1;
	Amount = amount;
}
Save the file as "PoisonedBolt.cs"

3. Open BaseRanged.cs

In the constructor, add "Poison = Poison.Lesser;" so that it looks like this:

Code:
public BaseRanged( int itemID ) : base( itemID )
{
     Poison = Poison.Lesser;
}
The will make all bows automatically poisoned, but they won't fire off the poison or display the property since the charges will be set to 0. You can change the poison level to whatever you want here, but for balance sake I just left it at Lesser.

In OnFired, add this code after "Container pack = attacker.Backpack;"

Code:
if( attacker.Player && pack != null && (( AmmoType == typeof(Arrow) && pack.ConsumeTotal( typeof( PoisonArrow ), 1 ) ) || ( AmmoType == typeof(Bolt) && pack.ConsumeTotal( typeof( PoisonBolt), 1 ) ) ) )
{
	PoisonCharges = 1;
				
	attacker.MovingEffect( defender, EffectID, 18, 1, false, false );
				
	return true;
}
In OnHit, add this code after "base.OnHit( attacker, defender );"

Code:
if ( Poison != null && PoisonCharges > 0 )
{
	--PoisonCharges;

	if ( Utility.RandomDouble() >= 0.75 ) // 25% chance to poison
		defender.ApplyPoison( attacker, Poison );
}
There. That makes all your archery weapons capable of shooting lesser poison arrows if you have one in your pack. If you have both poisoned arrows and non-poisoned arrows in your pack, it will use up the poisoned ones first. You could add a context menu entry that lets you choose whether or not you want to fire poisoned or non-poisoned, but that's a bit more in-depth. Similarly, you'd want to make it so players could craft poison arrows, but as far as making them fireable, this is all you need to do.

I went ahead and submitted this to the FAQ section too, since a lot of people ask me how to set this up.

-Hal
Halciet is offline   Reply With Quote
Old 09-09-2004, 01:21 PM   #7 (permalink)
 
Join Date: Sep 2004
Age: 17
Posts: 24
Default

Thanks Halciet
Shadeh is offline   Reply With Quote
Old 09-09-2004, 03:12 PM   #8 (permalink)
Forum Novice
 
Halciet's Avatar
 
Join Date: Jan 2004
Location: Chapel Hill, NC
Age: 26
Posts: 165
Send a message via ICQ to Halciet Send a message via AIM to Halciet
Default

Yep yep, and thanks for your submission and questions, because it finally pushed me to go ahead and write it all out, hah hah.

-Hal
Halciet is offline   Reply With Quote
Old 09-23-2004, 10:53 AM   #9 (permalink)
Forum Novice
 
Join Date: Dec 2002
Location: Latvia
Age: 24
Posts: 116
Send a message via MSN to Xacker Send a message via Skype™ to Xacker
Default ????

constructor ???? witch script ???
Xacker is offline   Reply With Quote
Old 09-23-2004, 11:14 AM   #10 (permalink)
Forum Novice
 
Halciet's Avatar
 
Join Date: Jan 2004
Location: Chapel Hill, NC
Age: 26
Posts: 165
Send a message via ICQ to Halciet Send a message via AIM to Halciet
Default

The constructor, in BaseRanged, for example, looks like:

Code:
public BaseRanged( int itemID ) : base( itemID )
{
}
In programming this method is referred to as a constructor, because it is what is called when the script is run. See the FAQ version of this post if you're still confused.

-Hal
Halciet is offline   Reply With Quote
Old 09-23-2004, 02:06 PM   #11 (permalink)
Forum Expert
 
Join Date: Aug 2003
Posts: 737
Send a message via ICQ to georox Send a message via AIM to georox
Default

how about instead of em all being poisoned, with a poison potion you can poison 12 arrows at a time, and they get the poison of it, rehued, renamed, and when one poisoned via skill hits someone they get that poison? til their poisoned there normal arrows thou? any ideas?
__________________
georox is offline   Reply With Quote
Old 11-25-2004, 04:33 AM   #12 (permalink)
 
Join Date: Jul 2004
Age: 31
Posts: 10
Default Change to deadly

Ok how would I get deadly poison on just that bow. (dont want all my bows to shoot poison arrows just the poison bow.

So I assume I dont mess with baserange.cs at all correct?

I tried altering just

defender.AddToBackpack( Ammo )
defender.ApplyPoison( defender, Poison.Lesser );

but got error

Do i need to add something else in the constructor similar to what you have written for altering the poison in BaseRange.cs?

Very Cool script btw thanks for submitting. Just wanna test the heavier poison see if it doesnt create to big of an imbalance in the shard

NVM I'm a bone head, I didnt have the file formatted correcty. Flame at will, God knows I earned that one
Ariakas89 is offline   Reply With Quote
Old 06-06-2005, 05:32 AM   #13 (permalink)
 
Join Date: Jan 2005
Age: 25
Posts: 219
Default

I made it where this bow would shoot regular arrow's. How would I go about making it have a much, much smaller chance of poisoning?
imanewb is offline   Reply With Quote
Old 07-02-2005, 04:46 PM   #14 (permalink)
Forum Novice
 
Join Date: Feb 2004
Age: 22
Posts: 204
Send a message via ICQ to Karavoc Send a message via MSN to Karavoc Send a message via Yahoo to Karavoc
Default

i've been thinking about some thing like this for a while, and i agree with Ariakas89 is it posible to take the weapon poisoning script and take a line from that add it to the arrows sothat you can use potions on em, (if any thing make a new item that you can put poison in and dip the arrows in) that way you can get the same pluses you get from having the poisoning skill....

i was also wondering if there was any way to make a script to allow you to drop say 5 tiles of oil and make flaiming arrows (or use magic arrow on it) and it makes a wall of fire. or does fire damage but the arrow can still be shot from a normal bow
Karavoc is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5