ZoneScript example

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

Moderator: Team Members

Post Reply
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:

ZoneScript example

Post by John Adams » Fri Mar 27, 2009 7:59 am

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
John Adams
EQ2Emulator - Project Ghost
"Everything should work now, except the stuff that doesn't" ~Xinux

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: ZoneScript example

Post by Scatman » Fri Mar 27, 2009 10:06 am

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

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests