View Full Version : $combat_state not being set unless...
MNWatchdog
03-16-2010, 08:03 PM
$combat_state not being set unless you have a COMBAT_EVENT subroutine.
Without at least:
sub EVENT_COMBAT {
}
$combat_state doesn't get set to any value whatsoever.
I wanted to check combat status during a timer event, which is how I discovered this.
Just like any other event specific variable it is only exported for the event in question. Not really a bug; just how it works.
And the reason it works that way is there would be no way to export variables for events that don't trigger as we wouldn't know what the values were. Using these variables outside of the events they're called will cause undefined behavior.
trevius
03-17-2010, 03:17 AM
If you want to check if they are in combat, you can either use $npc->IsEngaged() or use the hatelist iterator from the example files in the /utils/examples/ folder.
MNWatchdog
03-17-2010, 06:10 AM
Thanks for the info. Will fix my script.
Travius, where can I find a list of all these $npc as well as all other quest usable variables?
trevius
03-17-2010, 04:25 PM
Quest objects are here:
http://www.eqemulator.net/wiki/wikka.php?wakka=QuestObjects
Normal quest commands are here:
http://www.eqemulator.net/wiki/wikka.php?wakka=QuestTutorial
The wiki has tons of great info if you know where to look or do searches for it.
The example list iterations can be found here as well:
http://code.google.com/p/projecteqemu/source/browse/trunk/EQEmuServer/utils/Examples/ListIteration.pl
I went ahead and added a page to the wiki for the List Iteration Examples. You can now get to it from the main quests page here:
http://www.eqemulator.net/wiki/wikka.php?wakka=CategoryQuests
MNWatchdog
03-18-2010, 01:30 AM
Thanks man!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.