help me for SQL pros

10/07/2010 11:52 [DEV]Pwner#1
hello ,
i want to start a new job on my pserver ,
here it goes , i have a remote reborn system , and u reborn ur char on
my ( own website )
everything works good , but my last problem is that
i want to give a skill book for a character who made 1st reborn ,

so the SQL code must be like that : ( i have reborn table on user_character )

Quote:
go to user_character search for reborn table
if reborn table is 1 send item index xxxxx in mailbox
for this character .
xxxxx= item index
i have 3 skill books i want them on the first 3 reborns ,
so 1 skill each 1 reborn

hope u understood what i mean .
10/07/2010 12:07 ҉ THT ҉#2
uh that is kinda hard,
is the user_bag clean?
if, yes it would be easier to detect who did a reborn

PHP Code:
UPDATE                                        character.dbo.user_bag
SET                                            windex
='SKILL BOOK ID'            
WHERE character_no IN(
SELECT DISTINCT character_no FROM character.dbo.user_character 
                                            WHERE reborn_table 
'1'

OR                                            WHERE reborn_table '2'
OR                                            WHERE reborn_table '3'
OR                                            WHERE reborn_table '4'

SET ROWCOUNT 1
Note: This is with out internet, maybe there are some errors (I am at work cant help to much :) )
AND this will keep giving the skill book if someone keep relogging.
Cuz I cant check the whole script you use :D
10/08/2010 00:21 -8gX#3
Code:
<?php
$character_no = Use PHP to get the character number from the input form

$get_reborn = mssql_query(SELECT reborn_no FROM character.dbo.user_character WHERE character_no = $character_no)

if ($get_reborn = '1') {
     $sql = mssql_query(UPDATE character.dbo.userbag SET windex='SKILLBOOKID' where character_no = $character_no)
}
else if ($get_reborn = '2') {
 $sql = mssql_query(UPDATE character.dbo.userbag SET windex='SKILLBOOKID' where character_no = $character_no)
}
else if ($get_reborn = '3') {
 $sql = mssql_query(UPDATE character.dbo.userbag SET windex='SKILLBOOKID' where character_no = $character_no)
}
or die(mssql_error());
?>
Or you could do a switch statement for whatever $reborn_no is. You would put this in your PHP script on your website right when your system is calculating the reborn. This way unlike THT's script relogging doesnt give you another skill book.
10/08/2010 13:00 pieter#4
lol dont add items in inventory

use the mailbox function : SP_CHAR_SEND_MAIL (or something like that)

i wrote a tut on it on dkunderground but dku is no more, and i dont have any backups
if i happen to find it somewhere ill add it to my guide-thread (sig)
10/08/2010 16:20 [DEV]Pwner#5
Quote:
Originally Posted by pieter View Post
lol dont add items in inventory

use the mailbox function : SP_CHAR_SEND_MAIL (or something like that)

i wrote a tut on it on dkunderground but dku is no more, and i dont have any backups
if i happen to find it somewhere ill add it to my guide-thread (sig)
yes that would be good , to send on mailbox
for who got 1st reborn , 2nd reborn , 3rd reborn

i will try out -8gX's script and add to reborn system on my web .

THT ҉' sends alot books xD and i want it on mail box ,

maybe make 1 job with 3 steps and make database to save the characters who got the books
1st check reborn characters + check the database
and 2nd sends book index for reborn 1 who doesnt have this books
and 3rd one save the characters who sent to at step 2nd
and reply to 1st step , so it wont send more books .. hope that idea works :D
10/08/2010 23:00 -8gX#6
yeah mailbox would work... u just cant call stored procedures from php can u?
10/09/2010 09:01 pieter#7
yes you can, on my server ppl can mailbox themself items from the website :)

mssql_query "USE CHARACTER; EXEC SP_Custom_Itemsend @charnum @itemnum"

i made a custom SP that logs all items being sent and check for itemid's that aren't in the 'allow list'
if a disalowed item gets sent it reports it to GM panel and ban+ipban's the account
10/09/2010 09:37 Zombe#8
Don't look for people who have reborned separately, instead give them the item when they reborn. Modify your reborn script/stored procedure/job/whatever you use :)