// a_DoStuff (string sTarget)
/*
Description:
Parameters:
sTarget - Tag of the target object. Default is OWNER.
=== Action Script general Info ===
This is a conversation action script template.
Action script names are usually prefixed as follows:
"ga_" - global action script
"ka_" - campaign action script
"<moduleID>a_" - module action script
Conversation actions and conditions are the only scripts that can have parameters.
Any number and many types of parameters can be passed.
*/
// Name_Date
#include "ginc_param_const"
void main(string sTarget)
{
// Get the PC Speaker - if used from command line, then use OBJECT_SELF
// In a conversation, OBJECT_SELF refers to the NPC.
// From the command line, OBJECT_SELF refers to the currently possesed character.
object oPC = (GetPCSpeaker()==OBJECT_INVALID?OBJECT_SELF:GetPCSpeaker());
// Find a target by Tag - also supports "$PC", "$OWNED_CHAR", etc. (see list in ginc_param_const)
// Optional second parameter can be added to change the default target.
object oTarget = GetTarget(sTarget);
// If debug text is on, this will let you know the script fired.
PrettyDebug("Script Fired on target: " + GetName(oTarget) + "!");
// Do stuff here
object oNaked;
if (GetIsPC(oTarget)) oNaked = GetItemPossessedBy(oTarget, "BARESKIN");
else oNaked = GetItemPossessedBy(oTarget, "HARD");
//Get Equipped Items
object oLHand = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oTarget);
object oRHand = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget);
object oHat = GetItemInSlot(INVENTORY_SLOT_HEAD, oTarget);
object oShirt = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget);
object oGloves = GetItemInSlot(INVENTORY_SLOT_ARMS, oTarget);
object oCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK, oTarget);
object oBoots = GetItemInSlot(INVENTORY_SLOT_BOOTS, oTarget);
object oBelt = GetItemInSlot(INVENTORY_SLOT_BELT, oTarget);
//Store objects for later re-equipping
SetLocalObject(oTarget, "oLHand", oLHand);
SetLocalObject(oTarget, "oRHand", oRHand);
SetLocalObject(oTarget, "oHat", oHat);
SetLocalObject(oTarget, "oShirt", oShirt);
SetLocalObject(oTarget, "oGloves", oGloves);
SetLocalObject(oTarget, "oCloak", oCloak);
SetLocalObject(oTarget, "oBoots", oBoots);
SetLocalObject(oTarget, "oBelt", oBelt);
SetLocalString(oTarget, "sShirtTag", GetTag(oShirt));
//Strip
AssignCommand(oTarget, ActionUnequipItem(oLHand));
AssignCommand(oTarget, ActionUnequipItem(oRHand));
AssignCommand(oTarget, ActionUnequipItem(oCloak));
AssignCommand(oTarget, ActionUnequipItem(oBoots));
AssignCommand(oTarget, ActionUnequipItem(oGloves));
AssignCommand(oTarget, ActionUnequipItem(oHat));
AssignCommand(oTarget, ActionEquipItem(oNaked, INVENTORY_SLOT_CHEST));
if (GetTag(oBelt) != "GarterBelt") AssignCommand(oTarget, ActionUnequipItem(oBelt));
}