Hourly Reward

SIM

Newbie Spellweaver
Joined
Aug 22, 2014
Messages
15
Reaction score
20
Have you ever wanted to have a hourly reward system in your server, but you don't know where to start??

Okey here an few steps of example..

Step1. Let's add new column in the cabal_character_table its because maybe the PlayTime column might be already in used for other function on your server.
Code:
ALTER TABLE cabal_character_table
ADD [HourPlay] [INT] NOT NULL CONSTRAINT [DEF_HourPlay] DEFAULT ((0)) --This is SQL 2012 style

Step2. Let's create a stored procedure 'cabal_sp_hourly_auto_reward' under SERVER01.

In this case we are filtering the character who has the minimum of 6 hours of total played time and the reward amount of cash given is depending on how many players is online on the character re/logged-in time. Before the character is flag to be rewarded his HourPlay will be reset to 0 to avoid abuse. It will send a notification email to the character if he/she has been rewarded.

Step3. Now let's add our store procedure in the get_cabal_character default sp.
Modify
get_cabal_character and find SET NOCOUNT ON and insert this line before him.
Code:
EXEC dbo.[cabal_sp_hourly_auto_reward] @[I][B][URL="http://forum.ragezone.com/members/1333352388.html"]Character[/URL][/B][/I]idx

Step4. I forgot to put this xD...
Modify the existing sp set_cabal_character, find PLAYTIME = PLAYTIME + and this below to him.
Code:
HOURPLAY = HOURPLAY + DATEDIFF(MINUTE, LOGOUTTIME, @[I][B][URL="http://forum.ragezone.com/members/756596.html"]update[/URL][/B][/I]TIME),

Since this query is counting the total online characters then you must have the accurate count of total online characters. Click Here.
 
Last edited:

SIM

Newbie Spellweaver
Joined
Aug 22, 2014
Messages
15
Reaction score
20
First post updated for the missing Step4 >.<
 
Newbie Spellweaver
Joined
Aug 21, 2012
Messages
17
Reaction score
2

Does anyone know to solve this error
 
Newbie Spellweaver
Joined
Aug 29, 2011
Messages
53
Reaction score
3
Step3. Now let's add our store procedure in the get_cabal_character default sp.
Modify get_cabal_character and find SET NOCOUNT ON and insert this line before him.


Code:
EXEC dbo.[cabal_sp_hourly_auto_reward] Characteridx


get_cabal_character and

Hello, I won't here, can you teach me where?
 
Joined
Aug 3, 2011
Messages
963
Reaction score
507

Find get_cabal_character on stored procedure of your SERVER01 then modify