Auto Equip Item When Create Char

01/28/2013 06:54 <Admin>Zynx#1
Hello.. Does Anyone Know How To Store a Item In Your inventory when you create a char or have it equipted already when u create a char.. i used to know how to do this, but i forgot.. can anyone help me out please? much appreciated<3.. for example: like when u create a char u have x10 apples in your inventory etc.. thanks
01/28/2013 07:15 TeddyBear94#2
mh where would it maybe be an intresting question isnt it? lets take a deeper view.
Might be be maybe in the database in sql? oh gosh t is ö.Ö now we need to find where it is in the database mh..... what about ps_gamedefs? lets take a look.
OH there is a tabled called BaseItemsDefs!!! epic i will take a look into it and will post later if it is what u are searching for.
;)
01/29/2013 13:48 nubness#3
GENIUS !!
Teddy your sarcasm wasn't really appropriate since you didn't reply to the second part of his question. BaseItemsDefs won't make your gear be immediately equipped on the player.
I tried to make my chars start with gear already on them via the Create_Char_R procedure and I might have screwed something up as I was getting the "Name already in use" error. Still, it should be possible through a trigger.
01/29/2013 19:40 TeddyBear94#4
Quote:
Originally Posted by nubness View Post
GENIUS !!
Teddy your sarcasm wasn't really appropriate since you didn't reply to the second part of his question. BaseItemsDefs won't make your gear be immediately equipped on the player.
I tried to make my chars start with gear already on them via the Create_Char_R procedure and I might have screwed something up as I was getting the "Name already in use" error. Still, it should be possible through a trigger.
right it musst possible by using a trigger and my post didnt had a bad meaning i was just trolling and i guess all noticed that so ur flame wasnt needed at all :facepalm: he actually asked for one of this solutions and i gave him 1 so he got the answer he was looking for.
01/29/2013 20:22 nubness#5
So your trolling is fine and mine is flame ? Cool !!
01/29/2013 23:16 TeddyBear94#6
first of all it depends on the way how u act and my trolling wasnt blaming anyone it was just joking around where ur "trolling" wasnt rly trolling since u tried to insult with it.
second this is not the thread to talk about that if u want to continue u are welcome to send me a pm and i will gladly answer u.
07/07/2013 06:29 shakalaka_boom#7
I'm sorry that raise the subject, but there is the question ...
I changed the procedure [usp_Create_Char_R] but I have a problem with ItemUID, how is generated ItemUID?
07/07/2013 13:07 anton1312#8
Quote:
Originally Posted by shakalaka_boom View Post
I'm sorry that raise the subject, but there is the question ...
I changed the procedure [usp_Create_Char_R] but I have a problem with ItemUID, how is generated ItemUID?
need use triggers for it, i have this script but i can't give it for free
07/07/2013 22:39 Mithrandir.#9
So don't say it if you do not plan to release a simple script.. :rolleyes:
07/08/2013 03:38 shakalaka_boom#10
Quote:
Originally Posted by anton1312 View Post
need use triggers for it, i have this script but i can't give it for free
"can't give it for free" Русский я так понял :D

You misunderstood me, I guess, I do not need to Equip Item on the character, I just need to create a set of objects to issue depending on the level of the choice (15 \ 30 \ 60)
simple addition INSERT INTO. quite work, the only problem is ItemUID, to generate every time a new one, so I do not know how it is generated .... Or could just rand () generit ItemUID, no problems?
I'm a noob in sql ..
07/08/2013 14:24 castor4878#11
DECLARE @anItemUID uniqueidentifier
SET @anItemUID = NEWID()


itemUID is a bigint (aka int8 or 64 bits) while NEWID generates a 128-bit (CLSID like) value.
this is no implicit (nor explicit) convertion between uniqueidentifier and numeric types, so we have to convert it to string (sole possible conversion), then extract/keep 64 of the 128 bits and finally convert the hexa-string to a bigint value:

Code:
declare @UID uniqueidentifier = NEWID()
declare @str varchar(64) = convert(varchar(64), @UID)
declare @part varchar(64)
declare @itemUID bigint

set @part = SUBSTRING(@str, 15, 4) + SUBSTRING(@str, 25, 12)
set @itemUID = CONVERT(bigint,CONVERT(BINARY(8), @part, 2))
note that a 4294967295 * rand() is likely also valid, the sole purpose of the ItemUID column is to contain an unique identifier (to prevent item dupe and so on), there this is no strong proof of uniqueness of values obtained by NEWID as opposed to rand (both function can internally rely on the same pseudo random generator).
07/08/2013 15:52 anton1312#12
Quote:
Originally Posted by shakalaka_boom View Post
"can't give it for free" Русский я так понял :D

You misunderstood me, I guess, I do not need to Equip Item on the character, I just need to create a set of objects to issue depending on the level of the choice (15 \ 30 \ 60)
simple addition INSERT INTO. quite work, the only problem is ItemUID, to generate every time a new one, so I do not know how it is generated .... Or could just rand () generit ItemUID, no problems?
I'm a noob in sql ..
на самом деле там все просто, 1 триггер и все решено, его даже создавать не нужно, а просто дописать
07/09/2013 02:46 shakalaka_boom#13
Thanks castor4878

Quote:
Originally Posted by anton1312 View Post
на самом деле там все просто, 1 триггер и все решено, его даже создавать не нужно, а просто дописать

ты про какой тригер? у меня только 1 тригер Trig_Chars_INSERT...в общем то все работает и через процедуру Create_Char_R, проблема была только в itemUID, если я правильно понял, то можно спокойно генерить itemUID, главное что бы он был уникальным.
07/09/2013 13:39 anton1312#14
Quote:
Originally Posted by shakalaka_boom View Post
Thanks castor4878




ты про какой тригер? у меня только 1 тригер Trig_Chars_INSERT...в общем то все работает и через процедуру Create_Char_R, проблема была только в itemUID, если я правильно понял, то можно спокойно генерить itemUID, главное что бы он был уникальным.
да, я про этот триггер, я через него сделал, ибо в create_char_r он вроде-бы charid у меня не передавал, что ли,не помню :)
01/27/2017 09:38 Anonymous-SRO#15
I need help with autoequip ..