How to look up NPC and Quest ID's

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

Moderator: Team Members

User avatar
Flunklesnarkin
Posts: 79
Joined: Thu Jul 12, 2012 2:53 pm

How to look up NPC and Quest ID's

Post by Flunklesnarkin » Wed Sep 02, 2015 5:06 pm

How do I look up NPC and Quest ID's?

I feel confident enough to write a quest script now if I can figure out how to look up the NPC and Quest ID's.


All of these commands are easy enough for me to understand: http://eq2emulator.net/wiki/index.php/L ... tFunctions and I see the examples of already written quests here: https://svn.eq2emulator.net/!/#eq2conte ... pts/Quests

I tried to get onto the eq2emu server today to look at some newbie zones and figure out a starting point but the server is down and I'm not sure how to get my private server running at this point, mysql may be out of my league but i've installed it and may keep banging my head on it later.

Ideally I'd like to pick a starting point in a zone that already has npc's but lacks quests but if it's not that difficult I can try to learn how to add npc's.

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

Re: How to look up NPC and Quest ID's

Post by Jabantiz » Wed Sep 02, 2015 8:57 pm

Sorry about the server being down, was some persistent issues that needed to be resolved before it could be brought back up again. The server is up now and hopefully everything is resolved.

As for getting a spawn id, in game the easiest way is to walk up to the spawn, target it, and type "/spawn details"

Quest id's you can't get until the quest is actually entered into the DB, I will have to get you set up with the web editor so you can add quests directly into the server and upload the quests. You can also look up spawn id's with the web editor but I personally find it easier to do it in game.

Also if you want a fully spawned zone with no scripts to work on then we have everfrost.

User avatar
Flunklesnarkin
Posts: 79
Joined: Thu Jul 12, 2012 2:53 pm

Re: How to look up NPC and Quest ID's

Post by Flunklesnarkin » Thu Sep 03, 2015 8:31 am

Ok.. I've started working on a simple quest to begin with.

I chose the quest Fish for Grunther to begin because it's a simple harvest and turn in quest. http://eq2.wikia.com/wiki/Fish_for_Grunthor


edit:

I thought about it and I think this might be a better option than the first script i put below:

http://pastebin.com/SkWyZ1qV

_____________________________________________________________________________

I started by adding some dialog options to the NPC Burm Grunther

If you want to double check my work and make recommendations here is the link.

Code: Select all

http://eq2emulator.net:9301/eq2db/editors/spawns.php?zone=41&type=npcs&id=410014&tab=spawn_scripts

Code: Select all

--[[
    Script Name    : SpawnScripts/Everfrost/BurmGrunthor.lua
    Script Author  : Flunklesnarkin
    Script Date    : 2015.09.03 10:09:57
    Script Purpose : 
                   : 
--]]

local Fish_For_Grunther = 136

function spawn(NPC)
	SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
	ProvidesQuest(NPC, Fish_For_Grunther)
end

function respawn(NPC)
end

function InRange(NPC, Spawn)
end

function LeaveRange(NPC, Spawn)
end

function hailed(NPC, Spawn)
    FaceTarget(NPC, Spawn)
	conversation = CreateConversation()
	if HasQuest(Spawn, Fish_For_Grunther) == false and HasCompletedQuest(Spawn, Fish_For_Grunther) == false then
             Quest1Chat_1(NPC, Spawn)
	elseif GetQuestStep(Spawn, Fish_For_Grunther) == 1 then 
             Quest1Chat_4(NPC, Spawn)
	elseif HasQuest(Spawn, Fish_For_Grunther) == false and HasCompletedQuest(Spawn, Fish_For_Grunther) == true then
             Quest1Chat_5(NPC, Spawn)
	end
end	

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

    AddConversationOption(conversation, "Oh?", "Quest1Chat_2")
    StartConversation(conversation, NPC, Spawn, "Arh! The fish just aren't biting!")
end

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

	AddConversationOption(conversation, "Perhaps I could fish some for you?", "Quest1Chat_3")
        AddConversationOption(conversation, "Sounds like you should work on your fishing skills.")
	StartConversation(conversation, NPC, Spawn, "Nay, I've been at it for hours, but nuthin'. And I've mouths to feed...")
end

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

	AddConversationOption(conversation, "Not to worry.", "Offer_Fish_For_Grunther")
	StartConversation(conversation, NPC, Spawn, "That'd truly be a blessing from the gods, thank ye.")
