EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::LUA (https://www.eqemulator.org/forums/forumdisplay.php?f=680)
-   -   Using the Lua event_hate_list (https://www.eqemulator.org/forums/showthread.php?t=42205)

irongut_av 12-14-2018 03:43 PM

Using the Lua event_hate_list
 
I thought I'd share this snippet of code to help anyone struggling with the hatelist and event_hate_list in lua

Code:

function event_hate_list(e)
 
    local hate_list = e.self:GetHateList().entries

  if(hate_list == nil) then
    e.self:Shout("hate_list is nil")
    return;
  else
    e.self:Shout("hate_list is OK")
  end
 
  for hate_entry in hate_list do
    local hate_entry_mob = hate_entry.ent -- C++ Lua_HateEntry::GetEnt is bound to 'ent' property
    local hate_value = hate_entry.hate
    e.self:Shout("Hate list includes " .. hate_entry_mob:GetCleanName() .. " who has a hate value of ".. hate_value )
  end

end

Also a question: how do I get the lua equivalent of Perl $hate_state?

demonstar55 12-14-2018 04:52 PM

It would be e.joined

https://github.com/EQEmu/Server/wiki...ser#npc-events has the entries into the event table listed.

irongut_av 12-14-2018 09:02 PM

Thanks for the link


All times are GMT -4. The time now is 03:52 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.