View Single Post
  #1  
Old 08-24-2018, 10:12 PM
deciferous7
Fire Beetle
 
Join Date: Oct 2016
Posts: 2
Default How to have the mob recognize your position.

This is a Dragon of Norrath raid mob.


Looking for information on how to make this mob cast its spell "Blinding Light" only when the client is facing towards him. My example here does not work. Does anyone know the correct method of achieving this?

Blind_Cast is what I'm looking for.

Code:
function event_timer(e)
    if (e.timer == "Emote") then
        index = math.random(1, table.getn(rikkukin_emote));
        e.self:Emote(rikkukin_emote[index][1]);
    elseif (e.timer == "Casting") then
		e.self:Emote(rikkukin_emote[index][2]);
		e.self:CastSpell(rikkukin_emote[index][3], e.self:GetTarget():GetID());
		eq.set_timer("Casting", 30000);
	elseif (e.timer == "Locked_HP") then
		eq.stop_timer('Locked_HP');
		eq.set_timer("Blind", blind_timer * 1000);
		eq.set_timer("Blind_Cast", blind_cast * 1000);
		e.self:TempName("Rikkukin the Defender");
		hp=false;
		eq.set_next_hp_event(30);
	elseif (e.timer == "Locked_HPtwo") then
		eq.stop_timer('Locked_HPtwo');
		e.self:TempName("Rikkukin the Defender");
		hptwo=false;
	elseif (e.timer == "Blind") then
		e.self:Emote("twists his body so that the ambient light starts to reflect from his slivery scales.");
	elseif (e.timer == "Blind_Cast") then
		local cl = eq.get_entity_list():GetClientList();
		for client in cl.entries do
			if (client.valid and not client:BehindMob(e.self, client:GetX(), client:GetY())) then
			e.self:CastSpell(6556, client:GetID());
			end
		end
		eq.set_timer("Blind_Cast", 40000);
	end
end
Thanks!
Reply With Quote