end

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

	AddConversationOption(conversation, "I do not.")
	StartConversation(conversation, NPC, Spawn, "Have ye the fish?")
end

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

	AddConversationOption(conversation, "I most certainly would.", "Quest1Chat_6")
        AddConversationOption(conversation, "Nah, I've got better things to do with my time.")
	StartConversation(conversation, NPC, Spawn, "I could always use some'mere fish if ye'd be up fer it.")
end

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

	AddConversationOption(conversation, "You're welcome.", "Offer_Fish_For_Grunther")
	StartConversation(conversation, NPC, Spawn, "A fine young adventurer ye be, thank ye.")
end




function Offer_Fish_For_Grunther(NPC, Spawn)
    if HasQuest(Spawn, Fish_For_Grunther) == false then
	    OfferQuest(NPC, Spawn, Fish_For_Grunther)
	end
end
One thing I'm not certain about is if I can add two functions to the AddConversationOption() function.

Like could i do something like this.

Code: Select all

AddConversationOption(conversation, "Perhaps I could fish some for you?", "Quest1Chat_3" , "Offer_Fish_For_Grunther")
Instead of having to put the offerquest in the next conversation block. In the live servers you click the dialog option and get the quest automatically then the additional conversation options can be ignored or clicked on if you choose. Not sure if that works here currently.

Ok, now that dialog options are there I'll see about a quest script.
Last edited by Flunklesnarkin on Thu Sep 03, 2015 12:08 pm, edited 8 times in total.

User avatar
Flunklesnarkin
Posts: 79
Joined: Thu Jul 12, 2012 2:53 pm

Re: How to look up NPC and Quest ID's

Post by Flunklesnarkin » Thu Sep 03, 2015 11:30 am

Ok, here is the quest script.

Code: Select all

http://eq2emulator.net:9301/eq2db/editors/quests.php?zone=Everfrost&id=136&tab=register

Code: Select all

--[[
    Script Name    : Quests/Everfrost/fish_for_grunthor.lua
    Script Author  : Flunklesnarkin
    Script Date    : 2015.09.03 12:09:31
    Script Purpose : 

        Zone       : Everfrost
        Quest Giver: Burm Grunthor
        Preceded by: None
        Followed by: None
--]]

function Init(Quest)
	AddQuestRewardCoin(Quest, math.random(5,90), math.random(27,80), 1, 0)
	AddQuestHarvest(Quest, 1, "I need to harvest a number of fish for Grunthor.", 10, 100, "I need to fish for Grunthor in Everfrost.", 0, 1)
	AddQuestStepCompleteAction(Quest, 1, "GatheredFish")
end


function Declined(Quest, QuestGiver, Player)
end

function Deleted(Quest, QuestGiver, Player)
end


function Accepted(Quest, QuestGiver, Player)
end


function GatheredFish(Quest, QuestGiver, Player)
    UpdateQuestStepDescription(Quest, 1, "I have harvested a number of fish for Grunther.")
	AddQuestStepChat(Quest, 2, "I should return these fish to Grunthor.", 1, "I should return these fish to Grunthor.", 0, 410014)
	AddQuestStepCompleteAction(Quest, 2, "CompleteQuest")
end

function CompleteQuest(Quest, QuestGiver, Player)
    GiveQuestReward(Quest, Player)
end

function Reload(Quest, QuestGiver, Player, Step)
    if Step == 1 then
	    GatheredFish(Quest, QuestGiver, Player)
	elseif Step == 2 then
	    CompleteQuest(Quest, QuestGiver, Player)
	end
end
I couldn't find the Reload() function in the lua function list but I copied the reload from a similar quest. I'm not sure if it's correct.

http://eq2emulator.net/wiki/index.php/LUA:AllFunctions


I don't know how to look up the Icon ID for the harvest step, parameter 7 of this function.

Code: Select all

AddQuestHarvest(Quest, 1, "I need to harvest a number of fish for Grunthor.", 10, 100, "I need to fish for Grunthor in Everfrost.", 0, 1)
I'm also not certain how to add the quest reward "a tiny barracuda plushie" into the database. http://eq2.wikia.com/wiki/A_tiny_barracuda_plushie

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: How to look up NPC and Quest ID's

Post by Zcoretri » Thu Sep 03, 2015 12:52 pm

