first spawn script

Discussions of the design and development of in-game content.

Moderator: Team Members

Post Reply
geordie0511
Team Member
Posts: 19
Joined: Sun Mar 10, 2019 1:14 am

first spawn script

Post by geordie0511 » Wed Mar 13, 2019 12:06 am

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 ?

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

Re: first spawn script

Post by Jabantiz » Wed Mar 13, 2019 4:10 am

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.

geordie0511
Team Member
Posts: 19
Joined: Sun Mar 10, 2019 1:14 am

Re: first spawn script

Post by geordie0511 » Wed Mar 13, 2019 4:15 am

Tried these commands yesterday but they didn't change anything

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

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

Re: first spawn script

Post by Gangrenous » Wed Mar 13, 2019 5:56 am

Good Job!
Resident Dirty Hippy

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest