Skip to content

Commit

Permalink
Added docs and entry in uo.em
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenblit committed Feb 27, 2021
1 parent 39e9ca8 commit 977c620
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/docs.polserver.com/pol100/corechanges.xml
Expand Up @@ -8,6 +8,10 @@
<entry>
<date>02-27-2021</date>
<author>Nando:</author>
<change type="Added">Parameter &quot;evmask&quot; to EnableEvents(ev, range := -1, evmask := EVMASK_ALL).<br/>
The allowed values are EVMASK_PC, EVMASK_NPC, or EVMASK_ALL.<br/>
When set, an NPC or Item will only receive entered/leftarea events caused by a PC, NPC or all mobiles (the default behavior).<br/>
This parameter is useful, for example, to decrease the load when there are too many NPCs in the same area.</change>
<change type="Added">Default mimetypes for .png, .js and .ico in the internal webserver</change>
<change type="Added">Allow URLs/filenames with a hyphen (-) in the internal webserver</change>
<change type="Fixed">Crash in SendPacket(), packet.SendPacket() and DisconnectClient() when the client was not yet logged in. Mostly affects packet hooks.</change>
Expand Down
8 changes: 7 additions & 1 deletion docs/docs.polserver.com/pol100/uoem.xml
Expand Up @@ -205,6 +205,10 @@
<constant>const ACTION_DIR_BACKWARD := 1;</constant>
<constant>const ACTION_NOREPEAT := 0;</constant>
<constant>const ACTION_REPEAT := 1;</constant>
<constant>// Masks for EnableEvents()</constant>
<constant>const EVMASK_ALL := 0;</constant>
<constant>const EVMASK_ONLY_PC := 1;</constant>
<constant>const EVMASK_ONLY_NPC := 2;</constant>
<constant>//CanWalk</constant>
<constant>const CANWALK_DIR := -1;</constant>
<constant>//UpdateMobile</constant>
Expand Down Expand Up @@ -2171,9 +2175,10 @@ const CRMULTI_FACING_WEST := 0x0300;</code></explain>
</function>

<function name="EnableEvents">
<prototype>EnableEvents( eventtype, range := -1 )</prototype>
<prototype>EnableEvents( eventtype, range := -1, evmask := EVMASK_ALL )</prototype>
<parameter name="eventtype" value="Integer" />
<parameter name="range" value="Integer (optional, 0..32)" />
<parameter name="evmask" value="Integer"
<explain>Enables events specified. When enabled events occur, they will be placed on the
script's event queue, and must be read with wait_for_event. Events that were
previously enabled will remain enabled. </explain>
Expand All @@ -2182,6 +2187,7 @@ const CRMULTI_FACING_WEST := 0x0300;</code></explain>
it first.</explain>
<explain>This function is useful only to NPCs and Items that have called RegisterForSpeechEvents.</explain>
<explain>Range is only used for certain events (currently speech, and entered/leftarea events)</explain>
<explain>Evmask is used to receive entered/leftarea caused only by PCs, NPCs, or both (the default)</explain>
<return>Integer new event "mask" on success</return>
<error>"Invalid parameter"</error>
</function>
Expand Down
4 changes: 4 additions & 0 deletions pol-core/doc/core-changes.txt
@@ -1,5 +1,9 @@
-- POL100 --
02-27-2021 Nando:
Added: Parameter "evmask" to EnableEvents(ev, range := -1, evmask := EVMASK_ALL).
The allowed values are EVMASK_PC, EVMASK_NPC, or EVMASK_ALL.
When set, an NPC or Item will only receive entered/leftarea events caused by a PC, NPC or all mobiles (the default behavior).
This parameter is useful, for example, to decrease the load when there are too many NPCs in the same area.
Added: Default mimetypes for .png, .js and .ico in the internal webserver
Added: Allow URLs/filenames with a hyphen (-) in the internal webserver
Fixed: Crash in SendPacket(), packet.SendPacket() and DisconnectClient() when the client was not yet logged in. Mostly affects packet hooks.
Expand Down
7 changes: 6 additions & 1 deletion pol-core/support/scripts/uo.em
Expand Up @@ -215,6 +215,11 @@ const ACTION_DIR_BACKWARD := 1;
const ACTION_NOREPEAT := 0;
const ACTION_REPEAT := 1;

// Masks for EnableEvents()
const EVMASK_ALL := 0;
const EVMASK_ONLY_PC := 1;
const EVMASK_ONLY_NPC := 2;

//CanWalk
const CANWALK_DIR := -1;

Expand Down Expand Up @@ -277,7 +282,7 @@ DisableEvents( eventtype ); // eventtype combination of constants from SYSEV
DisconnectClient( character );
Distance( obj1, obj2 );
DistanceEuclidean( obj1, obj2 );
EnableEvents( eventtype, range := -1); // eventtype combination of constants from SYSEVENT.INC
EnableEvents( eventtype, range := -1, evmask := EVMASK_ALL ); // eventtype combination of constants from SYSEVENT.INC
EnumerateItemsInContainer( container, flags := 0 );
EnumerateOnlineCharacters();
EquipFromTemplate( character, template ); // reads from equip.cfg
Expand Down

0 comments on commit 977c620

Please sign in to comment.