Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- #_Tunare NPCID: 127001
- -- This is Tunare up in her tree.
- function event_combat(e)
- if (e.joined) then
- -- spawn #tunare to fight
- eq.spawn2(127098,0,0,-247,1609,-40,424);
- call_zone_to_assist(e.other);
- eq.depop_with_timer();
- end
- end
- function call_zone_to_assist(e_other)
- -- grab the entity list
- local entity_list = eq.get_entity_list();
- -- aggro the zone onto whoever attacked me.
- -- do not aggro these mobs
- local exclude_npc_list = Set {127001,127004,127097,127098,127105};
- for i = 127000, 127999, 1 do
- -- if the current NPCID is not in the exclude list add the client to their hate list.
- if (exclude_npc_list[i] == nil) then
- local npc = entity_list:GetNPCByNPCTypeID(i);
- -- npc.valid will be true if the NPC is actually spawned
- if (npc.valid) then
- npc:AddToHateList(e_other,1);
- end
- end
- end
- end
- -- Set function example from Programming In Lua
- -- http://www.lua.org/pil/11.5.html
- function Set (list)
- local set = {}
- for _, l in ipairs(list) do set[l] = true end
- return set
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement