Hey folks,
I've seen a couple of releases and prototypes of custom GM commands released here, which some have been using, and which I personally consider terrible. Those aren't proper commands, in fact they are just random text that trigger the chat logs, and which also show up in the normal chat. This release contains a technique used by us, the Shaiya Euphoria administration team a while ago.
This isn't a perfect way to create your custom commands, it can certainly be done in a better way, but this will hopefully open people's eyes to what other things can be possibly done.
You're gonna have to insert the following code snippet into PS_GameLog.dbo.usp_Insert_Action_Log_E:
This is just a sample of 2 commands, banning and adding donation points. As I assume most of you know, ActionType 180 stands for the commands used from in game. Text1 as 'NoticeTo' means it was a private notice, which is send from in game as /wnotice charname "notice text", for example /wnotice nubness "You suck, nubness.", which will make [Notice]You suck, nubness. appear on the screen of any character named nubness.
You can change the syntax of /wnotice to anything like /cstmcmd or anything else in the game.exe, by opening it in hex and searching for /wnotice.
Back to the SQL part, what does my code snippet do ? It checks for all commands used in game. If the command is a private notice and is addressed to an existing character, it proceeds to checking what the notice text is. The first case checks if the text contains '+% points.' To translate this from SQL to english, it will trigger if the text contains a +, followed by something, which should be a number, a space and the word points, ending with a full stop. An example would be "+100 points.". If the check fails, it moves to the next case of the IF block, which checks if the text contains the word ban. It could be anything from "ban" to "You have been banned, bitch !"
Again, if you want to award Mr.X 1000 donation points, you type:
/wnotice Mr.X "+1000 points."
or perhaps you want to ban Mr.X, you type:
/wnotice Mr.X "You have been banned."
I do believe this form is much more professional that what existed until now. One disadvantage could be the fact that it only works with online toons, but hey, let's turn on our imagination and make this accept map notices that were submitted from a map where only GMs can be, which would have a global power, and which nobody but people on that map would see.
I've seen a couple of releases and prototypes of custom GM commands released here, which some have been using, and which I personally consider terrible. Those aren't proper commands, in fact they are just random text that trigger the chat logs, and which also show up in the normal chat. This release contains a technique used by us, the Shaiya Euphoria administration team a while ago.
This isn't a perfect way to create your custom commands, it can certainly be done in a better way, but this will hopefully open people's eyes to what other things can be possibly done.
You're gonna have to insert the following code snippet into PS_GameLog.dbo.usp_Insert_Action_Log_E:
Code:
IF @ActionType = 180 BEGIN IF @Text1 = 'NoticeTo' AND EXISTS (SELECT CharName FROM PS_GameData.dbo.Chars WHERE CharName = @Text2 AND Del = 0) BEGIN IF @Text3 LIKE '+% points.' BEGIN DECLARE @Text3var VARCHAR(100) = SUBSTRING(@Text3, 2, LEN(@Text3) - 9) DECLARE @Points INT = CAST(@Text3var AS INT) UPDATE PS_UserData.dbo.Users_Master SET Point += @Points WHERE UserUID IN (SELECT UserUID FROM PS_GameData.dbo.Chars WHERE CharName = @Text2 AND Del = 0) END ELSE IF @Text3 LIKE '%ban%' BEGIN UPDATE PS_UserData.dbo.Users_Master SET Status = -5 WHERE UserUID IN (SELECT UserUID FROM PS_GameData.dbo.Chars WHERE CharName = @Text2 AND Del = 0) END END END
You can change the syntax of /wnotice to anything like /cstmcmd or anything else in the game.exe, by opening it in hex and searching for /wnotice.
Back to the SQL part, what does my code snippet do ? It checks for all commands used in game. If the command is a private notice and is addressed to an existing character, it proceeds to checking what the notice text is. The first case checks if the text contains '+% points.' To translate this from SQL to english, it will trigger if the text contains a +, followed by something, which should be a number, a space and the word points, ending with a full stop. An example would be "+100 points.". If the check fails, it moves to the next case of the IF block, which checks if the text contains the word ban. It could be anything from "ban" to "You have been banned, bitch !"
Again, if you want to award Mr.X 1000 donation points, you type:
/wnotice Mr.X "+1000 points."
or perhaps you want to ban Mr.X, you type:
/wnotice Mr.X "You have been banned."
I do believe this form is much more professional that what existed until now. One disadvantage could be the fact that it only works with online toons, but hey, let's turn on our imagination and make this accept map notices that were submitted from a map where only GMs can be, which would have a global power, and which nobody but people on that map would see.
Free your mind, people, development is easy !