LUA spawnscript rage mode

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

Moderator: Team Members

Post Reply
Durge
Posts: 94
Joined: Sun Jan 03, 2010 11:45 am

LUA spawnscript rage mode

Post by Durge » Sat Jul 14, 2012 8:42 am

I honestly don't know if I'm being retarded and missing something or what.

NPC

Code: Select all

--[[
	Halt NPC
	By Durge
--]]

local intro = 500

function spawn(NPC)
end

function respawn(NPC)
	spawn(NPC)
end

function hailed(NPC, Player)
	FaceTarget(NPC, Player)
	conversation = CreateConversation()
	
	if GetQuestStep(Player, intro) == 4 then
		OnQuest(NPC, Player, conversation)
	else
		Say(NPC, "Hello " .. GetName(Player) .. ".")
	end
end

function OnQuest(NPC, Player, conversation)
	FaceTarget(NPC, Player)
	
	AddConversationOption(conversation, "Hello Halt.", "Dialog_1_1")
	StartConversation(conversation, NPC, Player, "Hello there " .. GetName(Player) .. ", I am Halt O'Carrick.")
end

function Dialog_1_1(NPC, Player)
	FaceTarget(NPC, Player)
	conversation = CreateConversation()
	
	AddConversationOption(conversation, "Wow, you guys sound impressive.", "Dialog_1_2")
	AddConversationOption(conversation, "I don't see what's so great, you guys seem to be away from the combat a lot of the time.", "Dialog_2_1")
	StartConversation(conversation, NPC, Player, "I'm sure they have told you about me, of my grim faceand sarcastic joking. I liked the old days when they were younger and more innocent, I could get away with so much more, especially Horace; I really got him with that short skirt joke. Anyway, I am one of the King's Rangers; Crowley and I reformed it after a bad stretch. You most likely have heard of me from the first war against Morgarath, when I lead the cavalry troop against his Wargals and instilled the fear of horses. Us rangers are known for our quick thinking, accuracy, and obesession of coffee, as I'm sure Will mentioned. A lot of people also think we are sorcerers, as our cloaks render us almost completely invisible when camouflaged against the forest background.")
end

function Dialog_1_2(NPC, Player)
	FaceTarget(NPC, Player)
	SetStepComplete(Player, intro, 4)
	
	Say(NPC, "Thank you, we try our best to serve our kingdom, in any way possible.")
end

function Dialog_2_1(NPC, Player)
	FaceTarget(NPC, Player)
	SetStepComplete(Player, intro, 4)
	
	Say(NPC, "I assume you didn't hear about the baron that got thrown into his own moat, I can just as easily throw you overboard.")
end
Quest

Code: Select all

--[[
	Introduction to Server Quest
	By Durge
--]]

function Accepted(Quest, NPC, Player)
	Say(NPC, "Of course, I hope you enjoy your stay")
end

function Declined(Quest, NPC, Player)
end

function Init(Quest)
	AddQuestStepChat(Quest, 1, "Talk to Alyss and listen to her story.", 1, "I need to go and talk to Alyss and listen to her story.", 0, 10010001)
	AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_Alyss")
end
	
function Step1_Complete_Alyss(Quest, NPC, Player)
	UpdateQuestTaskGroupDescription(Quest, 1, "I have listened to Alyss.")
	UpdateQuestStepDescription(Quest, 1, "I have listened to Alyss.")
	
	AddQuestStepChat(Quest, 2, "Now go talk to Will and listen to him.", 1, "Now I need to go talk and listen to Will.", 0, 10010002)
	AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_Will")
end

function Step2_Complete_Will(Quest, NPC, Player)
	UpdateQuestTaskGroupDescription(Quest, 2, "I have listened to Will.")
	UpdateQuestStepDescription(Quest, 2, "I have listened to Will.")
	
	AddQuestStepChat(Quest, 3, "Now go talk to Horace and listen to him.", 1, "Now I need to go talk and listen to Horace.", 0, 10010003)
	AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_Horace")
end

function Step3_Complete_Horace(Quest, NPC, Player)
	UpdateQuestTaskGroupDescription(Quest, 3, "I have listened to Horace.")
	UpdateQuestStepDescription(Quest, 3, "I have listened to Horace.")
	
	AddQuestStepChat(Quest, 4, "Now go talk to Halt and listen to him.", 1, "Now I need to go talk and listen to Halt.", 0, 10010004)
	AddQuestStepCompleteAction(Quest, 4, "Step4_Complete_Halt")
end

function Step4_Complete_Halt(Quest, NPC, Player)
	UpdateQuestTaskGroupDescription(Quest, 4, "I have listened to Halt.")
	UpdateQuestStepDescription(Quest, 4, "I have listened to Halt.")
	
	AddQuestStepChat(Quest, 5, "Return to Vorlok and speak with him.", 1, "Return to Vorlok and speak with him about the crew.", 0, 10010000)
	AddQuestStepCompleteAction(Quest, 5, "Step5_Complete_Vorlok")
end

function Step5_Complete_Vorlok(Quest, NPC, Player)
	UpdateQuestTaskGroupDescription(Quest, 5, "I have reported back to Vorlok")
	UpdateQuestStepDescription(Quest, 5, "I have reported back to Vorlok")
	
	AddQuestStepCompleteAction(Quest, 5, "Quest_Complete")
end
function Quest_Complete(Quest, NPC, Player)
	UpdateQuestDescription(Quest, "I have listened and talked to all the crew members and now understand the lore of the server.")
	GiveQuestReward(Quest, Player)
end

function Reload(Quest, NPC, Player, Step)
	if Step == 1 then
		Step1_Complete_Alyss(Quest, NPC, Player)
	elseif Step == 2 then
		Step2_Complete_Will(Quest, NPC, Player)
	elseif Step == 3 then
		Step3_Complete_Horace(Quest, NPC, Player)
	elseif Step == 4 then
		Step4_Complete_Halt(Quest, NPC, Player)
	elseif Step == 5 then
		Step5_Complete_Vorlok(Quest, NPC, Player)
	else
		
	end
end
Image

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: LUA spawnscript rage mode

Post by John Adams » Sat Jul 14, 2012 9:26 am

Durge is saying the hailed "FaceTarget()" is not working on this NPC, when it works on all others. I tested this script on my world, and FaceTarget() works fine for me, so the script doesn't look wrong.

Any ideas?

Durge
Posts: 94
Joined: Sun Jan 03, 2010 11:45 am

Re: LUA spawnscript rage mode

Post by Durge » Sat Jul 14, 2012 3:38 pm

I got it fixed, for some reason the NPC himself was bugged as shit, idk what happened, but recreating the npc worked.
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests