GM OJ Status by Command

12/30/2012 01:43 dylanwijnen1#1
#UPDATED
Fixes:
GMs can do it now to

Working on :
Making the script easyier to use.
first 5 slots in first bag will be changed.




I've had a splended idea about making a GM OJ Status set to max just by using a command.

i thank the following people for helping me:
[Dev]Haox. for his script :)
Teddybear94
Philipp.
Abrasive for his amazing help with SQL

[Only registered and activated users can see links. Click Here To Register...]

Guide : Run the Script :)

Just make sure you have the item in bag 1 and in first slot
now type this in normal chat without /

GMRoll STR40 DEX40 REC40 INT40 WIS40 LUC40 HP40 MP40 SP40 ENCH20
it has to be in the current order else it wont register :)




12/30/2012 09:48 nubness#2
It's really nice. I'm now thinking that it can be improved a little bit by making it available for players to use it. For example, a player has the GM Reroll Ticket in their inventory, they write the command which checks if they have the GM Reroll Ticket. The Trigger automatically removes the GM Reroll Ticket from the inventory and then adds specific stats to a specific item.
12/30/2012 15:27 [ADMIN]Cryptic#3
Quote:
Originally Posted by nubness View Post
It's really nice. I'm now thinking that it can be improved a little bit by making it available for players to use it. For example, a player has the GM Reroll Ticket in their inventory, they write the command which checks if they have the GM Reroll Ticket. The Trigger automatically removes the GM Reroll Ticket from the inventory and then adds specific stats to a specific item.
I imagine that would be something like this:

Code:
--GM Reroll
IF (@ChatData like 'GMRoll %')
BEGIN
SET @UserUID =	(SELECT TOP 1 UserUID FROM inserted)
SET @CharID =	(SELECT [CharID] FROM PS_GameData.dbo.Chars WHERE UserUID = @UserUID)
SET @Admin = (SELECT TOP 1 [Admin] FROM PS_UserData.dbo.Users_Master WHERE UserUID = @UserUID)
SET @AdminLevel = (SELECT TOP 1 AdminLevel FROM PS_UserData.dbo.Users_Master WHERE UserUID = @UserUID)


BEGIN
UPDATE ps_gamedata.dbo.charitems
SET craftname= '40404040404040404020'
WHERE ((bag=1 and slot=0 and CharID = @CharID) and (itemid = 'itemid for gm reroll ticket here' and bag = 1 and slot = 1))
END
END
havent tested this yet but what it should do is check if the ticket is in the itemslot next to the item you want to gm reroll and if it is it will reroll it. However im noob with sql compared to most people here so probably an easier way to do it


But what I really wanna know if theres a way to modify it so you set the stats instead of it being set to a static amount. like you type in 'GMRoll 40404000000040000020' and it will give those stats.
12/30/2012 19:27 rempieremco153#4
My opinion is that GM Rerolls kill a server.
People will get overpowered and PVP will be boring.

THOUGH, for the people that actually want this, it's a really good idea.
Good thinking and Good Luck with coding it further :)
12/30/2012 21:22 dylanwijnen1#5
Quote:
Originally Posted by [ADMIN]Cryptic View Post

havent tested this yet but what it should do is check if the ticket is in the itemslot next to the item you want to gm reroll and if it is it will reroll it. However im noob with sql compared to most people here so probably an easier way to do it


But what I really wanna know if theres a way to modify it so you set the stats instead of it being set to a static amount. like you type in 'GMRoll 40404000000040000020' and it will give those stats.
no it will have to check if the item is there so it will be like in the script it checks if ur an ADM in DB it will have to be like IF ...... 'itemid' BEGIN and then then the script to lazy to type it out for now but yes it will be a great idea to do that and a specific amount i was working on that to tough :)
12/31/2012 00:25 abrasive#6
You'd have to specify an offline character name for this to work, as non-stale data for online characters is in memory. If you try to do it to an online character, once they log off the CraftName in the database will be overwritten by data from memory, so your change will have no effect.
12/31/2012 16:05 [ADMIN]Cryptic#7
didnt even think about that
12/31/2012 20:34 Mirror.#8
Not sure if it is my Nub side or something, but if this Custom GM Command is to be used should there not be 2? This one would work perfectly fine for Weapons as the CraftName for the [20] Enchantment is the Number 20 but for Gear it is 70 to make the peice of gear [20].

Inserting this CraftName '40404040404040404020' will make it look as if the Gear is [20] but no Absorption is added into the peice of gear. This is just a observation I had while looking at it, let me know if I am not as rusty as I think I am. :p

Thanks,

Mirror.
12/31/2012 20:41 nubness#9
Your point is right and I guess what was released here is just a basic example of what you can do. If you want something more advanced, you could work on it by yourself.
12/31/2012 21:06 rempieremco153#10
Quote:
Originally Posted by Mirror. View Post
Not sure if it is my Nub side or something, but if this Custom GM Command is to be used should there not be 2? This one would work perfectly fine for Weapons as the CraftName for the [20] Enchantment is the Number 20 but for Gear it is 70 to make the peice of gear [20].

Inserting this CraftName '40404040404040404020' will make it look as if the Gear is [20] but no Absorption is added into the peice of gear.
You could edit the code, so the item id's which start with type 1 to 15, use 20 and the rest 70.
something like
IF (TypeID <= 15) (No idea if TypeID is actually in the column)
SET craftname= '40404040404040404020'
ELSE
SET craftname= '40404040404040404070'

(I suck at making SQL's, so fix the shit yourself)

[ADM]Hyperion
01/02/2013 14:27 [ADMIN]Cryptic#11
yeah I was talking about custom stats not different enchant hehe. but yeah you should do that anyway.
01/02/2013 19:10 abrasive#12
You could parse the CraftName from the chat and treat it as an argument like this:

Code:
DECLARE @NewCraftName CHAR(20) --CraftNames always have a length of 20


-- Make sure the argument provided is a valid a CraftName string
IF (@ChatData LIKE 'GMRoll [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]')
BEGIN
	SET @NewCraftName = SUBSTRING(@ChatData,7,20) -- Parse the CraftName from the chat
	
	-- Make sure character to modify is offline
	-- Check if the item is armor or weapon, or neither
	-- Run update statement to set the CraftName to @NewCraftName
	-- etc...
END
You'd still need to specify a character name so you know who you are trying to modify, as well as an equipment slot (the simplest way I can think of, as opposed to ItemUID, etc) on that character to modify.
01/03/2013 16:55 EndComplete#13
Quote:
Originally Posted by rempieremco153 View Post
My opinion is that GM Rerolls kill a server.
People will get overpowered and PVP will be boring.

THOUGH, for the people that actually want this, it's a really good idea.
Good thinking and Good Luck with coding it further :)
I have to agree with the idea that GM rerolls are more of a problem than they are good. Why? Because there are some of us that are only casual players. Those rerolls do get a bit overpowered and tend to drive people away from pvp.
01/04/2013 16:03 dylanwijnen1#14
The last number at the craft name is the enchant level [20] wich if u change it in the DB it will give u the absorbtion wich it did on my server 0.0 , tough im trying to update the script so u wont have to relogg all the time.
01/04/2013 19:03 abrasive#15
Quote:
Originally Posted by dylanwijnen1 View Post
The last number at the craft name is the enchant level [20] wich if u change it in the DB it will give u the absorbtion wich it did on my server 0.0 , tough im trying to update the script so u wont have to relogg all the time.
If you don't want to relog, you'd need to update ps_game.exe no? Updating the script wouldn't have any effect on needing to relog or not.