unique points logger for pservercms tables

12/24/2018 20:29 m1xawy#1
i think someone will need it : )

Add this to _AddLogChar
and change srZor_uniques to your uses table logger

Code:
declare @killer varchar(max) = (select CharName from SRO_VT_ACCOUNT..srZor_uniques where id=(select max (id) from SRO_VT_ACCOUNT..srZor_uniques))
declare @uniquekilled varchar(max) = (select mobname from SRO_VT_ACCOUNT..srZor_uniques where id=(select max (id) from SRO_VT_ACCOUNT..srZor_uniques))
declare @killercharid int = (select charid from SRO_VT_SHARD.._char where charname16=@killer)
declare @uniqueid int = (select id from SRO_VT_SHARD.._refobjcommon where codename128 = @uniquekilled and service =1 )
DECLARE @killerPoint int =(Select points From SRO_VT_SHARD.dbo._UniqueRanking Where CharID = @killercharid )
DECLARE @killerguildid  int =(Select GuildID From SRO_VT_SHARD.._char Where CharID = @killercharid )
DECLARE @killerguildname varchar(max) =(Select Name From SRO_VT_SHARD.dbo._Guild Where ID = @killerguildid  )

if @eventid in (4,6,9,11,10) AND (select count(*)from SRO_VT_ACCOUNT..srZor_uniques ) > 0
begin
declare @uniquePoint int = 0
-- this is unique points logger for pservercms by mixawy
if @uniqueid = 14936 begin-- lvy  ----normal uniques
SET @uniquePoint = 5 END
if @uniqueid = 1954 begin --tiger
SET @uniquePoint = 5 END
if @uniqueid = 5871 begin --kerberos
SET @uniquePoint = 5 END
if @uniqueid = 2002 begin --isyutaru
SET @uniquePoint = 5 END
if @uniqueid = 1982 begin --uruchi
SET @uniquePoint = 6 END
if @uniqueid = 3875 begin --demon
SET @uniquePoint = 10 END
if @uniqueid = 3810 begin --lord
SET @uniquePoint = 8 END
if @uniqueid = 14995 begin-- snake 
SET @uniquePoint = 10 END
if @uniqueid = 22891 begin --medusa --big uniques
SET @uniquePoint = 20 END
if @uniqueid = 3877 begin  --roc
SET @uniquePoint = 100 END

/*  insert */
if @uniquePoint >0 and @killerguildid >0 and (not exists (select charid from SRO_VT_SHARD.._UniqueRanking where CharID = @killercharid) ) begin
insert into SRO_VT_SHARD.._UniqueRanking (CharID,CodeName128,points) values (@killercharid,@killerguildname,@uniquePoint) 
end
else if @uniquePoint >0 and @killerguildid =0 and (not exists (select charid from SRO_VT_SHARD.._UniqueRanking where CharID = @killercharid) ) begin
insert into SRO_VT_SHARD.._UniqueRanking (CharID,CodeName128,points) values (@killercharid,0,@uniquePoint) 
end

/*  update */
else if @killerguildid >0 and (exists (select charid from SRO_VT_SHARD.._UniqueRanking where CharID = @killercharid)) begin
UPDATE SRO_VT_SHARD.dbo._UniqueRanking SET CodeName128 = @killerguildname Where CharID = @killercharid 
end
else if @uniquePoint >0 and (exists (select charid from SRO_VT_SHARD.._UniqueRanking where CharID = @killercharid)) begin
UPDATE SRO_VT_SHARD.dbo._UniqueRanking SET points = @killerPoint +@uniquePoint Where CharID = @killercharid 
end

/* uniquekilllist & clean */
insert into SRO_VT_SHARD.._UniqueKillList (CharID,CodeName128,time) VALUES (@killercharid,@uniquekilled,Getdate())
delete from SRO_VT_ACCOUNT..srZor_uniques where id=(select max (id) from SRO_VT_ACCOUNT..srZor_uniques)
end
_Uniqueinfo

