another sql query

08/12/2010 16:20 pizdolcea#1
hello guyz ,
well i want a sql query or a way or anything u recommend me ,
to make :

every new character starts or created and started playing my server will have :

Quote:
15 days custume ( the new summer set i have all )
+5 18% Talismans
Magic Health Pack 300 EA
10 Coppers
Health Regenerator
10 Portal Scrolls
maybe send on mail ,
or can be on his inventory

if send on mail , have to write mail
Quote:
from [GM]Team
Subject : Begin Event
Body Text : Welcome To My Dekaron , We Give Free Items As Event . Enjoy
thank you
08/12/2010 20:53 CROvic#2
by zombe
Quote:
Have you ever wanted to give an item(s) to every character as soon as it is created?
Well, I am here to show you how!

First we will open up the MSSQL's Enterprise Manager, and we will take a lot at the user_character table in the character database.
Have you ever noticed the [DEV] characters in there? Well, that is what we are looking for. They all have an user_no of 19999999999991, so you can find them by searching for that user_no in user_character table.

Ok, first lets take a look at their names.
[DEV]KNIGHT, [DEV]HUNTER, [DEV]MAGICIAN , etc. Obviously a char for each class.

Lets take a look at the stats of [DEV]KNIGHT. 6 str, 3 dex, 4 con, 2 spr. Nothing special. Except... Wait, aren't these the stats that all knights have when the chart is created by default? Yes, they are! So what if we would change all those stats to lets say 2000, save and then create a character?
WOW! My newly created character has 2k stats!

Ok, so that is the method how to customize the character, like starting level, starting health, starting shield, etc. You can make it different for each class, if you want.

Ok, but how about items, you ask?

I will do it so that the items would be equipped by default.
So lets go to user_suit, but leave user_character table open.
Lets say we are customizing a knight. Note the character no of [DEV]KNIGHT, that is DEKARON0000001.
Lets find that in the user_suit table. Ok, we found it. 1 entry.

line_no 4, wIndex 2421.

Hmm... Wait, that is a lvl 1 1h-sword! The very same one a newly created character gets, when he makes a new character!

So this is what we do.
We will make ourselves a new character. Then, mail the items you want the newly created character to have to the char you just created, or you can drop them by killing mobs/treasureboxes. Anyway, once you have the items you want, equip them. Make sure you equip ONLY what you want the newly created character to have, so check your mount/wings slot, your potion quickslots, everything.
Once you have it equipped, logout and go to your enterprise manager, user_character, find your character. Get it's character number, I will use A09090520000000003 as an example, because that is my number.
Then, go to user_suit, find the character_no DEKARON0000001 (for knight).
DELETE the 1 row that it has. Then find your character's no (A09090520000000003 as an example). Change the character_no on all lines to DEKARON0000001. Log back into your account again (Yes, all of your items you equipped will be gone), then create a new character.
Wow! He has all the items!

The same can be used for all classes, and it can be used the same way for inventory, skillls, almost everything. Also, you can edit the guild's MASTERCODE to change the default guild created.


by pieter
Quote:
No more SQL Manager jobs that keep looping and lag your server!

open sql profiler
go to character > stored procedures
find SP_CHAR_CREATE
rightclick it > Edit

scroll down and look for:

COMMIT TRANSACTION
SET @sp_rtn = 0
RETURN



thats the line that returns the client, "OK Your character has been made, u can login!"

example of a mailbox script to send an argate to new characters right after they have been made

COMMIT TRANSACTION
/* Custom content by Henkie2 / Pieter / KissMyBow
Sends new characters a argate in mailbox to welcome them */
declare @itemnum INT
SET @itemnum = 9901
EXEC character.dbo.SP_POST_SEND_OP @character_no,'[DEV] Henkie2',1,'Welcome Gift!!','Welcome to -servername- here a gift',@itemnum,'0',0
SET @sp_rtn = 0
RETURN



NOTE! u cannot SAVE stored procedures to save changes u made to a stored procedure using SQL-Profiler u have to EXECUTE it
press ALT+X to execute the SP and save your changes
08/12/2010 23:31 pizdolcea#3
Quote:
Originally Posted by CROvic View Post
by zombe




by pieter
sorry nothing helped me ,
nothing of that way i want ,
i dont want to make a character and have all this shits then remove character and replace with DEKARON0000001 ,
i want a sql query to do that ,

