[Tut] Character Creation *Customize
Ok I want to tell you guys over how to do stuff at the Character Creation.
What I gonna tell you in this tutorial:
-How to use it
-What you can do with it
How to use it.
If you start gunz and login the character selection screen will appear. If you create a new character he will get some basic equipment. In this tutorial I gonna tell you how to edit this basic equipment.
First of all:
Search some Zitem ID's. In this case: melee(sword), primary(weapon), secondary(weapon), custom1(like rings), custom2(like rings).
*The primary Id must not be the same as the secondary.
After you've found some ID's it's time to import them.
Open your MSSQL database and go to this location:
GunzDB > programmability > Stored Produces > Dbo.SpInsertChar > Right Click > Modify
http://i45.tinypic.com/258ryx0.png
The code will look almost like this: (Ofcourse the ID's aren't the same because I already replaced the orginal.)
PHP Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
/* 캐릭터 추가 */
ALTER PROC [dbo].[spInsertChar]
@AID int,
@CharNum smallint,
@Name varchar(24),
@Sex tinyint,
@Hair int,
@Face int,
@Costume int
AS
SET NOCOUNT ON
BEGIN TRAN
IF EXISTS (SELECT CID FROM Character where (AID=@AID AND CharNum=@CharNum) OR (Name=@Name))
BEGIN
ROLLBACK TRAN
return(-1)
END
DECLARE @CharIdent int
DECLARE @ChestCIID int
DECLARE @LegsCIID int
DECLARE @MeleeCIID int
DECLARE @PrimaryCIID int
DECLARE @SecondaryCIID int
DECLARE @Custom1CIID int
DECLARE @Custom2CIID int
DECLARE @ChestItemID int
DECLARE @LegsItemID int
DECLARE @MeleeItemID int
DECLARE @PrimaryItemID int
DECLARE @SecondaryItemID int
DECLARE @Custom1ItemID int
DECLARE @Custom2ItemID int
SET @SecondaryCIID = NULL
SET @SecondaryItemID = NULL
SET @Custom1CIID = NULL
SET @Custom1ItemID = NULL
SET @Custom2CIID = NULL
SET @Custom2ItemID = NULL
INSERT INTO Character (AID, Name, CharNum, Level, Sex, Hair, Face, XP, BP, FR, CR, ER, WR,
GameCount, KillCount, DeathCount, RegDate, PlayTime, DeleteFlag)
Values (@AID, @Name, @CharNum, 1, @Sex, @Hair, @Face, 0, 0, 0, 0, 0, 0, 0, 0, 0, GETDATE(), 0, 0)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @CharIdent = @@IDENTITY
/* Melee */
SET @MeleeItemID =
CASE @Costume
WHEN 0 THEN 522
WHEN 1 THEN 522
WHEN 2 THEN 522
WHEN 3 THEN 522
WHEN 4 THEN 522
WHEN 5 THEN 522
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @MeleeItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @MeleeCIID = @@IDENTITY
/* Primary */
SET @PrimaryItemID =
CASE @Costume
WHEN 0 THEN 702
WHEN 1 THEN 702
WHEN 2 THEN 702
WHEN 3 THEN 702
WHEN 4 THEN 702
WHEN 5 THEN 702
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @PrimaryItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @PrimaryCIID = @@IDENTITY
/* Secondary */
IF @Costume = 0 OR @Costume = 2 BEGIN
SET @SecondaryItemID =
CASE @Costume
WHEN 0 THEN 0
WHEN 1 THEN 0
WHEN 2 THEN 0
WHEN 3 THEN 0
WHEN 4 THEN 0
WHEN 5 THEN 0
END
IF @SecondaryItemID <> 0 BEGIN
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @SecondaryItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @SecondaryCIID = @@IDENTITY
END
END
SET @Custom1ItemID =
CASE @Costume
WHEN 0 THEN 30301
WHEN 1 THEN 30301
WHEN 2 THEN 30401
WHEN 3 THEN 30401
WHEN 4 THEN 30401
WHEN 5 THEN 30101
END
/* Custom1 */
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @Custom1ItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @Custom1CIID = @@IDENTITY
/* Custom2 */
IF @Costume = 4 OR @Costume = 5
BEGIN
SET @Custom2ItemID =
CASE @Costume
WHEN 0 THEN 0
WHEN 1 THEN 0
WHEN 2 THEN 0
WHEN 3 THEN 0
WHEN 4 THEN 0
WHEN 5 THEN 0
END
IF @Custom2ItemID <> 0
BEGIN
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @Custom2ItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @Custom2CIID = @@IDENTITY
END
END
IF @Sex = 0 /* 남자일 경우 */
BEGIN
/* Chest */
SET @ChestItemID =
CASE @Costume
WHEN 0 THEN 101031
WHEN 1 THEN 101031
WHEN 2 THEN 101031
WHEN 3 THEN 101031
WHEN 4 THEN 101031
WHEN 5 THEN 101031
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @ChestItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @ChestCIID = @@IDENTITY
/* Legs */
SET @LegsItemID =
CASE @Costume
WHEN 0 THEN 103029
WHEN 1 THEN 103029
WHEN 2 THEN 103029
WHEN 3 THEN 103029
WHEN 4 THEN 103029
WHEN 5 THEN 103029
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @LegsItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @LegsCIID = @@IDENTITY
END
ELSE
BEGIN /* 여자일 경우 */
/* Chest */
SET @ChestItemID =
CASE @Costume
WHEN 0 THEN 101531
WHEN 1 THEN 101531
WHEN 2 THEN 101531
WHEN 3 THEN 101531
WHEN 4 THEN 101531
WHEN 5 THEN 101531
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @ChestItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @ChestCIID = @@IDENTITY
/* Legs */
SET @LegsItemID =
CASE @Costume
WHEN 0 THEN 103529
WHEN 1 THEN 103529
WHEN 2 THEN 103529
WHEN 3 THEN 103529
WHEN 4 THEN 103529
WHEN 5 THEN 103529
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @LegsItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @LegsCIID = @@IDENTITY
END
UPDATE Character
SET chest_slot = @ChestCIID, legs_slot = @LegsCIID, melee_slot = @MeleeCIID,
primary_slot = @PrimaryCIID, secondary_slot = @SecondaryCIID, custom1_slot = @Custom1CIID,
custom2_slot = @Custom2CIID,
chest_itemid = @ChestItemID, legs_itemid = @LegsItemID, melee_itemid = @MeleeItemID,
primary_itemid = @PrimaryItemID, secondary_itemid = @SecondaryItemID, custom1_itemid = @Custom1ItemID,
custom2_itemid = @Custom2ItemID
WHERE CID=@CharIdent
IF 0 = @@ROWCOUNT BEGIN
ROLLBACK TRAN
RETURN (-1)
END
COMMIT TRAN
Now let's take a closer look to specified parts.
Code:
/* Melee */
SET @MeleeItemID =
CASE @Costume
WHEN 0 THEN 522
WHEN 1 THEN 522
WHEN 2 THEN 522
WHEN 3 THEN 522
WHEN 4 THEN 522
WHEN 5 THEN 522
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @MeleeItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @MeleeCIID = @@IDENTITY
It's about the green part, so leave the pink part.
You see the command WHEN 1,2,3 etc.
Those numbers stand for the selection.
http://i45.tinypic.com/ou8m7p.png
In the code I gave everything is the same so it doesn't care which one I select.
The 522 is the Item ID. So replace it with the sword ID.
Do this also for the primary, secondary, custom1, custom2.
If you don't want to send the character any custom just enter "0" at the ID place.
Time for the dressing.
If you look futher in the code you will see this:
PHP Code:
IF @Sex = 0 /* 남자일 경우 */
BEGIN
In this case 0 means man. 1 means woman.
So under that enter the chest, pant ID you want to give the man character.
After you've done that we'll look for the woman part.
If you look futher in the code you will finaly see this:
PHP Code:
ELSE
BEGIN /* 여자일 경우 */
In short this means. If the @sex isn't is 0 then send this.
Just to mention, there are just 2: 0 = man, 1 = woman.
Under that you will see the chest, pant for the woman. You can change this with your own ID's.
What you can do with it!
Ok now it starts to get more complicated.
In the examples above you could only do those things: melee, primary, secondary, custom1, custom2.
But we want a cap/head. So we start searching in the Dbo.Character. If you look futher you will see a row called "head_slot", that's the place where the ID of the head needs to be.
First of all go to the beginning of the piece of code.
And DECLARE some more values.
Code:
DECLARE @CharIdent int
DECLARE @ChestCIID int
DECLARE @LegsCIID int
DECLARE @MeleeCIID int
DECLARE @PrimaryCIID int
DECLARE @SecondaryCIID int
DECLARE @Custom1CIID int
DECLARE @Custom2CIID int
DECLARE @HeadCIID int
DECLARE @ChestItemID int
DECLARE @LegsItemID int
DECLARE @MeleeItemID int
DECLARE @PrimaryItemID int
DECLARE @SecondaryItemID int
DECLARE @Custom1ItemID int
DECLARE @Custom2ItemID int
DECLARE @HeadItemID int
SET @SecondaryCIID = NULL
SET @SecondaryItemID = NULL
SET @Custom1CIID = NULL
SET @Custom1ItemID = NULL
SET @Custom2CIID = NULL
SET @Custom2ItemID = NULL
This is required.
Now it's time to create a new thingy.
PHP Code:
/* Head */
SET @HeadItemID =
CASE @Costume
WHEN 0 THEN 100039
WHEN 1 THEN 100039
WHEN 2 THEN 100039
WHEN 3 THEN 100039
WHEN 4 THEN 100039
WHEN 5 THEN 100039
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @HeadItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @HeadCIID = @@IDENTITY
That's what I've made.
I've putted it underneath the 'Legs'.
After this you're not done. Scroll down until you see this:
PHP Code:
UPDATE Character
SET chest_slot = @ChestCIID, legs_slot = @LegsCIID, melee_slot = @MeleeCIID,
primary_slot = @PrimaryCIID, secondary_slot = @SecondaryCIID, custom1_slot = @Custom1CIID,
custom2_slot = @Custom2CIID,
chest_itemid = @ChestItemID, legs_itemid = @LegsItemID, melee_itemid = @MeleeItemID,
primary_itemid = @PrimaryItemID, secondary_itemid = @SecondaryItemID, custom1_itemid = @Custom1ItemID,
custom2_itemid = @Custom2ItemID
WHERE CID=@CharIdent
This is where they put the ID's into the database. So we just add another like this:
Code:
UPDATE Character
SET chest_slot = @ChestCIID, legs_slot = @LegsCIID, melee_slot = @MeleeCIID,
primary_slot = @PrimaryCIID, secondary_slot = @SecondaryCIID, custom1_slot = @Custom1CIID,
custom2_slot = @Custom2CIID,
chest_itemid = @ChestItemID, legs_itemid = @LegsItemID, melee_itemid = @MeleeItemID,
primary_itemid = @PrimaryItemID, secondary_itemid = @SecondaryItemID, custom1_itemid = @Custom1ItemID,
custom2_itemid = @Custom2ItemID, head_slot = @HeadCIID
WHERE CID=@CharIdent
Now you've succesfully added an head. You can use this in many cases. And customize your gunz. There are alot Procedures where you can do stuff.
The complete script I've made:
PHP Code:
set QUOTED_IDENTIFIER ON
GO
/* 캐릭터 추가 */
ALTER PROC [dbo].[spInsertChar]
@AID int,
@CharNum smallint,
@Name varchar(24),
@Sex tinyint,
@Hair int,
@Face int,
@Costume int
AS
SET NOCOUNT ON
BEGIN TRAN
IF EXISTS (SELECT CID FROM Character where (AID=@AID AND CharNum=@CharNum) OR (Name=@Name))
BEGIN
ROLLBACK TRAN
return(-1)
END
DECLARE @CharIdent int
DECLARE @ChestCIID int
DECLARE @LegsCIID int
DECLARE @MeleeCIID int
DECLARE @PrimaryCIID int
DECLARE @SecondaryCIID int
DECLARE @Custom1CIID int
DECLARE @Custom2CIID int
DECLARE @HeadCIID int
DECLARE @ChestItemID int
DECLARE @LegsItemID int
DECLARE @MeleeItemID int
DECLARE @PrimaryItemID int
DECLARE @SecondaryItemID int
DECLARE @Custom1ItemID int
DECLARE @Custom2ItemID int
DECLARE @HeadItemID int
SET @SecondaryCIID = NULL
SET @SecondaryItemID = NULL
SET @Custom1CIID = NULL
SET @Custom1ItemID = NULL
SET @Custom2CIID = NULL
SET @Custom2ItemID = NULL
INSERT INTO Character (AID, Name, CharNum, Level, Sex, Hair, Face, XP, BP, FR, CR, ER, WR,
GameCount, KillCount, DeathCount, RegDate, PlayTime, DeleteFlag)
Values (@AID, @Name, @CharNum, 1, @Sex, @Hair, @Face, 0, 0, 0, 0, 0, 0, 0, 0, 0, GETDATE(), 0, 0)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @CharIdent = @@IDENTITY
/* Melee */
SET @MeleeItemID =
CASE @Costume
WHEN 0 THEN 522
WHEN 1 THEN 522
WHEN 2 THEN 522
WHEN 3 THEN 522
WHEN 4 THEN 522
WHEN 5 THEN 522
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @MeleeItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @MeleeCIID = @@IDENTITY
/* Primary */
SET @PrimaryItemID =
CASE @Costume
WHEN 0 THEN 702
WHEN 1 THEN 702
WHEN 2 THEN 702
WHEN 3 THEN 702
WHEN 4 THEN 702
WHEN 5 THEN 702
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @PrimaryItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @PrimaryCIID = @@IDENTITY
/* Secondary */
IF @Costume = 0 OR @Costume = 2 BEGIN
SET @SecondaryItemID =
CASE @Costume
WHEN 0 THEN 0
WHEN 1 THEN 0
WHEN 2 THEN 0
WHEN 3 THEN 0
WHEN 4 THEN 0
WHEN 5 THEN 0
END
IF @SecondaryItemID <> 0 BEGIN
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @SecondaryItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @SecondaryCIID = @@IDENTITY
END
END
SET @Custom1ItemID =
CASE @Costume
WHEN 0 THEN 30301
WHEN 1 THEN 30301
WHEN 2 THEN 30401
WHEN 3 THEN 30401
WHEN 4 THEN 30401
WHEN 5 THEN 30101
END
/* Custom1 */
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @Custom1ItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @Custom1CIID = @@IDENTITY
/* Custom2 */
IF @Costume = 4 OR @Costume = 5
BEGIN
SET @Custom2ItemID =
CASE @Costume
WHEN 0 THEN 0
WHEN 1 THEN 0
WHEN 2 THEN 0
WHEN 3 THEN 0
WHEN 4 THEN 0
WHEN 5 THEN 0
END
IF @Custom2ItemID <> 0
BEGIN
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @Custom2ItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @Custom2CIID = @@IDENTITY
END
END
IF @Sex = 0 /* 남자일 경우 */
BEGIN
/* Chest */
SET @ChestItemID =
CASE @Costume
WHEN 0 THEN 101031
WHEN 1 THEN 101031
WHEN 2 THEN 101031
WHEN 3 THEN 101031
WHEN 4 THEN 101031
WHEN 5 THEN 101031
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @ChestItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @ChestCIID = @@IDENTITY
/* Legs */
SET @LegsItemID =
CASE @Costume
WHEN 0 THEN 103029
WHEN 1 THEN 103029
WHEN 2 THEN 103029
WHEN 3 THEN 103029
WHEN 4 THEN 103029
WHEN 5 THEN 103029
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @LegsItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @LegsCIID = @@IDENTITY
/* Head */
SET @HeadItemID =
CASE @Costume
WHEN 0 THEN 100039
WHEN 1 THEN 100039
WHEN 2 THEN 100039
WHEN 3 THEN 100039
WHEN 4 THEN 100039
WHEN 5 THEN 100039
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @HeadItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @HeadCIID = @@IDENTITY
END
ELSE
BEGIN /* 여자일 경우 */
/* Chest */
SET @ChestItemID =
CASE @Costume
WHEN 0 THEN 101531
WHEN 1 THEN 101531
WHEN 2 THEN 101531
WHEN 3 THEN 101531
WHEN 4 THEN 101531
WHEN 5 THEN 101531
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @ChestItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @ChestCIID = @@IDENTITY
/* Legs */
SET @LegsItemID =
CASE @Costume
WHEN 0 THEN 103529
WHEN 1 THEN 103529
WHEN 2 THEN 103529
WHEN 3 THEN 103529
WHEN 4 THEN 103529
WHEN 5 THEN 103529
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @LegsItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @LegsCIID = @@IDENTITY
/* Head */
SET @HeadItemID =
CASE @Costume
WHEN 0 THEN 100539
WHEN 1 THEN 100539
WHEN 2 THEN 100539
WHEN 3 THEN 100539
WHEN 4 THEN 100539
WHEN 5 THEN 100539
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @HeadItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @HeadCIID = @@IDENTITY
END
UPDATE Character
SET chest_slot = @ChestCIID, legs_slot = @LegsCIID, melee_slot = @MeleeCIID,
primary_slot = @PrimaryCIID, secondary_slot = @SecondaryCIID, custom1_slot = @Custom1CIID,
custom2_slot = @Custom2CIID,
chest_itemid = @ChestItemID, legs_itemid = @LegsItemID, melee_itemid = @MeleeItemID,
primary_itemid = @PrimaryItemID, secondary_itemid = @SecondaryItemID, custom1_itemid = @Custom1ItemID,
custom2_itemid = @Custom2ItemID, head_slot = @HeadCIID
WHERE CID=@CharIdent
IF 0 = @@ROWCOUNT BEGIN
ROLLBACK TRAN
RETURN (-1)
END
COMMIT TRAN
The result:
http://i49.tinypic.com/w6rxgg.png
My English isn't perfect but I hope you've learned something.
Re: [Tut] Character Creation.
Useful tutorial for people who keep asking how to change initial items / bounty. Good job!
Re: [Tut] Character Creation *Customize
Re: [Tut] Character Creation *Customize
Re: [Tut] Character Creation *Customize
Re: [Tut] Character Creation *Customize
I could probably find it myself, but but where do I find where to change the names of the character types? (ex. Axium Gun Knight)
Re: [Tut] Character Creation *Customize
Quote:
Originally Posted by
Kerdex
I could probably find it myself, but but where do I find where to change the names of the character types? (ex. Axium Gun Knight)
system.mrs -> strings.xml, look for "UI_CC_LIST_03_01"
Re: [Tut] Character Creation *Customize
Quote:
Originally Posted by
`Styx
system.mrs -> strings.xml, look for "UI_CC_LIST_03_01"
Thanks alot, much appreciated.
Re: [Tut] Character Creation *Customize
Wow. Styx is like the best Game Developer ever, No lie.
Re: [Tut] Character Creation *Customize
Quote:
Originally Posted by
2Blazin'4u
Wow. Styx is like the best Game Developer ever, No lie.
What's the point of posting that in this topic?
Re: [Tut] Character Creation *Customize
Quote:
Originally Posted by
2Blazin'4u
Wow. Styx is like the best Game Developer ever, No lie.
He's a good developer yes, but anyone can just use their head and look stuff up :) it's actually quite easy to find.
so good? of course
best? ehhh, naw.
Re: [Tut] Character Creation *Customize
Re: [Tut] Character Creation *Customize
Thanks Very much my brother...
Re: [Tut] Character Creation *Customize
thank you now my character isnt naked
Re: [Tut] Character Creation *Customize
Why is this stil not working for me god damn it..