Register for your free account! | Forgot your password?

You last visited: Today at 03:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



help auto tag item

Discussion on help auto tag item within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2016
Posts: 141
Received Thanks: 74
help auto tag item

Hi epvp, can i ask if someone help me to fix this..
i have Auto Tag using scroll item
example :

but the problem .. how can replace new tag if already have [King] Tag on charname? example my character already have [King] tag.. then i use again another auto tag item call [King-II] .. how can i replace [King] tag if already exist.. i hope have someone help me .. thanks in advance..



[GameAdvisor]Finn is offline  
Old 08/23/2019, 23:56   #2
 
elite*gold: 0
Join Date: Jul 2010
Posts: 448
Received Thanks: 447
May be you could use CHARINDEX() and SUBSTRING(), to remove the [King] tag (if exist), and then apply the new tag.

Try this test

Code:
DECLARE 
 [MENTION=984633]current[/MENTION]Nick NVARCHAR(30),
 [MENTION=4843871]NewNick[/MENTION] nvarchar(30),
 [MENTION=1332308]Closet[/MENTION]ag NVARCHAR(1),
 [MENTION=3014117]nickle[/MENTION]nght INT,
 [MENTION=4351196]TAGIN[/MENTION]dex INT

SET [MENTION=984633]current[/MENTION]Nick = '[King]Akira' --example nick

SET [MENTION=1332308]Closet[/MENTION]ag = ']' --no need to find the opening tag '[' 

set [MENTION=4351196]TAGIN[/MENTION]dex = CHARINDEX [MENTION=1332308]Closet[/MENTION]ag [MENTION=984633]current[/MENTION]Nick) --where is ']' in the string
set [MENTION=3014117]nickle[/MENTION]nght = len [MENTION=984633]current[/MENTION]Nick) --nick lenght

if [MENTION=4351196]TAGIN[/MENTION]dex > 0 --if current nick has a ']'
BEGIN
	set [MENTION=4843871]NewNick[/MENTION] = SUBSTRING [MENTION=984633]current[/MENTION]Nick, [MENTION=4351196]TAGIN[/MENTION]dex + 1, [MENTION=3014117]nickle[/MENTION]nght) --take the nick without the [***]
	set [MENTION=4843871]NewNick[/MENTION] = '[King II]' + [MENTION=4843871]NewNick[/MENTION] --apply a new tag
END
		ELSE --if current nick doesn't have a tag at all
				BEGIN
					set [MENTION=4843871]NewNick[/MENTION] = '[King I]'+ [MENTION=984633]current[/MENTION]nick
				END

print [MENTION=4843871]NewNick[/MENTION] --to check result


sominus is offline  
Thanks
1 User
Old 08/24/2019, 00:37   #3


 
elite*gold: 152
Join Date: Mar 2015
Posts: 117
Received Thanks: 1,089
Another way would be to make a seperate column which is only used for tags, and then in the procedure that selects character details, just concatenate the two strings to form a display name
Cups is offline  
Thanks
2 Users
Old 08/24/2019, 05:09   #4
 
elite*gold: 0
Join Date: Sep 2016
Posts: 141
Received Thanks: 74
Quote:
Originally Posted by sominus View Post
May be you could use CHARINDEX() and SUBSTRING(), to remove the [King] tag (if exist), and then apply the new tag.

Try this test

Code:
DECLARE 
 [MENTION=984633]current[/MENTION]Nick NVARCHAR(30),
 [MENTION=4843871]NewNick[/MENTION] nvarchar(30),
 [MENTION=1332308]Closet[/MENTION]ag NVARCHAR(1),
 [MENTION=3014117]nickle[/MENTION]nght INT,
 [MENTION=4351196]TAGIN[/MENTION]dex INT

SET [MENTION=984633]current[/MENTION]Nick = '[King]Akira' --example nick

SET [MENTION=1332308]Closet[/MENTION]ag = ']' --no need to find the opening tag '[' 

set [MENTION=4351196]TAGIN[/MENTION]dex = CHARINDEX [MENTION=1332308]Closet[/MENTION]ag [MENTION=984633]current[/MENTION]Nick) --where is ']' in the string
set [MENTION=3014117]nickle[/MENTION]nght = len [MENTION=984633]current[/MENTION]Nick) --nick lenght

if [MENTION=4351196]TAGIN[/MENTION]dex > 0 --if current nick has a ']'
BEGIN
	set [MENTION=4843871]NewNick[/MENTION] = SUBSTRING [MENTION=984633]current[/MENTION]Nick, [MENTION=4351196]TAGIN[/MENTION]dex + 1, [MENTION=3014117]nickle[/MENTION]nght) --take the nick without the [xxx]
	set [MENTION=4843871]NewNick[/MENTION] = '[King II]' + [MENTION=4843871]NewNick[/MENTION] --apply a new tag
END
		ELSE --if current nick doesn't have a tag at all
				BEGIN
					set [MENTION=4843871]NewNick[/MENTION] = '[King I]'+ [MENTION=984633]current[/MENTION]nick
				END

print [MENTION=4843871]NewNick[/MENTION] --to check result
i removed all MENTION and /MENTION and try to insert on action_log_e but got error..

can you help me how to work this? thanks bro..

Quote:
Originally Posted by Cups View Post
Another way would be to make a seperate column which is only used for tags, and then in the procedure that selects character details, just concatenate the two strings to form a display name
can you help me how to do that sir Cups.. thank you..


[GameAdvisor]Finn is offline  
Old 08/24/2019, 19:07   #5
 
elite*gold: 0
Join Date: Sep 2011
Posts: 466
Received Thanks: 343
Quote:
Originally Posted by [GameAdvisor]Finn View Post

can you help me how to work this? thanks bro..



can you help me how to do that sir Cups.. thank you..
You really need help with that basic thing?

Quote:
ALTER TABLE Chars
ADD CharName_OLD varchar(30); --Name it as you want
Quote:

DECLARE @CNAme varchar(30)
DECLARE @CNAme_OLD varchar(30)

SET @CNAme = (SELECT CharName FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)
SET @CNAme_OLD = (SELECT CharName_OLD FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)

if(@ActionType=112 AND @value2=101015)
BEGIN

UPDATE PS_GameData.dbo.Chars SET CharName_OLD = @CNAme WHERE CharID = @ChariD

UPDATE PS_GameData.dbo.Chars SET CharName = '[King]' + @CNAme_OLD WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Guilds SET MasterName = '[King]' + @CNAme_OLD WHERE MasterCharID = @ChariD
UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[King]' + @CNAme_OLD WHERE FriendID = @ChariD
END
And when player want change name then change CharName_OLD without tag and CharName with tag
SnickQ is offline  
Thanks
1 User
Old 08/24/2019, 22:02   #6
 
elite*gold: 0
Join Date: Sep 2016
Posts: 141
Received Thanks: 74
Quote:
Originally Posted by SnickQ View Post
You really need help with that basic thing?





And when player want change name then change CharName_OLD without tag and CharName with tag
i try this but they have a problem..
- on first use of item no effect on CharName because no value CharName_OLD and they change only on first use
- on 2nd use of item its effect the Change of CharName because they already have value on CharName_OLD
- on 3rd time to use i change the Tag to [KingII] as test if i make another tag item and when i use.. its effect the change of CharName to [KingII]myCharname..
- on fourth time to use Tag called [***] as test again if i make 3rd tag item but the result is [***]+my CharName_OLD = [***][KingII]myCharname..


so that's the problem on this code sir.. i think on this code if we add CharName_OLD table if we make a new character they copy the CharName too on CharName_OLD so if we use item tag they effect on first use.. and about 3rd and so on.. tag item they give a problem like on fourth time i use..
but thanks for this.. i hope they can fixed also..
[GameAdvisor]Finn is offline  
Old 08/25/2019, 00:56   #7
 
