New Spawn Script LUA Event: hear_say

Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications

Moderator: Team Members

Post Reply
Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

New Spawn Script LUA Event: hear_say

Post by Jabantiz » Fri Sep 02, 2016 11:10 pm

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

tyrbo
Team Member
Posts: 271
Joined: Thu Feb 18, 2016 12:33 pm

Re: New Spawn Script LUA Event: hear_say

Post by tyrbo » Sat Sep 03, 2016 9:29 pm

You're on a roll, Jab

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: New Spawn Script LUA Event: hear_say

Post by Gangrenous » Mon Sep 05, 2016 5:56 pm

Oh hell, this could open up some things for me.....damn I am in the middle of doing spells too.
Resident Dirty Hippy

User avatar
Scribble
Team Member
Posts: 157
Joined: Wed Jun 22, 2016 5:30 am
EQ2Emu Server: Norrath Reborn
Characters: Scribe
Location: East Coast , USA
Contact:

Re: New Spawn Script LUA Event: hear_say

Post by Scribble » Tue Sep 06, 2016 6:14 am

Love this!
Follow me at https://twitter.com/EqIIEmulator
Like to keep up with news via Discordapp chat?

Join eq2emulator public discord at https://discord.gg/sCR4fPZ
Check me out on Twtich at https://www.twitch.tv/scribbleeq23

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: New Spawn Script LUA Event: hear_say

Post by Gangrenous » Tue Sep 06, 2016 5:21 pm

I could not figure out what the issue was getting this working, we might need to think about removing the hailed event.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New Spawn Script LUA Event: hear_say

Post by Jabantiz » Tue Sep 06, 2016 5:24 pm

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.

User avatar
Scribble
Team Member
Posts: 157
Joined: Wed Jun 22, 2016 5:30 am
EQ2Emu Server: Norrath Reborn
Characters: Scribe
Location: East Coast , USA
Contact:

Re: New Spawn Script LUA Event: hear_say

Post by Scribble » Tue Sep 06, 2016 5:36 pm

Can we not just hard code button h to mean /say hail?
Follow me at https://twitter.com/EqIIEmulator
Like to keep up with news via Discordapp chat?

Join eq2emulator public discord at https://discord.gg/sCR4fPZ
Check me out on Twtich at https://www.twitch.tv/scribbleeq23

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: New Spawn Script LUA Event: hear_say

Post by Gangrenous » Tue Sep 06, 2016 5:38 pm

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.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New Spawn Script LUA Event: hear_say

Post by Jabantiz » Tue Sep 06, 2016 6:48 pm

Scribble wrote:Can we not just hard code button h to mean /say hail?
This is client side so out of our control.

User avatar
Scribble
Team Member
Posts: 157
Joined: Wed Jun 22, 2016 5:30 am
EQ2Emu Server: Norrath Reborn
Characters: Scribe
Location: East Coast , USA
Contact:

Re: New Spawn Script LUA Event: hear_say

Post by Scribble » Tue Sep 06, 2016 7:00 pm

resolved, thanks though!
Follow me at https://twitter.com/EqIIEmulator
Like to keep up with news via Discordapp chat?

Join eq2emulator public discord at https://discord.gg/sCR4fPZ
Check me out on Twtich at https://www.twitch.tv/scribbleeq23

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: New Spawn Script LUA Event: hear_say

Post by Gangrenous » Wed Sep 07, 2016 8:43 am

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
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: New Spawn Script LUA Event: hear_say

Post by Gangrenous » Wed Sep 07, 2016 8:45 am

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
Resident Dirty Hippy

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest