Automatically staging sunsets

Newbie Spellweaver
Joined
May 8, 2004
Messages
54
Reaction score
0
If you open RMS_DOITEMGROWTH and replace the procedure with the one below, sunsets will stage automatically every 20 levels. This means that your item will go from 19 to 21 and always be a higher stage (unless it was s4 already), and a lvl 81 item will always be s4 if you manage to get that far without breaking it. You can change it to every 40 levels if you like, just replace the two 20s with 40s in the IF clause (don't forget to do them both or it will be buggy).
Seeing how it's pretty easy to get s2 on an item without cheating, setting it to every 30 or 40 levels will still result in good chances to get a s4.

*code removed due to forum chopping it up, see below*
 
Last edited:
Thanks. I edited it a bit so it no longer goes 19->21 but 20 instead.

 
From looking at the procedure, the actual chances on breaking or staging can't be altered, because when the procedure gets called, the values @next...grade are already defined. They must come from the client itself or something. And if it breaks, I would think that the procedure doesn't get executed at all.

To make it stage every 10 levels, change this row:
IF (@NextLevel/20=Round(@NextLevel/20,0,1)) AND (@NextAttackGrade<4)
into
IF (@NextLevel/10=Round(@NextLevel/10,0,1)) AND (@NextAttackGrade<4)
 
Last edited:
On second thought, it is possible to rewrite the whole procedure so it just ignores the values given by the client, so you can set the staging chance yourself. Can't do anything about the breaking though.
 
There's a bug my adapted procedure, causing sunsets to double-stage for example from 19 upgraded 1-x-x-x-x to 20 augmented with 2-x-x-x-x. This code below will fix that bug.
Code:
CREATE PROCEDURE RMS_DOITEMGROWTH
	@GameID varchar(14),
	@WindowKind	int,
	@WindowIndex	int,
	@ItemKind	int,
	@ItemIndex	int,
	@AttackGrade	int,
	@StrengthGrade	int,
	@SpiritGrade	int,
	@DexterityGrade	int,
	@PowerGrade	int,
	@NextItemKind	int,
	@NextItemIndex	int,
	@NextAttackGrade	int,
	@NextStrengthGrade	int,
	@NextSpiritGrade	int,
	@NextDexterityGrade	int,
	@NextPowerGrade	int
AS

set nocount on

begin transaction
	DECLARE @NextLevel real
	DECLARE @ItemID	int
	SET	@ItemID= 0
	SET 	@NextLevel= @NextAttackGrade+@NextStrengthGrade+@NextSpiritGrade+@NextDexterityGrade+@NextPowerGrade
		
	SELECT TOP 1 @ItemID=ID FROM tblSpecialItem1 WHERE GameID=@GameID AND WindowKind=@WindowKind AND WindowIndex=@WindowIndex AND 
		ItemKind=@ItemKind AND ItemIndex=@ItemIndex AND AttackGrade=@AttackGrade AND StrengthGrade=@StrengthGrade AND SpiritGrade=@SpiritGrade AND DexterityGrade=@DexterityGrade AND PowerGrade=@PowerGrade AND Position=1

	IF @ItemID > 0
		BEGIN
		IF (@NextLevel/20=Round(@NextLevel/20,0,1)) AND (@NextAttackGrade<4)
			BEGIN
			UPDATE tblSpecialItem1 SET ItemKind=@NextItemKind,ItemIndex=@ItemIndex+20,AttackGrade=@AttackGrade+1 WHERE ID=@ItemID
			END	
		ELSE
			BEGIN
			UPDATE tblSpecialItem1 SET ItemKind=@NextItemKind,ItemIndex=@NextItemIndex,AttackGrade=@NextAttackGrade,StrengthGrade=@NextStrengthGrade,SpiritGrade=@NextSpiritGrade,DexterityGrade=@NextDexterityGrade,PowerGrade=@NextPowerGrade WHERE ID=@ItemID
			END
		END

commit transaction
GO
 
Back