Difference between revisions of "LUA:AddSpawnIDAccess"

(Created page with "'''Explanation''' This function grants spawn access to a spawn, with every spawn in a zone with a certain spawn id. The third param (zone) is optional, if not set this function w...")
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''Explanation'''
+
{{LUAFunction
This function grants spawn access to a spawn, with every spawn in a zone with a certain spawn id. The third param (zone) is optional, if not set this function will use the zone of the spawn param.
+
|Name = AddSpawnIDAccess
<br>
+
|Description = This function grants spawns access to all spawns with the specified spawn id
'''Syntax'''<br>
+
|Param1 = Spawn
AddSpawnIDAccess([Spawn*] spawn, [int32] spawn_id, ([Zone*] zone))<br>
+
|Param1Desc = is the spawn we want to give access to
 
+
|Param2 = int32
'''Example'''
+
|Param2Desc = is the spawn id we want to be accessed
<pre>function hailed(NPC, Spawn)
+
|OptionalParam1 = Zone
 +
|OptionalParam1Desc = is the zone in which we want to allow access to the spawn id
 +
|Example =
 +
<pre>
 +
function hailed(NPC, Spawn)
 
     AddSpawnIDAccess(Spawn, 4700000)
 
     AddSpawnIDAccess(Spawn, 4700000)
 
end
 
end
 
</pre>
 
</pre>
 
+
|ExampleDesc = When this function is called, the Spawn that hailed NPC will be granted access to every spawn with the ID of 4700000 in their zone.
When this function is called, the Spawn that hailed NPC will be granted access to every spawn with the ID of 4700000 in their zone.
+
|Notes = If the optional param1 (zone) is not set, this function will use the zone of param1 (Spawn)
 
+
}}
 
 
 
 
 
 
[http://www.eq2emulator.net/wiki/index.php/LUA:MiscFunctions Back to Misc Functions]
 

Latest revision as of 12:14, 30 January 2021


LUA:AllFunctions - AddSpawnIDAccess

Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker


This function grants spawns access to all spawns with the specified spawn id

Syntax

AddSpawnIDAccess(param1, param2, [opt param1])

Parameters

Required - param1 (Spawn), param2 (int32)
param1 is the spawn we want to give access to
param2 is the spawn id we want to be accessed
Optional - opt param1 (Zone)
opt param1 is the zone in which we want to allow access to the spawn id

Example

function hailed(NPC, Spawn)
    AddSpawnIDAccess(Spawn, 4700000)
end

When this function is called, the Spawn that hailed NPC will be granted access to every spawn with the ID of 4700000 in their zone.

Notes

If the optional param1 (zone) is not set, this function will use the zone of param1 (Spawn)