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
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
[Release] PServerCMS a Website for your PServer 09/30/2019 - SRO PServer Guides & Releases - 467 Replies FEATURES:
News (modification in admin-panel)
ServerInfo (modification in admin-panel) include PlayerOnline
ServerTimes (modification in config)
Download (modification in admin-panel)
Ranking (TopGuild|TopPlayer) with detail pages
Char search
ServerInfoPages (modification in admin-panel, possible to add more dynamic)
Install PServerCMS 03/02/2019 - SRO Private Server - 2 Replies Someone can install me PServerCMS on my server?
Pls pm me!