PoA_PRC8/_module/nss/set_rainbow_item.nss
Jaysyn904 8d97886c3f Changed folder name.
Changed folder name.
2022-10-07 21:08:37 -04:00

67 lines
1.5 KiB
Plaintext

//Script Name: coloritemwhite
////////////////////////////////////////////////
//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!)
*/
////////////////////////////////////////////////
//Color Include by Sadju
#include "_inc_color_text_"
//Main Script//
void main()
{
//Define Major Variables
object oPC = GetPCSpeaker();
string sName = GetLocalString(oPC, "ONNC");
string sMod;
//Let's make sure it doesn't already have a color on it!!!
if(GetStringLeft(sName, 2)=="<c")
{
AssignCommand(oPC, ClearAllActions());
FloatingTextStringOnCreature("You cannot rainbow text an item that has color, first change the name!", oPC, FALSE);
return;
}
else
{
sMod = ChaoticText(sName);
}
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, sMod);
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
}