maybe make it like a job , to start and send this items when new character created
08/13/2010 00:14 pieter#4
he gave u my script and that script does exactly what u want

it just takes a little more reading to understand it ;)

the procedure SP_CHAR_CREATE gets run everytime someone creates a new character, so alterring that is the best way to do it!
08/13/2010 01:30 pizdolcea#5
Quote:
Originally Posted by pieter View Post
he gave u my script and that script does exactly what u want

it just takes a little more reading to understand it ;)

the procedure SP_CHAR_CREATE gets run everytime someone creates a new character, so alterring that is the best way to do it!
were to put that code ?
i have alot things on this stored produse thing

Quote:
declare @itemnum INT
SET @itemnum = 9901
EXEC character.dbo.SP_POST_SEND_OP @character_no,'[DEV] Henkie2',1,'Welcome Gift!!','Welcome to -servername- here a gift',@itemnum,'0',0
SET @sp_rtn = 0
RETURN
08/13/2010 03:00 CROvic#6
Quote:
were to put that code ?
open sql profiler
go to character > stored procedures
find SP_CHAR_CREATE
rightclick it > Edit

scroll down and look for:

COMMIT TRANSACTION
SET @sp_rtn = 0
RETURN



and change it to this


declare @itemnum INT
SET @itemnum = enter index of item
EXEC character.dbo.SP_POST_SEND_OP @character_no,' MyName',1,'Enter Mail name!!','Enter text here',@itemnum,'0',0
SET @sp_rtn = 0
RETURN
08/13/2010 03:04 CROvic#7
#remove this post
sry for double posting...
08/13/2010 13:48 pizdolcea#8
Quote:
Originally Posted by CROvic View Post
open sql profiler
go to character > stored procedures
find SP_CHAR_CREATE
rightclick it > Edit

scroll down and look for:

COMMIT TRANSACTION
SET @sp_rtn = 0
RETURN



and change it to this


declare @itemnum INT
SET @itemnum = enter index of item
EXEC character.dbo.SP_POST_SEND_OP @character_no,' MyName',1,'Enter Mail name!!','Enter text here',@itemnum,'0',0
SET @sp_rtn = 0
RETURN
on this script send only 1 item ,
i changed the copper index to my 15 days custume
but i need 4 more items so ?

and i want to send for each char a custume , so i think this way not working ?
08/13/2010 20:32 naruto820#9
You can use zombe's script to give many items as start as well. just get the character number of 6 DEV characters. go to user_bag and find the rows with those character numbers and add the lines to give them items. So whenever someone makes a new character those items will be in the inventory.
08/15/2010 14:53 pieter#10
sadly the timed items will instantly expire in that way ;)
08/15/2010 18:30 pizdolcea#11
Quote:
Originally Posted by pieter View Post
sadly the timed items will instantly expire in that way ;)
yes i tried , that way
they get removed when i crate the character :(
08/15/2010 18:45 pieter#12
thats why u can use my script.

just look at what it does, after that its easy to make it sent 2 or more items ;)

1 hint, u can only add 1 item per mailbox message ;)
08/16/2010 01:39 pizdolcea#13
Quote:
Originally Posted by pieter View Post
thats why u can use my script.

just look at what it does, after that its easy to make it sent 2 or more items ;)

1 hint, u can only add 1 item per mailbox message ;)
yes but i tried ,
i copied 2 scripts i mean like this
Quote:
COMMIT TRANSACTION
declare @itemnum INT
SET @itemnum = enter index of item
EXEC character.dbo.SP_POST_SEND_OP @character_no,' MyName',1,'Enter Mail name!!','Enter text here',@itemnum,'0',0
SET @sp_rtn = 0
RETURN
declare @itemnum INT
SET @itemnum = enter index of item
EXEC character.dbo.SP_POST_SEND_OP @character_no,' MyName',1,'Enter Mail name!!','Enter text here',@itemnum,'0',0
SET @sp_rtn = 0
RETURN
END
but not working xD
08/16/2010 10:21 pieter#14
what error does it give if u parse it in sql profiler?
08/16/2010 23:07 pizdolcea#15
Quote:
Originally Posted by pieter View Post
what error does it give if u parse it in sql profiler?
nothing ,
i just get 1 item only on mail box .
1 mail with 1 item , but i think it must send 2 items with 2 mails right ?

Quote:
i mean for example i run the first sql code to send mana potion ,
and secend to send hp potion , but it send mana potion only .