First section:
-- Buffing Systems:
========== / Things to keep in mind \ ==========
========== / Getting Started \ ==========
--
Now open a new document in your text editor. Now lets name this lua, a simple and easy method is just to name it anything memorable. For our case we'll use AUTOBUFF.lua
Now we'll name the module.
** Check the spoiler for a demonstration
================================================
Now with that accomplished we need to set some primary rules for the buffing system. These will vary based on what you want to be checked and what you want to be performed.
Note: I personally prefer to create seperate LUA's for inter-connecting functions that way things can be altered easily when tweaks are needed. I encourage you to use this process as it is very easy and very effective.
Ok for this example we are going to create a basic buffer check intended to check the users level.
--
Reminder: All functions must be tagged function at the very beginning of the very first function line
e.g. function function_name() <--- All function names must be ended with a set of brackets "()"
Note: Press tab after typing function to maintain proper formating in InType
** Check the spoiler for a demonstration
Code:
A) When creating a buffing system you need to do your research A.1) A good method is to pick buffs that compliment their users instead of wide range buffing. A.2) Buff levels should compliment other buffs and you should always be mindful of the delicate balance you will be disturbing with your alterations. A.3) Set up several safeties meant to reduce server load when many players are accessing the buffing unit simultaneously.
========== / Getting Started \ ==========
That having been said we should start with the basics of the LUA which the Game Server will be using to distribute our buffs.
--
First you will need to obtain a decent Text Editor. Below are a couple of my favored options:
--
First you will need to obtain a decent Text Editor. Below are a couple of my favored options:
Code:
-- [URL="http://www.gigstor.com/download-intype/"]InType[/URL] -- [URL="http://notepad-plus-plus.org/download/v5.9.8.html"]Notepad ++[/URL]
Now open a new document in your text editor. Now lets name this lua, a simple and easy method is just to name it anything memorable. For our case we'll use AUTOBUFF.lua
Now we'll name the module.
** Check the spoiler for a demonstration
Code:
function get_module_name()
return "Auto_Buff"
end
- [B]Make sure to name it something close to the format it is in -- in the a fore mentioned example.
================================================
- Save the document, CTRL+S or click File -> Save As:
- Save the document as NPC_BUFF.lua for simplicity.
Now with that accomplished we need to set some primary rules for the buffing system. These will vary based on what you want to be checked and what you want to be performed.
Note: I personally prefer to create seperate LUA's for inter-connecting functions that way things can be altered easily when tweaks are needed. I encourage you to use this process as it is very easy and very effective.
Ok for this example we are going to create a basic buffer check intended to check the users level.
--
Reminder: All functions must be tagged function at the very beginning of the very first function line
e.g. function function_name() <--- All function names must be ended with a set of brackets "()"
Note: Press tab after typing function to maintain proper formating in InType
** Check the spoiler for a demonstration
Code:
function get_module_name()
return "Auto_Buffer"
end
function check_level()
local level = get_value("level") -- This will tell the lua to get value "level"
if level == x then -- ** Example One
add_state("state_id", "state_level", "state_time") -- ** Example Two
cprint("message") -- ** Example Three
end -- if end
end -- function end
- "--" represents a null, and will cancel anything written on the line following it, great for comments.
- "Local" defines that the variable "level" is local to the function it is being called in. Level in turn is the name of the value.
- After any; if argument ==, >, < you must include "then"
- "Then" Example
Code:if argument == 1 then
- Example One
== is a used for comparison tool for values static and retrieved. Just replace "==" with the appropriate symbol for your desired action
You can check for values high, lower and equal to the
reference value.
">" -- Number High Than
"<" -- Number Lower Than
"==" -- Number Equal Too
"X" represents the value to be checked against.
e.g. if level > 99 then
this sort of argument gives the buffer a check which can then buff a user dependent on that and any other checks you may put in place. - Example Two
There are many methods in which to build a buffing array, via simple one line buff entries or through a complex network of checks and balances. For this example however we are going to use a basic command function to buff the target
Code:add_state("state_id", "state_level", "state_time")- state_id is the ID of the buff, you can find this in most any gm tool.
- state_level is the level of the buff being cast, high levels will cause bugging
- state_time is the amount of time the buffs will last, recommended to set high to reduce sever load.
- Example Three
Code:cprint("message")- Replace "Message" with whatever message you want to be displayed in chat
- This is a very valuable tool for debugging LUA functions
- These messages will appear in the players chat box
- These message can be formatted using <B><#000000> etc
- The message must be within the caps limit for Rappelz Chat
- "If" Options
- Ending Functions
Every function must have an end and every if must have an end. Example below
Code:function function_name() if argument == x then operation() end end
- Adding Extra Functions
Code:Basically follow the format in the above example just change variables to your liking. [B]Note: I recommend looking through other LUA's to get handles on mixing functions and learning how to further this basic example.[/B]
Second section:
-- Non-Playable-Characters (NPC):
COMING SOON!!!
Time to "Farm" thanks
If you found this guide to be useful please be a sport and press "Thanks" and thank you for doing so ^_^






