If it's alright, I thought I'd share some of the scripts from my mod, since I got quite a few of them from the old thread, as well as various others on Lucasforums.
Give an item to the PC:
void main()
{
CreateItemOnObject("(TAG_OF_ITEM", GetFirstPC());
}
Spawn an NPC:
void main() {
//These are the X, Y and Z Co-Ordinates. To find these out, use the "whereami" cheat in KOTOR. As for TSL, I think there's an armband mod that gives it to you but I'm not sure.
vector vPos;
vPos.x = 0.00;
vPos.y = 0.00;
vPos.z = 0.00;
// This is the angle the NPC should be facing
float fAngle = 0.00;
CreateObject(OBJECT_TYPE_CREATURE, "NPC_TAG", Location(vPos, fAngle));
}
Kill an NPC through dialogue:
void main() {
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), OBJECT_SELF);
}
Add a new Class to an NPC:
void main()
{
AddMultiClass( CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("TAG_OF_NPC"));
// Unfortunately I don't have the full list of classes on me at the moment, but that's how to make a character a Jedi Guardian at least.
}
Make an NPC walk/run to a location:
void main () {
object oNPC=GetObjectByTag("TAG_OF_NPC");
float x=0.00;
float y=0.00;
float z=0.0;
int bRun=FALSE; //If set to TRUE, the NPC will run to the location.
vector vPoint=Vector(x,y,z);
location lPoint=Location(vPoint,0.0f);
ActionDoCommand(SetCommandable(TRUE,oNPC));
AssignCommand (oNPC,ActionForceMoveToLocation(lPoint,bRun));
}
Make an NPC Hostile:
void main() {
object oNPC = GetObjectByTag("Tag_Of_NPC");
int iFaction = STANDARD_FACTION_HOSTILE_1; //This works for all other factions as well, but, like the classes, I don't have them on me at the moment
ChangeToStandardFaction(oNPC, iFaction);
}
Check to see if a global is a certain number:
int StartingConditional()
{
int iResult = GetGlobalNumber("Your Global");
if ((iResult == [Global Number You Want]))
{
return TRUE;
}
return FALSE;
}
//Attach this to a dialogue and it will only appear if the global is the correct number
//I think this works for Journal Entries too, just replace "GetGlobalNumber" with "GetJournalEntry"
These are all for KotOR I, so I'm not sure if these work for TSL.
Please do correct me if any of these are wrong, and I'll edit the post right away.