Making Objects Interactable

Tutorials on setting up a server, configuring your client, and connecting to an EQ2Emulator server.
Only moderators can start new topics here
Forum rules
Most information about EQ2Emulator and Tutorials can be found at the Project Wiki. Look there for the most current information.
Locked
User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Making Objects Interactable

Post by Scatman » Fri Mar 20, 2009 10:47 pm

Edits
2009.09.25: Edited to reflect the entity command changes.
_____________________________________________________________

Interacting with objects in the game for quests and other things is a big part of Everquest II. I'm going to explain how to do this in EQ2Emu. There are a number of steps.

1) Create the entity command.
2) Setup the spawn.
3) Add functionality.

1. Create the Entity Command
First thing's first, we're going to need an entity command. This is what shows up when you right-click the spawn. This is very simple to do. Just go to your 'entity_commands' table and insert a new command.

2. Setup the Spawn
Now we need to prepare the spawn to be interacted with. You will need to go to the spawn's 'spawn' table and make sure 'targetable' = 1 and 'show_command_icon' = 1. This will make the spawn glow when you move your mouse over it and make the little hand icon appear. Make sure the spawn's 'attackable' is set to 0. If it is not, you won't be able to interact with the spawn. Now we need to give the spawn the entity command you created. You will need to put the entity command's ID into either 'command_primary' or 'command_secondary'. Putting the command in 'command_primary' will allow you to execute that command by left-clicking the spawn (shortcut).

3. Add Functionality
If you want something to happen when you click the spawn then you'll need to create a spawn script for the spawn. Whenever a spawn is casted on, the spawn's 'casted_on(NPC, Spawn, SpellName)' function is called. See here [ viewtopic.php?f=30&t=633 ] if you do not know how to use the function. This will allow you to do ANYTHING in LUA that we support when a spawn's command is clicked (like updating quest steps, etc).

_____________________________________________________________

This is how the spawn needs to be set up. You can you always change these settings on the go in a script using SpawnSet. If you want a spawn to become intractable only for a certain player when they are on a specific quest and step, check out what the SetRequiredQuest LUA function is. You put it in the spawn's spawn script with the proper parameters, and the rest is taken care of. :)

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:

Re: Making Objects Interactable

Post by John Adams » Sat Mar 21, 2009 10:15 am

Awesome Scatman, thank you for posting this tutorial.

<Locked>

Locked

Who is online

Users browsing this forum: No registered users and 1 guest