elite*gold: 0
Join Date: Sep 2011
Posts: 466
Received Thanks: 343
Add Tag columin

Quote:

ALTER TABLE Chars
ADD Tag varchar(30);
And try this:

Quote:

DECLARE @CNAme varchar(30)
DECLARE @Tag varchar(30) = (SELECT Tag FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)
DECLARE @CNAme_OLD varchar(30) = (SELECT CharName_OLD FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)

SET @CNAme = (SELECT CharName FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)

if(@ActionType=112 AND @value2=101015)
BEGIN

if exists (Select Tag from Chars where [email protected] and Tag is null)
begin
UPDATE PS_GameData.dbo.Chars
SET CharName_OLD = @CNAme
Where CharID = @CharID

UPDATE PS_GameData.dbo.Chars SET Tag = '[King]' WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Chars SET CharName = '[King]' + @CNAme WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Guilds SET MasterName = '[King]' + @CNAme WHERE MasterCharID = @ChariD
UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[King]' + @CNAme WHERE FriendID = @ChariD
end


if (@Tag ='[King]')
begin

UPDATE PS_GameData.dbo.Chars SET CharName = '[KingII]' + @CNAme_OLD WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Guilds SET MasterName = '[KingII]' + @CNAme_OLD WHERE MasterCharID = @ChariD
UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[KingII]' + @CNAme_OLD WHERE FriendID = @ChariD
UPDATE PS_GameData.dbo.Chars SET Tag = '[KingII]' WHERE CharID = @ChariD
end

if (@Tag ='[KingII]')
begin

UPDATE PS_GameData.dbo.Chars SET CharName = '[KingIII]' + @CNAme_OLD WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Guilds SET MasterName = '[KingIII]' + @CNAme_OLD WHERE MasterCharID = @ChariD
UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[KingIII]' + @CNAme_OLD WHERE FriendID = @ChariD
UPDATE PS_GameData.dbo.Chars SET Tag = '[KingIII]' WHERE CharID = @ChariD
end

END
SnickQ is offline  
Old 08/25/2019, 04:35   #8
 
elite*gold: 0
Join Date: Sep 2016
Posts: 141
Received Thanks: 74
Quote:
Originally Posted by SnickQ View Post
Add Tag columin



And try this:
No work sir.. i use the items 5x but still no change and i check chars table still no value on CharName_OLD and Tag even i use the item 5x
[GameAdvisor]Finn is offline  
Old 08/25/2019, 12:17   #9
 
elite*gold: 0
Join Date: Oct 2018
Posts: 60
Received Thanks: 24
I made something like this before and i guess you can figure it out from here.


Note: My suggestion is to create a new table that will save the original character's name prior to adding TAGS because with this type of editing that you are doing, it will edit the actual Character Name, thus, if player for example has name 'MIKE' then get that [TAG]MIKE', then when someone uses the created a new character or rename to while your tag system is applied, 'MIKE' name they will taken.

Good luck!
Mike__ is offline  
Thanks
1 User
Old 08/25/2019, 12:47   #10
 
elite*gold: 0
Join Date: Sep 2016
Posts: 141
Received Thanks: 74
Thanks to all reply i already figure out how its work properly using @ codes..

First i go on PS_GameData.dbo.Chars and make new table called CharName_OLD then
Second i go PS_GameData.dbo.usp.Create_Char_R and add CharName_OLD on INSERT and @ on VALUES so if i make new Character New Table have my CharName too..

then i go to PS_GameLog.usp.Action_Log_E and Insert This

Now its work properly.. and thanks to all people helping me,
[GameAdvisor]Finn is offline  
Old 08/25/2019, 14:49   #11
 
elite*gold: 0
Join Date: Sep 2011
Posts: 466
Received Thanks: 343
No need to use Create_Char for it
In my code was mistake
It was:
Quote:
if exists (Select Tag from Chars where [email protected] and Tag is null)
But shoul be:
Quote:
if exists (Select Tag from PS_GameData.dbo.Chars where [email protected] and Tag is null)
I tested it as query with PS_GameData and i forgot it is PS_GameLog
SnickQ is offline  
Thanks
1 User
Old 08/25/2019, 15:52   #12
 
