Jump to content

Home

Spawning items based on appearence number?


SithRevan

Recommended Posts

This is very possible.

There are two ways to do this, but both of them are scripting.

The first one:

void main ()
{
object oObject  = GetFirstPC(); //This will return the player, you may replace it with any other objects
int nAppearance = GetAppearanceType(oObject);
int nStack = 1;
string sResRef;
if (nAppearance == 2) //2 is row number from appearance.2da, here it is T3-M4
	sResRef = "ResRef_OfYourItem1";
else if (nAppearance == 4) //2 is row number from appearance.2da, here it is Bastila's one
	sResRef = "ResRef_OfYourItem2";
else if  (nAppearance == 24) //2 is row number from appearance.2da, here it is Duros
	sResRef = "ResRef_OfYourItem3";
CreateItemOnObject(sResRef, oObject, nStack);
}

Here you just have to replace all the ResRef_OfYourItem* with the real Template ResRef of your item/items.

If you want to get some item in all other cases, mean that you haven't got appearance of Bastila/Duros/T3-M4 you will get another item.

Here is this code:

void main ()
{
object oObject  = GetFirstPC(); //This will return the player, you may replace it with any other objects
int nAppearance = GetAppearanceType(oObject);
int nStack = 1;
string sResRef;
if (nAppearance == 2) //2 is row number from appearance.2da, here it is T3-M4
	sResRef = "ResRef_OfYourItem1";
else if (nAppearance == 4) //2 is row number from appearance.2da, here it is Bastila's one
	sResRef = "ResRef_OfYourItem2";
else if  (nAppearance == 24) //2 is row number from appearance.2da, here it is Duros
	sResRef = "ResRef_OfYourItem3";
else // Here is this in all other cases block...
	sResRef = "ResRef_OfOtherItem"
CreateItemOnObject(sResRef, oObject, nStack);
}

Replace ResRef_OfOtherItem with item that you want to get in all other cases.

Say me, if you want to get different amount of items for different appearance.

Link to comment
Share on other sites

That is exactly what I wanted Lit Ridl, thank you very much.:thumbsup:

 

Edit: Hey guys I was just wondering something, can this script be used to spawn a placeable like a container in a specific spot? I still want to do it by the appearence number but I want to have it spawn a container with the item in it. IF you guys could help me agian I would really appreciate it!:D

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...