Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::LUA

Quests::LUA Section regarding LUA scripts, help, questions, answers

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-14-2018, 03:43 PM
irongut_av's Avatar
irongut_av
Fire Beetle
 
Join Date: Sep 2018
Posts: 20
Default 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?
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:33 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3