View Single Post
Old 08-07-2008, 12:51 AM   #4 (permalink)
Joeku
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,260
Default

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();
First, the script defines Container "cont". It sets "cont" to the escorter's Backpack, and then it checks to see if the Backpack exists. If it doesn't exist (i.e. if it's null), it sets "cont" to the escorter's BankBox.
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();
It really doesn't matter what you define the Kryss as - in this case, I just named it "item", but you could name it "applepie" if you wanted to. Then you just have to modify the lines that give the item to the player, and - voila!

Hope that helps.
Joeku is offline   Reply With Quote