Page 1 of 1

LUA OfferQuest and ZoneScripts

Posted: Tue Aug 11, 2015 1:31 pm
by Zcoretri
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?

Re: LUA OfferQuest and ZoneScripts

Posted: Tue Aug 11, 2015 3:43 pm
by Jabantiz
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

Re: LUA OfferQuest and ZoneScripts

Posted: Wed Aug 12, 2015 6:24 am
by Zcoretri
OK, I will give it a shot today.