Page 1 of 1

first spawn script

Posted: Wed Mar 13, 2019 12:06 am
by geordie0511
Yesterday I created my first spawn script and the corrsponding quest.
Here it is:

Code: Select all

--[[
	Script Name	: SpawnScripts/Antonica/FarmerWalcott.lua
	Script Purpose	: Farmer Walcott 
	Script Author	: geordie0511
	Script Date	: 2019.03.12
	Script Notes	: Auto-Generated Conversation from PacketParser Data
--]]

local ThereMite = 458

function spawn(NPC)
	ProvidesQuest(NPC, ThereMite)    
end

function respawn(NPC)
	spawn(NPC)
end

function InRange(NPC, Spawn)
end

function LeaveRange(NPC, Spawn)
end

function hailed(NPC, Spawn)
	FaceTarget(NPC, Spawn)
	conversation = CreateConversation()

	PlayFlavor(NPC, "voiceover/english/farmer_walcott/antonica/farmerwalcott000.mp3", "", "", 1905672247, 2052203858, Spawn)
		AddConversationOption(conversation, "Sounds like you need a beetle charmer. ", "dlg_1_1")
		AddConversationOption(conversation, "I found this map on a gnoll. ")
		AddConversationOption(conversation, "I am sorry I cannot help you. Farewell.")
	StartConversation(conversation, NPC, Spawn, "Oh! My poor crops! What will I do with all these ravenous beetles scurrying about?")
end

function dlg_1_1(NPC, Spawn)
	FaceTarget(NPC, Spawn)
	conversation = CreateConversation()

	PlayFlavor(NPC, "voiceover/english/farmer_walcott/antonica/farmerwalcott001.mp3", "", "", 2875116766, 2106137000, Spawn)
		AddConversationOption(conversation, "Then today is your lucky day. Here I am! ", "dlg_1_2")
		AddConversationOption(conversation, "If I see any I will send them your way. Farewell.")
	StartConversation(conversation, NPC, Spawn, "A beetle charmer would be grand -- if there were such a thing. I would be satisfied just hiring an adventurer to stomp a bunch of the beetles. Oh my poor barley!")
end

function dlg_1_2(NPC, Spawn)
	FaceTarget(NPC, Spawn)
	conversation = CreateConversation()

	PlayFlavor(NPC, "voiceover/english/farmer_walcott/antonica/farmerwalcott002.mp3", "", "", 1854564329, 3891746852, Spawn)
		AddConversationOption(conversation, "I will end your mite problems.", "Quest1")
	StartConversation(conversation, NPC, Spawn, "Thank the lost gods! I know you can't exterminate all these pests, but please do your best. I'll reward you with what I can. Don't worry, little barley ... help is on the way.")
end

function Quest1(NPC, Spawn)
	OfferQuest(NPC, Spawn, ThereMite)
end
The script is not loaded but also shows no obvious debug errors. Where is the fault ? Do I have to change any other undocumented errors in the database ?

Re: first spawn script

Posted: Wed Mar 13, 2019 4:10 am
by Jabantiz
The script looks fine to me at a glance, I also see no errors reported on the eq2db2 editor.

The hailed function is basic so you should get that when you hail the spawn. Did you "/reload spawnscripts" and "/reload spawns"? Do a "/luadebug start" first so you get any lua errors from the previous two commands.

Re: first spawn script

Posted: Wed Mar 13, 2019 4:15 am
by geordie0511
Tried these commands yesterday but they didn't change anything

Today it works for some reason... thanks, though

Re: first spawn script

Posted: Wed Mar 13, 2019 5:56 am
by Gangrenous
Good Job!