LUA OfferQuest and ZoneScripts

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

Moderator: Team Members

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

LUA OfferQuest and ZoneScripts

Post by Zcoretri » Tue Aug 11, 2015 1:31 pm

Jabantiz,
I have tried to get offer quest to work with a Zone Script. Is this possible to do? I am trying to emulate getting a quest to pop up when you get to a specific area.

Code: Select all

--[[
	Script Name	: ZoneScripts/QueensColony.lua
	Script Purpose	: Location Pop-ups
	Script Author	: John Adams
	Script Date	: 2009.05.07
	Script Notes	: 
--]]

function init_zone_script(Zone)
    SetLocationProximityFunction(Zone, -15.18, -5.18, 205, 10, "InRange")
end

function InRange(Zone, Player)
    OfferQuest(Zone, Player, 1)
end

function enter_location(Zone, Player, GridID)
    if GridID == 771354606 then
        SendPopUpMessage(Player, "Sunset Meadow", 255, 255, 0)
    end
end
I think this is how I had it, seems I modified the zone script already without the OfferQuest part :oops:

Also, do you remember being a command you can use that would spit out the grid ID to the game chat window, or console?

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

Re: LUA OfferQuest and ZoneScripts

Post by Jabantiz » Tue Aug 11, 2015 3:43 pm

OfferQuest() needs a spawn as the first param, in the code it says npc can be null but it looks like that will cause a crash, will commit a fix for that in a little. In theory it should be OfferQuest(0, Player, questID). As a work around until you get the fix you could use a pointer to the turn in npc by using GetSpawn(), assuming there is a turn in npc.

For the grid id I believe it is just /grid

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

Re: LUA OfferQuest and ZoneScripts

Post by Zcoretri » Wed Aug 12, 2015 6:24 am

OK, I will give it a shot today.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests