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

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

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 12-14-2018, 04:52 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

It would be e.joined

https://github.com/EQEmu/Server/wiki...ser#npc-events has the entries into the event table listed.
Reply With Quote
  #3  
Old 12-14-2018, 09:02 PM
irongut_av's Avatar
irongut_av
Fire Beetle
 
Join Date: Sep 2018
Posts: 20
Default

Thanks for the link
Reply With Quote
Reply


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 10:50 PM.


 

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