Page 1 of 1

New Spawn Script LUA Event: hear_say

Posted: Fri Sep 02, 2016 11:10 pm
by Jabantiz

Code: Select all

function hear_say(NPC, Spawn, Msg)
	Say(NPC, GetName(Spawn) .. " says: " .. Msg)
end
Triggered whenever a player uses /say and has a spawn targeted

Re: New Spawn Script LUA Event: hear_say

Posted: Sat Sep 03, 2016 9:29 pm
by tyrbo
You're on a roll, Jab

Re: New Spawn Script LUA Event: hear_say

Posted: Mon Sep 05, 2016 5:56 pm
by Gangrenous
Oh hell, this could open up some things for me.....damn I am in the middle of doing spells too.

Re: New Spawn Script LUA Event: hear_say

Posted: Tue Sep 06, 2016 6:14 am
by Scribble
Love this!

Re: New Spawn Script LUA Event: hear_say

Posted: Tue Sep 06, 2016 5:21 pm
by Gangrenous
I could not figure out what the issue was getting this working, we might need to think about removing the hailed event.

Re: New Spawn Script LUA Event: hear_say

Posted: Tue Sep 06, 2016 5:24 pm
by Jabantiz
Gangrenous wrote:we might need to think about removing the hailed event.
Not going to happen for the official emu server. All you need to do is target the mob and /say something, hailed is on a different channel then /say so if you wanted to run up and hit h this won't work.

Re: New Spawn Script LUA Event: hear_say

Posted: Tue Sep 06, 2016 5:36 pm
by Scribble
Can we not just hard code button h to mean /say hail?

Re: New Spawn Script LUA Event: hear_say

Posted: Tue Sep 06, 2016 5:38 pm
by Gangrenous
Jabantiz wrote:
Gangrenous wrote:we might need to think about removing the hailed event.
Not going to happen for the official emu server. All you need to do is target the mob and /say something, hailed is on a different channel then /say so if you wanted to run up and hit h this won't work.
Yeah after doing some testing I see that, hail is rather hard coded. But if you do /say hail it works fine.

Re: New Spawn Script LUA Event: hear_say

Posted: Tue Sep 06, 2016 6:48 pm
by Jabantiz
Scribble wrote:Can we not just hard code button h to mean /say hail?
This is client side so out of our control.

Re: New Spawn Script LUA Event: hear_say

Posted: Tue Sep 06, 2016 7:00 pm
by Scribble
resolved, thanks though!

Re: New Spawn Script LUA Event: hear_say

Posted: Wed Sep 07, 2016 8:43 am
by Gangrenous
Jabantiz did something great here. It is the small things that can make a huge difference. You made my quest 100 times simpler and more fitted for my server. I figured out how to get rid of the hail event and remap it, it was super simple. The bigger thing you did though was make my life easier. I cannot stand the design of the quest system as it was, sorry but I did not like it. Too many places to have things, the database, lua, etc. Then having a quest lua and your spawn script lua, too much for me to make one quest. So I introduce EQEmu style questing, brought to you buy Jabantiz's changes...

Code: Select all

--[[
	Script Name:	Rations for the Ardent Needle
	Script Purpose:	SpawnScripts/antonica/CaptainEitoa.lua
	Script Author:	Provocating
	Script Date:	2016.07
	NPC ID:			120233
	Zone:			Antonica
	Preceded By:	
	Followed By:	
--]]

function respawn(NPC, Player)
	spawn(NPC)
end

function hear_say(NPC, Player, Msg)
	Msg = string.lower(Msg)
	if Msg == "hail" then
		Say(NPC, "Hello stranger, are you [new] to these parts?")
	elseif string.match(Msg, "new") then
		Say(NPC, "Well I will be on duty a while and our Eastern outpost is running out of rations. I know you are new to these parts but if you can [deliver] these rations to the Ardent Needle Keep, I would be in your debt!")
	elseif string.match(Msg, "deliver") then
		Say(NPC, "The Ardent Needle keep is to the NorthEast of us. This winding road runs by the keep. Take this crate of rations to Watchman Loxley, be very careful and do not leave the trail!")

		if not (HasItem(Player, 1000311)) then
			SummonItem(Player, 1000311, 1) -- Crate of Supplies
		end
	end
end

Re: New Spawn Script LUA Event: hear_say

Posted: Wed Sep 07, 2016 8:45 am
by Gangrenous
Of course, there is a return trip and such to finish the one I pasted, and formatting does not convert over well, looks perfect in Notepad++ on my screen. You get the idea