Advertisement
sorvani

#Tunare.lua

Mar 7th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. -- #Tunare NPCID: 127098
  2. -- This is Tunare out in the middle of the zone
  3. function event_combat(e)
  4.     if (e.joined) then
  5.         call_zone_to_assist(e.other);
  6.     end
  7. end
  8.  
  9. function call_zone_to_assist(e_other)
  10.     -- grab the entity list
  11.     local entity_list = eq.get_entity_list();
  12.     -- aggro the zone onto whoever attacked me.
  13.     -- do not aggro these mobs
  14.     local exclude_npc_list = Set {127001,127004,127097,127098,127105};
  15.     for i = 127000, 127999, 1 do
  16.         -- if the current NPCID is not in the exclude list add the client to their hate list.
  17.         if (exclude_npc_list[i] == nil) then
  18.             local npc = entity_list:GetNPCByNPCTypeID(i);
  19.             -- npc.valid will be true if the NPC is actually spawned
  20.             if (npc.valid) then
  21.                 npc:AddToHateList(e_other,1);
  22.             end
  23.         end
  24.     end
  25. end
  26.  
  27. -- Set function example from Programming In Lua
  28. -- http://www.lua.org/pil/11.5.html
  29. function Set (list)
  30.   local set = {}
  31.   for _, l in ipairs(list) do set[l] = true end
  32.   return set
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement