Could do something kinda like so (this method skips the conversation though):
#include "zep_inc_phenos"
#include "x2_inc_switches"
void main()
{
int nEvent = GetUserDefinedItemEventNumber();
if (nEvent != X2_ITEM_EVENT_ACTIVATE) return;
object oPC = GetItemActivator();
int nMount = nCEP_PH_HORSE_BLACK;
int iMounted = GetLocalInt(oPC, "Mounted");
if (iMounted == 0)
{
zep_Mount(oPC, OBJECT_INVALID, nMount);
SetLocalInt(oPC, "Mounted", 1);
}
else
{
zep_Dismount(oPC);
SetLocalInt(oPC, "Mounted", 0);
}
}
Hope that works for ya.
P.S. - Not sure if this is a specific CEP widget that you are using of if you are makine your own but the way I do this is to give all the different colored horse widets the same tag so you only need one script. I just put an int variable on each item that indicated which horse will be summoned/mounted when the item is activated. Same script as above with a little change:
#include "zep_inc_phenos"
#include "x2_inc_switches"
void main()
{
int nEvent = GetUserDefinedItemEventNumber();
if (nEvent != X2_ITEM_EVENT_ACTIVATE) return;
object oPC = GetItemActivator();
object oItem = GetItemActivated(); int nMount = GetLocalInt(oItem, "MOUNT_TYPE"); int iMounted = GetLocalInt(oPC, "Mounted");
if (iMounted == 0)
{
zep_Mount(oPC, OBJECT_INVALID, nMount);
SetLocalInt(oPC, "Mounted", 1);
}
else
{
zep_Dismount(oPC);
SetLocalInt(oPC, "Mounted", 0);
}
}
Modifié par GhostOfGod, 30 janvier 2013 - 11:10 .