I might be a little late but something like so perhaps?:
#include "zep_inc_phenos"
#include "x2_inc_switches"
void main()
{
int nEvent = GetUserDefinedItemEventNumber();
if (nEvent != X2_ITEM_EVENT_ACTIVATE) return;
effect eEffect;
object oPC = GetItemActivator();
object oItem = GetItemActivated();
int nMount = nCEP_PH_HORSE_BLACK;
int iMounted = GetLocalInt(oPC, "Mounted");
if (iMounted == 0)
{
zep_Mount(oPC, OBJECT_INVALID, nMount);
SetLocalInt(oPC, "Mounted", 1);
AssignCommand(oItem, ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectHaste(),oPC));
}
else
{
zep_Dismount(oPC);
SetLocalInt(oPC, "Mounted", 0);
eEffect = GetFirstEffect(oPC);
while (GetIsEffectValid(eEffect))
{
if (GetEffectCreator(eEffect)==oItem)
RemoveEffect(oPC, eEffect);
eEffect = GetNextEffect(oPC);
}
}
}
Modifié par GhostOfGod, 07 septembre 2013 - 11:17 .