some text

[ Querys ] - Premiação Top Reset


----------------------------------------------- 
Top Reset Semanal, premiando os 3 primeiros

Use MuOnline

declare @AccountID varchar (10)
declare @AccountID2 varchar (10)
declare @AccountID3 varchar (10)
declare @Name varchar(10)
declare @Name2 varchar(10)
declare @Name3 varchar(10)

Select top 1 @AccountID=AccountID,@Name=Name from Character order by ResetsWeek desc, name desc
Select top 1 @AccountID2=AccountID,@Name2=Name from Character WHERE Name<>@Name order by ResetsWeek desc, name desc
Select top 1 @AccountID3=AccountID,@Name3=Name from Character WHERE Name<>@Name and Name<>@Name2 order by ResetsWeek desc, name desc

UPDATE memb_info set gold=gold+50 WHERE memb___id=@AccountID
UPDATE memb_info set gold=gold+25 WHERE memb___id=@AccountID2
UPDATE memb_info set gold=gold+10 WHERE memb___id=@AccountID3

UPDATE Character SET ResetsWeek = 0

-----------------------------------------------

Top Reset Mensal, premiando os 3 primeiros
Use MuOnline

declare @AccountID varchar (10)
declare @AccountID2 varchar (10)
declare @AccountID3 varchar (10)

declare @Name varchar(10)
declare @Name2 varchar(10)
declare @Name3 varchar(10)

Select top 1 @AccountID=AccountID,@Name=Name from Character order by ResetsMonth desc, name desc
Select top 1 @AccountID2=AccountID,@Name2=Name from Character WHERE Name<>@Name order by ResetsMonth desc, name desc
Select top 1 @AccountID3=AccountID,@Name3=Name from Character WHERE Name<>@Name and Name<>@Name2 order by ResetsMonth desc, name desc

UPDATE memb_info set gold=gold+100 WHERE memb___id=@AccountID
UPDATE memb_info set gold=gold+50 WHERE memb___id=@AccountID2
UPDATE memb_info set gold=gold+25 WHERE memb___id=@AccountID3

UPDATE Character SET ResetsMonth = 0

-----------------------------------------------

Top Reset Diario, premiando os 3 primeiros
Use MuOnline

declare @AccountID varchar (10)
declare @AccountID2 varchar (10)
declare @AccountID3 varchar (10)

declare @Name varchar(10)
declare @Name2 varchar(10)
declare @Name3 varchar(10)

Select top 1 @AccountID=AccountID,@Name=Name from Character order by ResetsDay desc, name desc
Select top 1 @AccountID2=AccountID,@Name2=Name from Character WHERE Name<>@Name order by ResetsDay desc, name desc
Select top 1 @AccountID3=AccountID,@Name3=Name from Character WHERE Name<>@Name and Name<>@Name2 order by ResetsDay desc, name desc

UPDATE memb_info set gold=gold+15 WHERE memb___id=@AccountID
UPDATE memb_info set gold=gold+10 WHERE memb___id=@AccountID2
UPDATE memb_info set gold=gold+5 WHERE memb___id=@AccountID3

UPDATE Character SET ResetsDay = 0

-----------------------------------------------


Obs1:
UPDATE Character SET ResetsWeek = 0
e
UPDATE Character SET ResetsMonth = 0

é da job que zera os tops, no meu caso vou só adicionar o código de premiação logo acima deles no comando da job.

Obs2:
Os dados informados acima servem apenas para efetuar as bonificações e zerar os rankings, tudo automaticamente.

Nenhum comentário:

Anterior Proxima Página inicial