SpiritZ New User
Posts : 4 Points : 10 Terima Kasih : 1 Join date : 01/11/2011 Age : 26 Location : Kota Bharu , Kelantan
| Subject: [Guide] Basic understandings of CQ_ACTION. Sun Jun 30, 2013 9:53 am | |
| cq_action table, is where majority of things on the server happen. From this guide you can start to learn and have a better understanding of actions. What they are, how they work, how to change them, etc.
This table basically contains all the actions for the game. Such as, what happens when a monster dies, what to do when a player clicks an NPC, broadcast messages, almost everything that happens on the server is an individual action. And the cq_action table is a record of all of them. On this table there are 6 columns which all mean different things. There is the ID, ID_NEXT, ID_NEXTFAIL, TYPE, DATA and PARAM. These will be explained below. - Quote :
ID: This is the unique identification number for an action used in the game. It cant be a repeated number and will execute when it is attached to things people access in the game. Examples of actions being attached to things are when using an item, speaking to an NPC or even automatically at a certain time.
ID_NEXT: In this column you put the action to execute after the current action has executed successfully. So, say this action is to come up with a message saying "You have obtained a Saint dragon". Then the next action would be to give the player the Saint Dragon egg, so the ID of the action that awards the egg would be put into this columns box.
ID_NEXTFAIL: In this column you write the ID of the action to execute next, if the current action is unsuccessful. Its commonly used if the current action is to determine wether a certain person has enough money. So the action would tell the server, PLAYER1 HAS 100 GOLD. If PLAYER1 really does have 100 gold, then it would pass to IDNEXT because the action was successful. But its unsuccessful if PLAYER1 does not have 100 gold. This is just thinking in theory, its more complex but thats the basic understanding of it.
TYPE: Well logically, by the name of this column, it means the type of action to execute. The action types are simple code numbers. An example is, 126 means to show a message box pop up. So if you wanted a message box pop up, then the number code to put in this column would be 126. Like all of these columns, they interact with each other. So the type, interacts with the PARAM column. For the example, TYPE tells the server that it wants to show a pop a message, PARAM tells the server what to put in the message box.
DATA: The DATA column is simply another variable that plays a part in the action being executed. Its not used alot, but when it is, its most commonly used in awarding items to the executer of the action. The TYPE column tells the server to award the player with an item. The DATA column tells the server what item to award the player with. This is just an example of where the DATA column is used commonly.
PARAM: The PARAM column is, like every previous column, a variable to the executing action. Its mostly used in cooperation with the TYPE column. The text variables mostly go into this column. An example of where PARAM is used: TYPE column tells the server to broadcast a message to the server. DATA column tells the server to broadcast the message on the whisper chat channel. PARAM tells the server what message to broadcast. With limitations, the combinations of the variables can do practically anything. With this understanding you can analyze the actions table and determine what actions are actually processing. This whole study all came from logical thinking so if its a bit hard to understand or if you have any questions feel free to ask. I tried my best to make it simple, like by using examples and stuff. Good luck guys.
| |
|