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!

Stealable Rares

Tru

Knight
Stealable Rares

OK THIS IS NOT MY SCRIPT AND I'VE CHECKED MORE THAN ONCE AND ITS NOT POSTED....AGAIN I DIDN'T MAKE THIS!!! ACTUALLY DARKRAGE DID!!
This is the Original Post (that's closed and the d/l link is broken)
http://www.runuo.com/forum/showthread.php?t=22763&highlight=stealable+rares

I so DO NOT want to support this so please refer to the previous link
This zip does include the fix to make respawn not delete stolen items... ALTHOUGH YOU NEED TO EDIT WHATEVER SPAWNER YOU USE LIKE SO (BTW THIS IS ARTEGORDON'S FIX) ....and also change the Stealing.cs

in spawner.cs or xmlspawner.cs, in the defrag() method change
Code:
if ( item.Deleted || item.Parent != null )

to
Code:
if ( item.Deleted || item.Parent != null || item.GetSavedFlag(0x00100000))

Also this does not include the doom stealable artifacts
but if you have them then to make them stealable (or any item) simply add ,IRARE to the public class like so:
public class BladeOfTheRighteous : Longsword, IRare

and add
Weight = 10.0; <----for how hard it is to steal
Movable = false; <----so people cant pick it up and walk away with it

Im simply resubmitting it as its a very nice system and it works and the communtity deserves it again:
I DID NOT MAKE THIS I SIMPLY ADDED THE FIX AND REPOSTED AS THE ORIGINAL LINK IS DEAD...

*prays he's been clear enuff*
 

Attachments

  • StealableRares.zip
    27.6 KB · Views: 364

WebSiter

Wanderer
First of all thanks for reposting it. I search a lot of times but I found a lot of broken link about this.

But I have a question; Orijinal post of this said its for B36 so it will works in 1.0 ?
 

Tru

Knight
WebSiter said:
First of all thanks for reposting it. I search a lot of times but I found a lot of broken link about this.

But I have a question; Orijinal post of this said its for B36 so it will works in 1.0 ?
Only 1.0 is supported so only scripts tested on 1.0 should be submitted
and I am using 1.0 and it works great
 

Tru

Knight
wraith said:
Question.

I use more then one type of spawner, Will this matter? and if not then could I just build a spawner JUST for spawning Rares?
doesnt matter add that bit to all your spawners
 

Tru

Knight
wraith said:
So no matter what I HAVE to add ..

if ( item.Deleted || item.Parent != null || item.GetSavedFlag(0x00100000))

to ALL my spawners? or are you suggesting it for safty reasons? Because I already ajusted a spawner to be ONLY a Rares spawner. it will spawn other things to but it is labled to be only for Rares. Makes then easy to find :)
read the whole previous thread....
 

ArteGordon

Wanderer
it only needs to be in the spawner for the rares. The reason for the change is to allow that spawner to take the rares that it is spawning off of its spawn list during its defrag pass when the item has been stolen and the flag (assuming you made the change to stealing.cs) has been set which lets the spawner know that. If you dont make the change then it is likely that eventually rares will stop spawning because people will steal them, take them home, and lock them down on the ground which will trick normal spawners into thinking that they still control them so they dont need to spawn any more.
 

Tru

Knight
wraith said:
Ok I have read ALL the threads, this one AND the HyperLink one in Trus main post. So to anyone except Tru (no disrespect intended Tru :) ) you did say you were not guna support this so I respect that. What Im trying to say is I DONT want to add that line to ALL my spawners just one spawner that will ONLY spawn rares. if I added it to all my spawners it would be like 6 kind, from the standard to inside container ones :( I made a RSpawner that has the line in it will this work or no? or are all spawners linked in some way to one main timer/decay/item checker thing so I HAVE to add it to all?

PS Tru, there are Doom arties in the package. I dont know if there all there but some say Doom(name goes here)*.cs and they have had there decay 1440 lines commented out.
Rock1
Rock2
Rock3
Rock4
Rose
and thx for the repost :) I mean it.
When I say arties I meant the Weapons and Gloves (as there are 4 actual usable items that can be stolen from Doom on OSI) I dont consider rocks and stuff artifacts...just rares
 

