|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Lurker
Join Date: Apr 2006
Posts: 6
|
I'm attempting to change what the escortable drops, in this case change it from gold to an item. In BaseEscortable.cs around line 302 I found this peice of code
Code:
Container cont = escorter.Backpack; if ( cont == null ) cont = escorter.BankBox; Gold gold = new Gold( 500, 1000 ); if ( cont == null || !cont.TryDropItem( escorter, gold, false ) ) gold.MoveToWorld( escorter.Location, escorter.Map ); Code:
Gold gold = new Gold( 500, 1000 ); Code:
Item item = new Item ( item name placed here () ); Code:
Gold gold = new Item( item name placed here ()); Code:
mobile.AddToBackpack( new Item name placed here( ) ); |
|
|
|
|
|
#2 (permalink) |
|
Forum Novice
Join Date: Sep 2007
Posts: 173
|
What do you mean by "drops"? Do you mean you want to change what escortables give players who successfully escort them somewhere?? Or, do you want to change what the escortable drops on death, if the player kills him/her?
|
|
|
|
|
|
#4 (permalink) |
|
Master of the Internet
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,226
|
You're on the right track. You found the piece of code where the escort arrives at its destination and gives the escorter his reward:
Code:
Say( 1042809, escorter.Name ); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay. // not going anywhere m_Destination = null; m_DestinationString = null; Container cont = escorter.Backpack; if ( cont == null ) cont = escorter.BankBox; Gold gold = new Gold( 500, 1000 ); if ( !cont.TryDropItem( escorter, gold, false ) ) gold.MoveToWorld( escorter.Location, escorter.Map ); StopFollow(); Then, the script creates a new Gold item. Then, the script tries to drop the gold in "cont". If it can't, for whatever reason, then it moves the gold to the player's feet. So, say you want to replace the gold with a Kryss. You'll make the following modifications: Code:
Say( 1042809, escorter.Name ); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay. // not going anywhere m_Destination = null; m_DestinationString = null; Container cont = escorter.Backpack; if ( cont == null ) cont = escorter.BankBox; Kryss item = new Kryss(); if ( !cont.TryDropItem( escorter, item, false ) ) item.MoveToWorld( escorter.Location, escorter.Map ); StopFollow(); Hope that helps. |
|
|
|
|
|
#6 (permalink) |
|
Lurker
Join Date: Apr 2006
Posts: 6
|
greywolf79 you had mentioned wanting to be able to switch the gold for tokens. Just to try to give back a little Here is how you can do it if your using Daats Token system. Go to around line 307 of BaseEscortable.cs or better yet do a search for Gold the second one you find should be the correct location but just to make sure look back in this post for the correct area to modifiy. Any way the code would look like this.
Code:
Container cont = escorter.Backpack; if ( cont == null ) cont = escorter.BankBox; Daat99Tokens item = new Daat99Tokens( 250, 500 ); if ( cont == null || !cont.TryDropItem( escorter, item, false ) ) item.MoveToWorld( escorter.Location, escorter.Map ); Last edited by x2man; 08-07-2008 at 09:53 AM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|