elite*gold: 0
Join Date: Sep 2016
Posts: 141
Received Thanks: 74
Quote:
Originally Posted by SnickQ View Post
No need to use Create_Char for it
In my code was mistake
It was:


But shoul be:


I tested it as query with PS_GameData and i forgot it is PS_GameLog
yes sir but i think that is for 1 tag item only..
because i want to make different item with different tag so that's why i add on Create_Char so its automatic add new CharName on CharName_OLD table

and i already test with different tag item and its work..
[GameAdvisor]Finn is offline  
Old 08/25/2019, 17:09   #13
 
elite*gold: 0
Join Date: Sep 2011
Posts: 466
Received Thanks: 343
In your case you have to add to Name Stone Change update part

Open Proc [dbo].[usp_Save_Char_Name_E]

and find this:
Quote:
UPDATE Chars SET [email protected],RenameCnt=RenameCnt-1,[email protected] WHERE [email protected] AND Del=0
IF @@ERROR <> 0
BEGIN
GOTO ERROR_ROLLBACK
END
And change it to:

Quote:
UPDATE Chars SET [email protected],RenameCnt=RenameCnt-1,[email protected], CharName_OLD = @NewCharName WHERE [email protected] AND Del=0
IF @@ERROR <> 0
BEGIN
GOTO ERROR_ROLLBACK
END

DECLARE @Tag varchar(30) = (Select Tag from Chars where CharID = @CharID)

if exists (Select Tag from Chars where [email protected] and Tag is not null)
begin
UPDATE PS_GameData.dbo.Chars
SET CharName = @Tag + @NewCharName
Where CharID = @CharID
end
With this when players use Name Stone their tag will be added automatically but to see it they have to re open game.exe
SnickQ is offline  
Thanks
1 User
Old 08/25/2019, 17:37   #14
 
elite*gold: 0
Join Date: Sep 2016
Posts: 141
Received Thanks: 74
Quote:
Originally Posted by SnickQ View Post
In your case you have to add to Name Stone Change update part

Open Proc [dbo].[usp_Save_Char_Name_E]

and find this:


And change it to:



With this when players use Name Stone their tag will be added automatically but to see it they have to re open game.exe
Thanks sir.. you help me lot..

i choose to use this only.. because name change stone is normal change name.. so i make it different on tag item.. so if player want to removed their tag.. he can use name change stone..

[GameAdvisor]Finn is offline  
Old 08/25/2019, 17:55   #15
 
elite*gold: 0
Join Date: Sep 2011
Posts: 466
Received Thanks: 343
Quote:
Originally Posted by [GameAdvisor]Finn View Post
Thanks sir.. you help me lot..

i choose to use this only.. because name change stone is normal change name.. so i make it different on tag item.. so if player want to removed their tag.. he can use name change stone..
You can make a new stone that will remove the tag


SnickQ is offline  
Thanks
1 User
Reply

Tags
shaiya



« Map/Portal for Guild or Party only.. | Help me how achieve »

Similar Threads
Shaiya MultiBot v1.6#Auto potion,auto collection,auto stroke,auto skill
06/01/2012 - Shaiya Hacks, Bots, Cheats & Exploits - 12 Replies
http://d1205.hizliresim.com/x/5/5bjkl.jpg Hello everyone friends. I took off and I wanted to share the new version of Hilemizin. Other editions, a new difference: * Layout option 2.Skill. One trick from Image; http://c1205.hizliresim.com/x/4/59sgl.jpg Use the same fashion as yet. Slot {1} / Flat Beat Flat Beat Talent = 1 you put in the game. That it is the other options we.



All times are GMT +2. The time now is 03:46.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

BTC: 33E6kMtxYa7dApCFzrS3Jb7U3NrVvo8nsK
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2019 elitepvpers All Rights Reserved.