Mephisto Gladius wrote...
Again, I got the same error. Script still firing 3 times...
How about...
void main()
{
object oItem;
object oTarget;
object oPC;
location lTarget;
object oSpawn;
int nInt;
effect eEffect;
oPC = GetItemActivator();
if (GetLocalInt(oPC, "axs_merca")== 1)
{
if (GetLocalInt(oPC, "axs_merc")== 3)
{
oTarget=GetHenchman(oPC);
RemoveHenchman(oPC, oTarget);
eEffect = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
oTarget=GetHenchman(oPC);
RemoveHenchman(oPC, oTarget);
eEffect = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
oTarget=GetHenchman(oPC);
RemoveHenchman(oPC, oTarget);
eEffect = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
nInt = GetLocalInt(oPC, "axs_merca");
nInt -= 1;
SetLocalInt(oPC, "axs_merca", nInt);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1), GetLocation(oPC));
CreateItemOnObject("axs_mercr3", oPC, 1);
FloatingTextStringOnCreature("Mercenary Stored", oPC);
}
else if (GetLocalInt(oPC, "axs_merc")== 2)
{
oTarget=GetHenchman(oPC);
RemoveHenchman(oPC, oTarget);
eEffect = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
oTarget=GetHenchman(oPC);
RemoveHenchman(oPC, oTarget);
eEffect = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
nInt = GetLocalInt(oPC, "axs_merca");
nInt -= 1;
SetLocalInt(oPC, "axs_merca", nInt);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1), GetLocation(oPC));
FloatingTextStringOnCreature("Mercenary Stored", oPC);
CreateItemOnObject("axs_mercr2", oPC, 1);
}
else if (GetLocalInt(oPC, "axs_merc")==1)
{
oTarget=GetHenchman(oPC);
RemoveHenchman(oPC, oTarget);
eEffect = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
nInt = GetLocalInt(oPC, "axs_merca");
nInt -= 1;
SetLocalInt(oPC, "axs_merca", nInt);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1), GetLocation(oPC));
FloatingTextStringOnCreature("Mercenary Stored", oPC);
CreateItemOnObject("axs_mercr1", oPC, 1);
}
return;
}
if (GetLocalInt(oPC, "axs_merca")== 0)
{
if (GetItemPossessedBy(oPC, "axs_mercr3")!= OBJECT_INVALID)
{
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "mercenario", lTarget);
oTarget = GetObjectByTag("mercenario");
AddHenchman(oPC, oTarget);
nInt = GetLocalInt(oPC, "axs_merca");
nInt += 1;
SetLocalInt(oPC, "axs_merca", nInt);
oItem = GetItemPossessedBy(oPC, "axs_mercr3");
DestroyObject(oItem);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1), GetLocation(oPC));
FloatingTextStringOnCreature("Mercenary Restored", oPC);
return;
}
else if (GetItemPossessedBy(oPC, "axs_mercr2")!= OBJECT_INVALID)
{
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "mercenario", lTarget);
oTarget = GetObjectByTag("mercenario");
AddHenchman(oPC, oTarget);
nInt = GetLocalInt(oPC, "axs_merca");
nInt += 1;
SetLocalInt(oPC, "axs_merca", nInt);
oItem = GetItemPossessedBy(oPC, "axs_mercr2");
DestroyObject(oItem);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1), GetLocation(oPC));
FloatingTextStringOnCreature("Mercenary Restored", oPC);
return;
}
else if (GetItemPossessedBy(oPC, "axs_mercr1")!= OBJECT_INVALID)
{
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "mercenario", lTarget);
oTarget = GetObjectByTag("mercenario");
AddHenchman(oPC, oTarget);
nInt = GetLocalInt(oPC, "axs_merca");
nInt += 1;
SetLocalInt(oPC, "axs_merca", nInt);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1), GetLocation(oPC));
oItem = GetItemPossessedBy(oPC, "axs_mercr1");
DestroyObject(oItem);
FloatingTextStringOnCreature("Mercenary Restored", oPC);
}
}
}
Modifié par Redunct, 01 septembre 2010 - 01:57 .





Retour en haut






