Files
HeroesStone_PRC8/_module/nss/mali_dm_paa_tool.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

30 lines
1.0 KiB
Plaintext

void main()
{
object oItemUser = OBJECT_SELF;
object oTarget = GetSpellTargetObject();
location lTarget = GetSpellTargetLocation();
// Display error message if used on something other than placeable or ground
if( (GetIsObjectValid(oTarget)) && (GetObjectType(oTarget) != OBJECT_TYPE_PLACEABLE))
{ SendMessageToPC(oItemUser, "ERROR: Placeable Attitude Adjuster may only be used on placeables.");
return;
}
if( !GetIsObjectValid(oTarget) )
{ oTarget = GetNearestObjectToLocation(OBJECT_TYPE_PLACEABLE, lTarget, 1); }
if( !GetIsObjectValid(oTarget) )
{ SendMessageToPC(oItemUser, "ERROR: No placeables in target area.");
return;
}
// Pass information as local variables on user
SetLocalObject(oItemUser, "DM_PAA_oTarget", oTarget);
SetLocalLocation(oItemUser, "DM_PAA_lTarget", lTarget);
// Initiate conversation tree
string sConversationName = "mali_dm_paa";
AssignCommand( oItemUser, ActionStartConversation( oItemUser, sConversationName, TRUE, FALSE));
}