You just want to add a few lines to you item that sets the horse name to the rider's name and then disallow the mount script from firing.
#include "x2_inc_switches"
#include "x3_inc_horse"
void DoMount(object oHorse)
{
if ((GetIsObjectValid(oHorse) && (!HorseGetIsMounted(OBJECT_SELF))))
{
AssignCommand (OBJECT_SELF,HorseMount(oHorse,TRUE, TRUE, 0));
}
}
void main()
{
int nEvent = GetUserDefinedItemEventNumber();
object oItem = GetItemActivated();
object oPC = GetItemActivator();
object oHorse = HorseGetHorse(oPC,1);
string sRiderName = GetName (oPC,FALSE);
string sHorseName = (sRiderName);
if(((nEvent == X2_ITEM_EVENT_ACTIVATE) && (sRiderName == sHorseName)))
{
AssignCommand (oPC, DoMount(oHorse));
}
}
This would best be done when summoning the horse but since I don't have your script I just wrote up the above.
Of course the name check lines would have to be added to your mounting script.
Modifié par ffbj, 13 novembre 2011 - 06:15 .