Most "enterrange" events take a single argument, the range; such as the following from prisoner.m:
- Code: Select all
ONEVENT( enterrange , 0x01 )(object target)
{
if(hasObjVar(this, "isPrisoner"))
{
bark(this, "Quickly, I beg thee! Unlock my chains! If thou dost look at me close thou canst see them.");
}
return(0x01);
}
But others, and possibly i haven't looked hard enough to see if this preceding argument is present in other events as well, take an integer preceding the range. Fom towncrier.m:
- Code: Select all
ONEVENT( 400 , enterrange , 0x05 )(object target)
{
if(numInList(Q63X) < 0x01)
{
return(0x01);
}
string Q65L = Q63X[random(0x00, numInList(Q63X) - 0x01)];
faceHere(this, getDirectionInternal(getLocation(this), getLocation(target)));
bark(this, "Hear ye! Hear ye!");
bark(this, Q65L);
return(0x01);
}
And this one is especially confounding, gasspurt.m:
- Code: Select all
ONEVENT( 1000 , enterrange , 0x03 )(object target)
{
if(isPlayer(target))
{
object player = target;
location Q5IZ = getLocation(player);
location Q5FI = getLocation(this);
object Q4R7 = requestCreateObjectAt(0x11A6, Q5FI);
sfx(Q5FI, 0x0108, 0x0107);
}
return(0x01);
}
ONEVENT( 250 , enterrange , 0x01 )(object target)
{
if(isPlayer(target))
{
setPoisoned(target, 0x01);
attachScript(target, "poisoned");
}
return(0x01)}
ONEVENT( 1000 , enterrange , 0x01 )(object target)
{
if(isPlayer(target))
{
integer damage = random(0x01, 0x0A);
location Q5FI = getLocation(this);
object player = target;
location Q5IZ = getLocation(player);
doDamage(player, player, damage);
sfx(Q5IZ, 0x014C, 0x014C);
animateMobile(player, 0x14, 0x01, 0x01, 0x00, 0x00);
}
return(0x01)}
ONEVENT( 1000 , enterrange , 0x00 )(object target)
{
if(isPlayer(target))
{
integer damage = random(0x01, 0x1E);
location Q5IZ = getLocation(target);
object player = target;
doDamage(player, player, 0x1E);
sfx(Q5IZ, 0x014C, 0x014C);
setPoisoned(player, 0x01);
attachScript(player, "poisoned");
}
return(0x00)}
I'm guessing this has something to do with timing, either limits or delays, I'm betting that i's a delay (in ticks?) that the mobile has to stick around before it triggers, but I have some doubts.
Here's another that indicates that:
- Code: Select all
ONEVENT( 100 , enterrange , 0x01 )(object target)
{
if(hasObjVar(this, "isWaitingForEscort"))
{
bark(this, "I am waiting for my escort to " + Q4RI(Q4O8) + ". If thou art interested, check the local bulletin board for details, or just say 'I will take thee.'");
}
return(0x01)}