Flunklesnarkin wrote:
I don't know how to look up the Icon ID for the harvest step, parameter 7 of this function.

Code: Select all

AddQuestHarvest(Quest, 1, "I need to harvest a number of fish for Grunthor.", 10, 100, "I need to fish for Grunthor in Everfrost.", 0, 1)
I know a backhanded way to find it, but Jabantiz probably has an easier way to find it.
I'm also not certain how to add the quest reward "a tiny barracuda plushie" into the database. http://eq2.wikia.com/wiki/A_tiny_barracuda_plushie
For the quest reward, set it up similar to experience. For the subtype use 'Item' and the value column use the item_id.

Code: Select all

INSERT INTO quest_details (quest_id, type, subtype, value, quantity) VALUES(671, `Reward`, `Item`, 61483, 1);

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

Re: How to look up NPC and Quest ID's

Post by Jabantiz » Thu Sep 03, 2015 3:57 pm

Zcoretri wrote:I know a backhanded way to find it, but Jabantiz probably has an easier way to find it.
When working with live quest I refer to census.daybreakgames.com, as you can see in that link there is this line that matches your step and does have icon listed
<branch quota_min="-1" description="I need to fish for Grunthor in Everfrost." completion_zone_override="" icon_id="2549" completion_zone="zones/everfrost" quota_max="10" icon_name="fish for Grunthor" completed_text="I have fished for Grunthor.">
Also the rewards is on details tab when you edit a quest, just add in a new line setting the options like Zcoretri mentioned.

The reload function is also required as it puts the quest at the right steps when you log out and back in before completing it. It does look like you set it up right.

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

Re: How to look up NPC and Quest ID's

Post by Jabantiz » Thu Sep 03, 2015 4:08 pm

Good job on the spawn script. I have a few suggestions though they will not effect how the script runs.
function spawn(NPC)
SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
ProvidesQuest(NPC, Fish_For_Grunther)
end

function respawn(NPC)
end

function InRange(NPC, Spawn)
end

function LeaveRange(NPC, Spawn)
end


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

