mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-04 17:20:26 +00:00
Updated Lua Examples (markdown)
+13
-14
@@ -146,20 +146,6 @@ function event_timer(e)
|
|||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
This is an example of how to use get_characters_in_instance
|
|
||||||
```
|
|
||||||
function event_death_complete(e)
|
|
||||||
-- get the zone instance id
|
|
||||||
local instance_id = eq.get_zone_instance_id();
|
|
||||||
local charid_list = eq.get_characters_in_instance(instance_id);
|
|
||||||
-- Lua loop basics:
|
|
||||||
-- k = key which is generally the current index of the array, not used in this example
|
|
||||||
-- v = value for the current key, in this example it would be the character ID
|
|
||||||
for k,v in pairs(charid_list) do
|
|
||||||
eq.target_global("lockout_ikky_g1", "1", "H17", 0,v, 0);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
```
|
```
|
||||||
### Player
|
### Player
|
||||||
```
|
```
|
||||||
@@ -179,6 +165,19 @@ function event_click_door(e)
|
|||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
-- This is an example of how to use get_characters_in_instance
|
||||||
|
function event_death_complete(e)
|
||||||
|
-- get the zone instance id
|
||||||
|
local instance_id = eq.get_zone_instance_id();
|
||||||
|
local charid_list = eq.get_characters_in_instance(instance_id);
|
||||||
|
-- Lua loop basics:
|
||||||
|
-- k = key which is generally the current index of the array, not used in this example
|
||||||
|
-- v = value for the current key, in this example it would be the character ID
|
||||||
|
for k,v in pairs(charid_list) do
|
||||||
|
eq.target_global("lockout_ikky_g1", "1", "H17", 0,v, 0);
|
||||||
|
end
|
||||||
|
end
|
||||||
### Item
|
### Item
|
||||||
|
|
||||||
### Spell
|
### Spell
|
||||||
|
|||||||
Reference in New Issue
Block a user