Moderator: MacroQuest Developers
Code: Select all
// $target(light)
} else if (!strncmp("target(light)",szVar,13)) {
i+=12;
if (!pTarget) {
strcat(szOutput,"NONE");
j+=7;
} else {
PCHAR szLight = GetLightForSpawn(pTarget);
strcat(szOutput,szLight);
j+=strlen(szLight);
}
Code: Select all
PCHAR GetLightForSpawn(PSPAWNINFO pSpawn)
{
BYTE Light = pSpawn->Light;
if (Light>LIGHT_COUNT) Light=0;
return szLights[Light];
}
Code: Select all
PCHAR szLights[] = {
"NONE", // 0 - No light
"CDL", // 1 - Candle
"TR", // 2 - Torch
"TGS", // 3 - Tiny Glowing Skull
"SL", // 4 - Small Lantern
"SoM", // 5 - Stein of Moggok
"LL", // 6 - Large Lantern
"FL", // 7 - Flameless lantern, Halo of Light
"GOS", // 8 - Globe of stars
"LG", // 9 - Light Globe
"LS", // 10 - Lightstone, Burnt-out lightstone, wispstone
"GLS", // 11 - Greater lightstone
"FBE", // 12 - Fire Beatle Eye, Firefly Globe
"CL" // 13 - Coldlight
};
Amadeus wrote:This is a good point ...also one of the shawl quests involves a glowing bile in GD that I once tried to figure out the light # for and wasn't very lucky with it :)

it always shows none on yourself, but if another character has something, it will show it.Glasscoin wrote:Anyone else have this problem?
/echo $target(light) will return NONE, no matter what. Even if I have a GLS equipped, no dice. Still returns NONE. Any suggestions? (Yes, I have dynamic lighting on.)
Code: Select all
#turbo 72
Sub Main
/varset l0 $id(0)
/varset l1 0
/varset l2 0
/echo Scanning all zone spawns for light, please wait ...
:Loop
/varadd l1 1
/if "$spawn($l0,light)"!="NONE" {
/echo Light: [$l0] [$spawn($l0,light)] $spawn($l0,name)
/varadd l2 1
} else {
| /echo NoLight: [$l0] [$spawn($l0,light)] $spawn($l0,name)
}
/varset l0 $spawn($l0,next)
/delay 0
/if $l0>0 /goto :Loop
/echo Scanned $int($l1) spawns, $int($l2) had lightsources and $int($calc($l1-$l2)) did not.
/return