Tru

Knight
I actually found a bug...surprised it hasnt surfaced before now
Items stolen and locked down can be restolen
 

ArteGordon

Wanderer
Tru said:
I actually found a bug...surprised it hasnt surfaced before now
Items stolen and locked down can be restolen
The fix is to test for the stolen flag in stealing.cs just as the spawners do.

around line 70, change

Code:
				else if ( toSteal.Parent == null || !toSteal.Movable || toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed( root ) )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}

to this

Code:
                                     //ARTEGORDONMOD
				// allow stealing of rares on the ground or in containers, but prevent re-stealing if later locked down
				else if ( ((toSteal.Parent == null || !toSteal.Movable) && ( !(toSteal is IRare)  || toSteal.GetSavedFlag(0x00100000)) ) || toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed( root ) )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
 

ArteGordon

Wanderer
HadesUO said:
How do i go about fixing it if u dont mind saying? And what changes to stealing.cs would i need to make?

note you also have to have the other change in stealing.cs for any of this to work.

around line 135

Code:
						if ( stolen != null )
                        {
                            //ARTEGORDONMOD
                            // flag the item as stolen for spawners and anyone else that needs to know.  Also, release them if they were locked down (e.g. rares)
                            stolen.SetSavedFlag(0x00100000, true);
                            stolen.Movable = true;
							m_Thief.SendLocalizedMessage( 502724 ); // You succesfully steal the item.
                        }
						else
							m_Thief.SendLocalizedMessage( 502723 ); // You fail to steal the item.

but Tru probably already noted this in the package so it might be redundant.
 

Tru

Knight
ArteGordon said:
note you also have to have the other change in stealing.cs for any of this to work.

around line 135

Code:
						if ( stolen != null )
                        {
                            //ARTEGORDONMOD
                            // flag the item as stolen for spawners and anyone else that needs to know.  Also, release them if they were locked down (e.g. rares)
                            stolen.SetSavedFlag(0x00100000, true);
                            stolen.Movable = true;
							m_Thief.SendLocalizedMessage( 502724 ); // You succesfully steal the item.
                        }
						else
							m_Thief.SendLocalizedMessage( 502723 ); // You fail to steal the item.

but Tru probably already noted this in the package so it might be redundant.
Its already in...
Thanks for the quick fix
 

Tru

Knight
Arte...
Remember when you said to put item.SetSavedFlag(0x00100000,true); in your container.cs in the ondragdrop method (from the old thread)? well we shouldnt do that now right? as that will make any item dropped in any container unstealable (ie backpacks)...with your new fix.
 

ArteGordon

Wanderer
Tru said:
Arte...
Remember when you said to put item.SetSavedFlag(0x00100000,true); in your container.cs in the ondragdrop method (from the old thread)? well we shouldnt do that now right? as that will make any item dropped in any container unstealable (ie backpacks)...with your new fix.

no, its ok. the test in stealing.cs for that flag only affects IRares that are locked down or sitting in the world. non-IRare items follow the same standard rules regardless of the flag. Also, IRares that are just placed in containers and not locked down can still be stolen.
Setting the flag in container.cs protects non-stolen rares that are dragged into a container but still would be subject to the same problem with spawners not taking them off of their list.

(edit)
basically with the mods to stealing.cs, container.cs and the spawner scripts, the IRare interface serves two functions.
One is to allow locked down items to be stolen (once).
Second is to keep items that are on a long spawn cycle from confusing spawners. So any item that was going to be placed on a long "rare-like" spawn cycle could be defined with the IRare interface and it would be protected without affecting its stealability.
 

ArteGordon

Wanderer
danknight21 said:
so is this stealing a runuo 1.0 stealing script jus modfyed?
yes, the modifications are applied to the standard stealing.cs in the RC0 distribution. (also to the container.cs and spawner scripts for RC0)
 
Top