Difference between revisions of "ContentDesigner:Spawn Script Template"

(Created page with "{{PageHeaderChild|ContentDesigner:SpawnScripts|Spawn Script Template}} This guide is all about the spawn script template, and offers an explanation of each part of the code to h...")
 
Line 31: Line 31:
 
'''Script Notes:''' Here is where any special notes goes. An example would be if there is something that needs to be added to the spawn script but is not able to be added at the current time of coding. Here is what it should look like.
 
'''Script Notes:''' Here is where any special notes goes. An example would be if there is something that needs to be added to the spawn script but is not able to be added at the current time of coding. Here is what it should look like.
 
   Script Notes : Missing PlayFlavor information for the hail function.
 
   Script Notes : Missing PlayFlavor information for the hail function.
 +
 +
 +
{|style="table-layout:fixed; width: 100%;"
 +
|{{TextBox
 +
|Functions
 +
|function spawn(NPC)<br/>
 +
end<br/>
 +
function spawn(NPC)<br/>
 +
end<br/>
 
<br/>
 
<br/>
 +
function respawn(NPC)<br/>
 +
spawn(NPC)<br/>
 +
end<br/>
 +
<br/>
 +
function hailed(NPC, Spawn)<br/>
 +
end<br/>
 +
<br/>
 +
function hailed_busy(NPC, Spawn)<br/>
 +
end<br/>
 +
<br/>
 +
function casted_on(NPC, Spawn, Message)<br/>
 +
end<br/>
 +
<br/>
 +
function targeted(NPC, Spawn)<br/>
 +
end<br/>
 +
<br/>
 +
function attacked(NPC, Spawn)<br/>
 +
end<br/>
 +
<br/>
 +
function aggro(NPC, Spawn)<br/>
 +
end<br/>
 +
<br/>
 +
function healthchanged(NPC, Spawn)<br/>
 +
end<br/>
 +
<br/>
 +
function auto_attack_tick(NPC, Spawn)<br/>
 +
end<br/>
 +
<br/>
 +
function death(NPC, Spawn)<br/>
 +
end<br/>
 +
<br/>
 +
function killed(NPC, Spawn)<br/>
 +
end<br/>
 +
<br/>
 +
function CombatReset(NPC)<br/>
 +
end<br/>
 +
<br/>
 +
function randomchat(NPC, Message)<br/>
 +
end
 +
|BackgroundColor=ffffff
 +
|FontColor=000000}}
 +
|}
 +
 +
 +
 
'''''More Comming Soon...'''''
 
'''''More Comming Soon...'''''

Revision as of 00:23, 7 September 2015

ContentDesigner:SpawnScripts - Spawn Script Template

Return to: ContentDesigner:SpawnScripts | Tutorials | Portal | Forum | Project Manager | Bug Tracker


This guide is all about the spawn script template, and offers an explanation of each part of the code to help better understand how the emulator server uses LUA scripting language to make your NPC's come to life. If you are using the EQ2LuaEditor then this exact template can be created by going to file->New->Spawn Script.


A breakdown of the template

In order to have a spawn script that can be submitted to the server you must follow a certain structure. First will be a break down of the code with an explanation of what each part does. At the bottom there will be the full template. If you are using the EQ2LuaEditor then one can be created by going to file->New->Spawn Script.

Comments Section

--[[
Script Name : <script-name>
Script Purpose : <purpose>
Script Author : <author-name>
Script Date : 9/7/2015
Script Notes : <special-instructions>
--]]

In the comments section is where information goes about the spawn script that is being made. This information is useful when you or someone else needs to look at the script if an error occurs at a later date. A comment section can be quickly located by the two dashes followed by two left square brackets at the beginning of a line --'' and has two dashes followed by two right square brackets ''-- on the last line after the comment. As we can see from the code above there is a place for the scripts name, purpose, author, date, and notes.
Script Name: This is where the the name of the NPC the script is created for will go. It also includes the location of that script and will look something like this.

 Script Name : SpawnScripts/Darklight/VerexNZa.lua

The above example is case sensitive, and all spawn scripts will go into a folder called SpawnScripts. This is the first line as can be seen in the example above. Next is the zone of the NPC. This NPC is located in Darklight Wood, so it will go into a folder named Darklight. After that is the name of the NPC that this spawn script will be assigned to. As can be seen above VerexNZa the name of the NPC Verex N'Za. Notice that the ' has been removed in the naming process. Last is the .lua. Since LUA is the scritping language that the emulator uses so it must be present.
Script Purpose: This is where the name of the NPC will go. For extra clarification the spawn ID can be placed in here as well. This will help later on to identify the NPC in the database. It will look something like this.

 Script Purpose : Verex N'Za (340030)

Script Author: This is where the author of the script goes. Easy enough to figure out, and could possibly let someone know who to contact with either help on the script, or questions on why they done something the way they did. Just to keep the layout of this page the same here is what it will look like.

 Script Author : Cynnar

Script Date: This is where the date you made the script goes. It could be helpful if there is a server code change and scripts before that date need to be edited to reflect those changes. Here is what it will look like.

 Script Date : 2015.07.01

Script Notes: Here is where any special notes goes. An example would be if there is something that needs to be added to the spawn script but is not able to be added at the current time of coding. Here is what it should look like.

  Script Notes : Missing PlayFlavor information for the hail function.


Functions

function spawn(NPC)
end
function spawn(NPC)
end

function respawn(NPC)
spawn(NPC)
end

function hailed(NPC, Spawn)
end

function hailed_busy(NPC, Spawn)
end

function casted_on(NPC, Spawn, Message)
end

function targeted(NPC, Spawn)
end

function attacked(NPC, Spawn)
end

function aggro(NPC, Spawn)
end

function healthchanged(NPC, Spawn)
end

function auto_attack_tick(NPC, Spawn)
end

function death(NPC, Spawn)
end

function killed(NPC, Spawn)
end

function CombatReset(NPC)
end

function randomchat(NPC, Message)
end


More Comming Soon...