66 lines
1.5 KiB
Plaintext
66 lines
1.5 KiB
Plaintext
|
//Script Name: coloritemgrey
|
|||
|
////////////////////////////////////////////////
|
|||
|
//Created by: Genisys / Guile
|
|||
|
//ON: 6/17/08
|
|||
|
////////////////////////////////////////////////
|
|||
|
/* **Notes**
|
|||
|
|
|||
|
This script goes in the ActionTaken
|
|||
|
event of the coloritemconv conversation
|
|||
|
on the line which will turn the item targeted
|
|||
|
to the proper color that matches this script's
|
|||
|
name (ie coloritemwhite script goes on the line
|
|||
|
which changes the color to white!)
|
|||
|
*/
|
|||
|
////////////////////////////////////////////////
|
|||
|
|
|||
|
//Main Script//
|
|||
|
|
|||
|
void main()
|
|||
|
{
|
|||
|
|
|||
|
//Define Major Variables
|
|||
|
object oPC = GetPCSpeaker();
|
|||
|
string sName = GetLocalString(oPC, "ONNC");
|
|||
|
|
|||
|
string sToken = "<c<><63><EFBFBD>>"; //Grey
|
|||
|
string sMod;
|
|||
|
|
|||
|
|
|||
|
//Let's make sure it doesn't already have a color on it!!!
|
|||
|
if(GetStringLeft(sName, 2)=="<c")
|
|||
|
{
|
|||
|
//Get the original name without the color strings!
|
|||
|
sMod = GetSubString(sName, 6, 40);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
sMod = sName;
|
|||
|
}
|
|||
|
//The new name of item (Color + Original Name)
|
|||
|
string sNew = sToken + sMod;
|
|||
|
|
|||
|
object oItem;
|
|||
|
|
|||
|
//Cycle through thier inventory to find the proper item(s)
|
|||
|
oItem = GetFirstItemInInventory(oPC);
|
|||
|
while(GetIsObjectValid(oItem)==TRUE)
|
|||
|
{
|
|||
|
//Change all items with the same name
|
|||
|
if(GetName(oItem)==sName)
|
|||
|
//Change the name to include color..
|
|||
|
SetName(oItem, sNew);
|
|||
|
|
|||
|
oItem = GetNextItemInInventory(oPC);
|
|||
|
}
|
|||
|
|
|||
|
//Kill the NPC now..
|
|||
|
DestroyObject(OBJECT_SELF, 2.0f);
|
|||
|
|
|||
|
//Remove the variables from the PC
|
|||
|
DelayCommand(2.2, DeleteLocalString(oPC, "ONNC"));
|
|||
|
|
|||
|
//Main Script End
|
|||
|
}
|
|||
|
|