|
You last visited: Today at 22:02
Advertisement
help auto tag item
Discussion on help auto tag item within the Shaiya PServer Development forum part of the Shaiya Private Server category.
08/23/2019, 19:29
|
#1
|
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
|
help auto tag item
Hi epvp, can i ask if someone help me to fix this..
i have Auto Tag using scroll item
example :
DECLARE @ me varchar(30) SET @ me = (SELECT CharName FROM PS_GameData.dbo.Chars WHERE CharID = @ D) if(@ActionType=112 AND @ =101015)
BEGIN
UPDATE PS_GameData.dbo.Chars SET CharName = '[King]' + @ me WHERE CharID = @ D UPDATE PS_GameData.dbo.Guilds SET MasterName = '[King]' + @ me WHERE MasterCharID = @ D UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[King]' + @ me WHERE FriendID = @ D
END
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..
|
|
|
08/23/2019, 23:56
|
#2
|
elite*gold: 0
Join Date: Jul 2010
Posts: 511
Received Thanks: 513
|
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
|
|
|
08/24/2019, 00:37
|
#3
|
elite*gold: 152
Join Date: Mar 2015
Posts: 149
Received Thanks: 1,274
|
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
|
|
|
08/24/2019, 05:09
|
#4
|
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
|
Quote:
Originally Posted by sominus
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
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..
|
|
|
08/24/2019, 19:07
|
#5
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
|
Quote:
Originally Posted by [GameAdvisor]Finn
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
|
|
|
08/24/2019, 22:02
|
#6
|
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
|
Quote:
Originally Posted by SnickQ
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..
|
|
|
08/25/2019, 00:56
|
#7
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
|
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 CharID=@CharID 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
|
|
|
|
08/25/2019, 04:35
|
#8
|
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
|
Quote:
Originally Posted by SnickQ
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
|
|
|
08/25/2019, 12:17
|
#9
|
elite*gold: 0
Join Date: Oct 2018
Posts: 67
Received Thanks: 28
|
I made something like this before and i guess you can figure it out from here.
UPDATE PS_GameData.dbo.Chars SET CharName = REPLACE @ Name, '[OLDTAG]', ''), WHERE CharID = @ D UPDATE PS_GameData.dbo.Guilds SET MasterName = REPLACE @ Name, '[OLDTAG]', '') WHERE MasterCharID = @ D UPDATE PS_GameData.dbo.FriendChars SET FriendName = REPLACE @ Name, '[OLDTAG]', '') WHERE FriendID = @ D
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!
|
|
|
08/25/2019, 12:47
|
#10
|
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
|
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
DECLARE @ me varchar(30) DECLARE @ me_OLD varchar(30)
SET @ me = (SELECT CharName FROM PS_GameData.dbo.Chars WHERE CharID = @ D) SET @ me_OLD = (SELECT CharName_OLD FROM PS_GameData.dbo.Chars WHERE CharID = @ D)
if(@ActionType=112 AND @ =101015)
BEGIN
UPDATE PS_GameData.dbo.Chars SET CharName = '[King]' + @ me_OLD WHERE CharID = @ D UPDATE PS_GameData.dbo.Guilds SET MasterName = '[King]' + @ me_OLD WHERE MasterCharID = @ D UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[King]' + @ me_OLD WHERE FriendID = @ D
END
Now its work properly.. and thanks to all people helping me,
|
|
|
08/25/2019, 14:49
|
#11
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
|
No need to use Create_Char for it
In my code was mistake
It was:
Quote:
if exists (Select Tag from Chars where CharID=@CharID and Tag is null)
|
But shoul be:
Quote:
if exists (Select Tag from PS_GameData.dbo.Chars where CharID=@CharID and Tag is null)
|
I tested it as query with PS_GameData and i forgot it is PS_GameLog
|
|
|
08/25/2019, 15:52
|
#12
|
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
|
Quote:
Originally Posted by SnickQ
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..
|
|
|
08/25/2019, 17:09
|
#13
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
|
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 CharName=@NewCharName,RenameCnt=RenameCnt-1,OldCharName=@OldCharName WHERE CharID=@CharID AND Del=0
IF @@ERROR <> 0
BEGIN
GOTO ERROR_ROLLBACK
END
|
And change it to:
Quote:
UPDATE Chars SET CharName=@NewCharName,RenameCnt=RenameCnt-1,OldCharName=@OldCharName, CharName_OLD = @NewCharName WHERE CharID=@CharID 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 CharID=@CharID 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
|
|
|
08/25/2019, 17:37
|
#14
|
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
|
Quote:
Originally Posted by SnickQ
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..
UPDATE Chars SET CharName @ Name,RenameCnt=RenameCnt-1,OldCharName=@OldCharName, CharName_OLD = @ Name WHERE CharID=@CharID AND Del=0
IF @@ERROR <> 0
BEGIN
GOTO ERROR_ROLLBACK
END
|
|
|
08/25/2019, 17:55
|
#15
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
|
Quote:
Originally Posted by [GameAdvisor]Finn
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
|
|
|
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 22:02.
|
|