if HasQuest(Spawn, Fish_For_Grunther) == false and HasCompletedQuest(Spawn, Fish_For_Grunther) == false then
Quest1Chat_1(NPC, Spawn)
elseif GetQuestStep(Spawn, Fish_For_Grunther) == 1 then
Quest1Chat_3(NPC, Spawn)
elseif HasQuest(Spawn, Fish_For_Grunther) == false and HasCompletedQuest(Spawn, Fish_For_Grunther) == true then
Quest1Chat_4(NPC, Spawn)
end
end
I would remove the stuff highlighted red, the proximity because nothing is being done (unless of course you just haven't gotten to it yet) that way the server is not doing range checks for nothing.

The conversation line only because it is never used within the hailed function.

User avatar
Flunklesnarkin
Posts: 79
Joined: Thu Jul 12, 2012 2:53 pm

Re: How to look up NPC and Quest ID's

Post by Flunklesnarkin » Fri Sep 04, 2015 8:00 am

Thanks for the info Jantiz. I was able to get the spawn scripts sorted out and I can talk to Burm Grunthor and accept the quest into my journal.

I'm not sure how to look up the Item_ID for the emu project though. The item ID on the census page

Code: Select all

http://census.daybreakgames.com/xml/get/eq2/quest?name=Fish%20for%20Grunthor
doesn't match what is used on this project.

This quest is an example:

Code: Select all

http://census.daybreakgames.com/xml/get/eq2/quest?name=All%20That%20Remains
the item ID's on the census page are

Code: Select all

<item type="granted" id="828584947" quantity="1"/>
</item_list>
<selected_item_list>
<selected_item id="2258774779" quantity="1"/>
<selected_item id="1940540619" quantity="1"/>
<selected_item id="3748379685" quantity="1"/>
<selected_item id="2836164801" quantity="1"/>
Which doesn't match the ID's on the quest in the data base:

Code: Select all

http://eq2emulator.net:9301/eq2db/editors/quests.php?zone=Frostfang%20Sea&id=55&tab=quest_details
Other than that I think this quest is mostly running. I'll run through it later once I can figure out how to set my fishing skill to 190 so I can harvest the fishing nodes. I tried the modify command but I must be using it wrong. "/modify skill set fishing 190 target" didn't seem to work

User avatar
Flunklesnarkin
Posts: 79
Joined: Thu Jul 12, 2012 2:53 pm

Re: How to look up NPC and Quest ID's

Post by Flunklesnarkin » Fri Sep 04, 2015 8:54 am

and I did end up changing the spawn scripts to the script I had in the pastebin.

That way the quest acceptance window pops up like it does on live and the conversation can continue or end as you choose.

Code: Select all

--[[
    Script Name    : SpawnScripts/Everfrost/BurmGrunthor.lua
    Script Author  : Flunklesnarkin
    Script Date    : 2015.09.03 10:09:57
    Script Purpose : 
                   : 
--]]

local Fish_For_Grunther = 136

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

function respawn(NPC)
         spawn(NPC)
end

function hailed(NPC, Spawn)
    FaceTarget(NPC, Spawn)
	if HasQuest(Spawn, Fish_For_Grunther) == false and HasCompletedQuest(Spawn, Fish_For_Grunther) == false then
             Quest1Chat_1(NPC, Spawn)
	elseif GetQuestStep(Spawn, Fish_For_Grunther) == 1 then 
             Quest1Chat_3(NPC, Spawn)
	elseif HasQuest(Spawn, Fish_For_Grunther) == false and HasCompletedQuest(Spawn, Fish_For_Grunther) == true then
             Quest1Chat_4(NPC, Spawn)
	end
end	

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

    AddConversationOption(conversation, "Oh?", "Quest1Chat_2")
    StartConversation(conversation, NPC, Spawn, "Arh! The fish just aren't biting!")
end

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

	AddConversationOption(conversation, "Perhaps I could fish some for you?", "Offer_Fish_For_Grunther")
        AddConversationOption(conversation, "Sounds like you should work on your fishing skills.")
	StartConversation(conversation, NPC, Spawn, "Nay, I've been at it for hours, but nuthin'. And I've mouths to feed...")
end


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

	AddConversationOption(conversation, "I do not.")
	StartConversation(conversation, NPC, Spawn, "Have ye the fish?")
end

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

	AddConversationOption(conversation, "I most certainly would.", "Offer_Fish_For_Grunther")
	AddConversationOption(conversation, "Nah, I've got better things to do with my time.")
	StartConversation(conversation, NPC, Spawn, "I could always use some'mere fish if ye'd be up fer it.")
end

function Offer_Fish_For_Grunther(NPC, Spawn)
	if HasQuest(Spawn, Fish_For_Grunther) == false and HasCompletedQuest(Spawn, Fish_For_Grunther) == false then
	    OfferQuest(NPC, Spawn, Fish_For_Grunther)
	    FaceTarget(NPC, Spawn)
	    conversation = CreateConversation()

	    AddConversationOption(conversation, "Not to worry.")
	    StartConversation(conversation, NPC, Spawn, "That'd truly be a blessing from the gods, thank ye.")

        elseif HasQuest(Spawn, Fish_For_Grunther) == false and HasCompletedQuest(Spawn, Fish_For_Grunther) == true then
	    OfferQuest(NPC, Spawn, Fish_For_Grunther)
	    FaceTarget(NPC, Spawn)
	    conversation = CreateConversation()

	    AddConversationOption(conversation, "You're welcome.")
	    StartConversation(conversation, NPC, Spawn, "A fine young adventurer ye be, thank ye.")
	    
	end

end





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

Re: How to look up NPC and Quest ID's

Post by Jabantiz » Fri Sep 04, 2015 2:34 pm

It is best to lookup by the item name, I usually grab the rewards from zam or wikia, though I do not believe the web editor has an item look up page yet and most of us use a local DB, I will look into it but it will take some time.

/modify is a work in progress and skills aren't added in yet, I could probably get basic functionality in that today though, which leads to ground spawns not being set up yet and we don't have a web editor for that yet (which would require item look up as well) so that will take me a little more time to add.

Just to clarify on your quest, on live when the quest offer pops up does the conversation continue underneath it or does it continue after you hit accept?

User avatar
Flunklesnarkin
Posts: 79
Joined: Thu Jul 12, 2012 2:53 pm

Re: How to look up NPC and Quest ID's

Post by Flunklesnarkin » Fri Sep 04, 2015 2:37 pm

Thanks for the info.

I started working on the spawn script for Marta Terrilon and the quest script for Marta Terrilon's Fur Hunt

I've made some decent progress on it. The different types of spawns update the quest counter and the quest completes when I talk to Marta afterwards.

This is a limited repeatable quest and I haven't figured out how to limit that aspect of the quest just yet. I also don't know how to make the game remembers how many pelts you've collected. Since it doesn't remember the pelts collected if you log off halfway through the quest and log back in you have to start over at zero pelts again.

I think the AddQuestStepKill() might need an additional parameter. The third parameter is what shows up in the quests sub step but also shows up in the mini update text. Like if i killed a bear and it's suppose to say "bear pelt 1/10" it would instead say the third parameter sub step text.

http://eq2emulator.net/wiki/index.php/L ... stStepKill


I'll keep working on these quests until I figure out exactly what's wrong or missing but thought I'd update on what I've been doing. Might be able to do a few more things tomorrow.. but labor day is coming up and got a lot of things to do at work next week. Might be a week or two until I can get back to this.

I'm taking notes so when I do come back I can pick up where I left off and once i figure things out more I should be able to pump out the quests faster.



edit.. The quest acceptance box pops up after you click an option.. then a new chat bubble pops up and the npc says more text.

As an example all of the text below would be in a conversation bubble

NPC: "Hey, wanna do quests"
Player: "Sure, I do quest"
*Quest Window Pops UP* Accept / Decline
NPC "Thanks for doing quest"
Player "No problem"

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

Re: How to look up NPC and Quest ID's

Post by Jabantiz » Fri Sep 04, 2015 2:49 pm

Flunklesnarkin wrote:I also don't know how to make the game remember how many pelts you've collected. Since it doesn't remember the pelts collected if you log off halfway through the quest and log back in you have to start over at zero pelts again.
This is odd, progress was always saved automatically, you do need to have the reload function in the quest script to get the steps sorted out properly when logging back in but the step progress should be loaded from the db.

Also if the conversation continues after you hit accept then in the quest script you could add the conversation to the accepted function.

For limited repeatable quests you could use GetQuestCompleteCount() in the spawn script so the spawn won't offer the quest if you have completed it to many times already.

User avatar
Cynnar
Project Leader
Posts: 738
Joined: Sat Sep 27, 2014 1:22 am
EQ2Emu Server: Eq2emulator
Characters: Vlash
Veinlash
Taragak
Cynnar

Re: How to look up NPC and Quest ID's

Post by Cynnar » Fri Sep 04, 2015 3:32 pm

Jabantiz wrote: Also if the conversation continues after you hit accept then in the quest script you could add the conversation to the accepted function.
Just a quick note that the conversation in the accepted function of the quest uses a few different parameters then the SpawnScripts do. NPC is replaced with QuestGiver and spawn is replaced with Player. Here is what it will look like to add to the quest accepted function.

Code: Select all


function Accepted(Quest, QuestGiver, Player)
       FaceTarget(QuestGiver, Player)
       conversation = CreateConversation()

       AddConversationOption(conversation, "Not to worry.")
       StartConversation(conversation, QuestGiver, Player, "That'd truly be a blessing from the gods, thank ye.")
end
It's easy to get those mixed up and have all sorts of troubles.
[ 01000011 01111001 01101110 01101110 01100001 01110010 ]

Follow on:
Twitter Facebook

Contact me:
PM Discord chat email

Hardware: the parts of a computer that can be kicked

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

Re: How to look up NPC and Quest ID's

Post by Jabantiz » Fri Sep 04, 2015 3:36 pm

Thanks for that Cynnar, that is one of those things that is just like second nature to me and I forget to explain.

User avatar
Cynnar
Project Leader
Posts: 738
Joined: Sat Sep 27, 2014 1:22 am
EQ2Emu Server: Eq2emulator
Characters: Vlash
Veinlash
Taragak
Cynnar

Re: How to look up NPC and Quest ID's

Post by Cynnar » Fri Sep 04, 2015 3:43 pm

Jabantiz wrote:Thanks for that Cynnar, that is one of those things that is just like second nature to me and I forget to explain.
Your welcome. I will never forget this as I had a few quest that needed to be redone. Sometimes copy and paste will mess things up.
[ 01000011 01111001 01101110 01101110 01100001 01110010 ]

Follow on:
Twitter Facebook

Contact me:
PM Discord chat email

Hardware: the parts of a computer that can be kicked

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests