• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Stored Procedure] Animal Upgrade

Experienced Elementalist
Joined
Apr 16, 2007
Messages
266
Reaction score
61
What this does, once run, is based on level and egg grade.

If your level is between 11 and 30 and eggrade is less than 11 then your egg is upgraded to 11 aka baby animal

If your level is between 29 and 50 and eggrade is less than 21 then your egg is upgraded to 21 aka young adult

If your level is between 49 and 70 and eggrade is less than 31 then your egg is upgraded to 31 aka mature adult

If your level is between 69 and 90 and eggrade is less than 41 then your egg is upgraded to 41 aka full adult

Now this is easily adjustable, change the procedure to fit your needs.

USE [kal_db]
GO
/****** Object: StoredProcedure [dbo].[AnimalUpgrade] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AnimalUpgrade]
AS
BEGIN

declare @pid int
declare @IID int
declare level int
declare Index int
declare MaxEnd int

DECLARE player_eggs CURSOR FOR
select a.PID,a.Level, b.IID, b.[Index], b.MaxEnd
from Player a
inner join Item b on b.PID = a.PID
where b.[Index] = 339
or b.[Index] = 337
or b.[Index] = 338

OPEN player_eggs
FETCH NEXT FROM player_eggs INTO @pid, level, @IID, Index, MaxEnd

WHILE @@FETCH_STATUS = 0
BEGIN
if level > 11 and level < 30 and MaxEnd < 11
Update Item
Set MaxEnd = 11
where PID = @pid
and IID = @IID

if level > 29 and level < 50 and MaxEnd < 21
Update Item
Set MaxEnd = 21
where PID = @pid
and IID = @IID

if level > 49 and level < 70 and MaxEnd < 31
Update Item
Set MaxEnd = 31
where PID = @pid
and IID = @IID

if level > 69 and level < 90 and MaxEnd < 41
Update Item
Set MaxEnd = 41
where PID = @pid
and IID = @IID
END

close player_eggs
deallocate player_eggs

END
 

Xca

Experienced Elementalist
Joined
Apr 1, 2011
Messages
206
Reaction score
93
very interesting that someone was compelled to edit the egg grades.
to take it a step further, it would be cool if higher tiers added extra stats
 
Back
Top