Henchman control
Severum
Member Posts: 16
Hello
I'm working on the henchman control and like add new functions to the script created by Numos.
I want that summoned open and close doors and disarm traps.
But not accept ActionUnlockObject or other...
void main()
{
object oUser = OBJECT_SELF;
//SendMessageToPC(oUser, "Player Tool 01 activated.");
object oTarget = GetSpellTargetObject();
location lTarget = GetSpellTargetLocation();
object oAssociate = GetLocalObject(oUser, "nu_minion");
if (oTarget == oUser)
{
object oMinion = GetFirstFactionMember(oUser, FALSE);
while (GetIsObjectValid(oMinion))
{
if (GetMaster(oMinion) == oUser)
{
AssignCommand(oMinion, ActionMoveToLocation(GetLocation(oUser)));
}
oMinion = GetNextFactionMember(oUser, FALSE);
}
SendMessageToPC(oUser, "El convocado va hasta tu posicion");
}
else if (GetIsObjectValid(oTarget) && GetMaster(oTarget) == oUser)
{
SetLocalObject(oUser, "nu_minion", oTarget);
SendMessageToPC(oUser, "Has seleccionado a " + GetName(oTarget));
}
else if (GetIsObjectValid(oTarget) && GetIsObjectValid(oAssociate) && GetMaster(oTarget) != oUser)
{
AssignCommand(oAssociate, ClearAllActions());
AssignCommand(oAssociate, ActionAttack(oTarget));
SendMessageToPC(oUser, "El convocado atacara " + GetName(oTarget));
}
else if (!GetIsObjectValid(oTarget) && GetIsObjectValid(oAssociate))
{
AssignCommand(oAssociate, ClearAllActions());
AssignCommand(oAssociate, ActionMoveToLocation(lTarget, TRUE));
SendMessageToPC(oUser, "El convocado se desplaza...");
}
else if (!GetIsObjectValid(oTarget) && GetIsObjectValid(oAssociate))
{
AssignCommand(oAssociate, ClearAllActions());
AssignCommand(oAssociate, ActionUnlockObject(oTarget, TRUE));
SendMessageToPC(oUser, "El convocado se desplaza");
}
else if (!GetIsObjectValid(oTarget) && GetIsObjectValid(oAssociate))
{
SendMessageToPC(oUser, "Lo siento esa funcion no esta disponible para el convocado");
}
else
{
SendMessageToPC(oUser, "Lo siento esa funcion no esta disponible para tus convocados");
}
}
Can someone help me?
0
Comments
A more general function is
which allows the use of lockpicks.
Works.
else if (GetObjectType (oTarget) == OBJECT_TYPE_DOOR)
AssignCommand (oAssociate, ClearAllActions ());
AssignCommand (oAssociate, ActionUseSkill (SKILL_OPEN_LOCK, oTarget, 0, oTool);