Page 1 of 1

ZoneScript example

Posted: Fri Mar 27, 2009 7:59 am
by John Adams
Scatman (or any other scripters), can you whip up a very simple example of what a ZoneScript might be used for? Scat, if you think I can use the one we set up on Queen's Colony, I can hack that up to be less Tess'y for a simple example.

I know ZoneScripts have many uses, so if you can also think of how wonderfully useful they are, I'd like to get a Wiki article up for them. Going to try and spend some time this weekend updating the LUA sections of our Wiki.

TIA

Re: ZoneScript example

Posted: Fri Mar 27, 2009 10:06 am
by Scatman
The tess script is definitely a good example to use for player_entry. There is also SetLocationProximityFunction(Zone, x, y, z, MaxVariation, InRangeFunction, [LeavingRangeFunction]).

Code: Select all

init_zone_script(Zone)
   SetLocationProximityFunction(Zone, 50, 0, -100, 10, "InRange", "OutRange")
end

function InRange(Zone, Spawn)
  if HasQuest(Spawn, 1) then
    -- do something quest related for this location
  end
end

function OutRange(Zone, Spawn)
   -- optional
end