Code:
USE [SRO_VT_SHARD]
GO

INSERT INTO [dbo].[_UniqueInfo]
           ([CodeName128]
           ,[Name])
     VALUES
	('MOB_CH_TIGERWOMAN', 'Tiger Girl'),
	('MOB_EU_KERBEROS', 'Cerberus'),
	('MOB_AM_IVY', 'Captain Ivy'),
	('MOB_OA_URUCHI', 'Uruchi'),
	('MOB_KK_ISYUTARU', 'Isyutaru'),
	('MOB_TK_BONELORD', 'Lord Yarkan'),
	('MOB_RM_TAHOMET', 'Demon Shaitan'),
	('MOB_JUPITER_GRIFFIN', 'Griffin'),
	('MOB_JUPITER_YUNO', 'Yuno'),
	('MOB_JUPITER_JUPITER', 'Jupiter'),
	('MOB_JUPITER_BABILION', 'Babilion'),
	('MOB_JUPITER_BAAL', 'Baal'),
	('MOB_JUPITER_DARK_DOG', 'Zielkiaxe'),
	('MOB_ARABIA_VENEFICA', 'Arabian Venefica (S'),
	('MOB_ARABIA_HARRISON', 'Arabian Harrison'),
	('MOB_ARABIA_LAUNATUNE', 'Arabian Launatune'),
	('MOB_ARABIA_VENEFICA_DEMON', 'Arabian Demon Venefica'),
	('MOB_ARABIA_GEENIE', 'Arabian Geenie');

GO
12/24/2018 20:37 XxGhostSpiriTxX#2
thanks bro
12/24/2018 22:52 Worshiper#3
thanks for it
12/25/2018 02:02 m1xawy#4
Quote:
Originally Posted by esteve458 View Post
thanks bro
<3

Quote:
Originally Posted by [GM]Dejo View Post
thanks for it
<3
12/25/2018 02:48 !Apple#5
thanks best friend
12/25/2018 06:44 SubZero**#6
good work
12/25/2018 12:28 topaz..#7
nice job
12/25/2018 16:10 m1xawy#8
Quote:
Originally Posted by Dryes* View Post
thanks best friend
u r more than friend : )

Quote:
Originally Posted by Zoro.Sro View Post
good work
thanx bro, have to nice day : )

Quote:
Originally Posted by midnight.. View Post
nice job
love you < 3 : )
12/25/2018 18:10 elmagico321#9
nice work bro but i think making uniquePoint can be set from the table where the id and unqiue name is will be better
12/25/2018 19:51 m1xawy#10
Quote:
Originally Posted by elmagico321 View Post
nice work bro but i think making uniquePoint can be set from the table where the id and unqiue name is will be better
thanx bro. and yes your idea is a better but ithink each servers use normal uniques only in ranking , that as easy.
this code will up to apply its but not ful for use (writing on mob : )

Code:
ALTER TABLE SRO_VT_SHARD.dbo._UniqueInfo ADD Point int NOT NULL DEFAULT 0;

declare @uniquePoint int = (select Point from SRO_VT_SHARD.._UniqueInfo where CodeName128 = @uniquekilled)

if (exists (select CodeName128 from SRO_VT_SHARD.._UniqueInfo where CodeName128 = @uniquekilled)) begin
UPDATE SRO_VT_SHARD.dbo._UniqueRanking SET points = @killerPoint +@uniquePoint Where CharID = @killercharid 
end
12/26/2018 05:29 im.Midgar#11
gj bruh :)
07/28/2023 03:12 carlosxd123#12
I have done everything and the unique ranking still does not work, which tables should I migrate? srzor_unique which table should i add there
07/28/2023 09:29 m1xawy#13
Quote:
Originally Posted by carlosxd123 View Post
I have done everything and the unique ranking still does not work, which tables should I migrate? srzor_unique which table should i add there
LOL, you still using srZor game server : )