Vendel wrote...
I have tried both having a plc and myself (PC) creating the effect, from a plc fired script.
It looks as though both the effect creator and target have to be creatures, based on teh quick test I just did. Make a test arget creature near the placeable, and feed their tag into this OnClick script to try it out:
void ArrowSpam (object oTarget, int nCount);
void main()
{
object oPC = GetPlaceableLastClickedBy();
AssignCommand (oPC, ArrowSpam (GetObjectByTag ("TARGET_TAG_HERE"), d20 (5) ));
}
void ArrowSpam (object oTarget, int nCount)
{
if (nCount < 1) nCount = 1;
int i;
float fDelay;
effect eArrow = EffectVisualEffect(357); // NORMAL_ARROW
for (i; i < nCount; i ++)
{
DelayCommand (fDelay, ApplyEffectToObject (DURATION_TYPE_TEMPORARY, eArrow, oTarget, 5.0) );
fDelay += 0.25;
}
}
Edit: That will also work as DURATION_TYPE_INSTANT. I switched it to temporary when I was trying to figure out why the arrow just appeared on the PC then disappeared again right after, without "launching".
Modifié par Failed.Bard, 13 novembre 2011 - 02:03 .