Register for your free account! | Forgot your password?

You last visited: Today at 14:43

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Daily/Monthly] Quests Shaiya

Discussion on [Daily/Monthly] Quests Shaiya within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
LibPor22's Avatar
 
elite*gold: 0
Join Date: Apr 2019
Posts: 42
Received Thanks: 2
Post [Daily/Monthly] Quests Shaiya

Hi, does anyone have any idea how to do a quest that can be repeated, daily, weekly or monthly ?

Thank you.
LibPor22 is offline  
Old 10/02/2019, 08:28   #2
 
elite*gold: 130
Join Date: Jan 2014
Posts: 54
Received Thanks: 43
I have not tried it myself, but you could add two columns to the CharQuests table, the first one being "Repeat" with type int, there you could add 1, 7, 30 depending on what you want and another column named "FinishTime" as datetime.

First we need to look at [usp_Save_Char_Quest_Add_E], with this procedure, we will add the information about whether it is a daily, weekly, or monthly quest (1,7,30) depending on questid.

The second procedure selects the value that we inserted before(1,7,30 - daily, weekly, monthly...) and adds a datetime to the column "FinishTime" of the future (1 --> 1 day ahead, 7 --> 7 days ahead...etc.)

The third reads the charquests and only select those quests where FinishTime is not in the future, but in the present.

start with this procedure [usp_Save_Char_Quest_Add_E]:
Quote:
...
SET NOCOUNT ON
IF @QuestID IN (1,2,3)
BEGIN
INSERT INTO CharQuests(CharID,QuestID,[Delay],Count1,Count2,Count3,Repeat) VALUES(@CharID,@QuestID,@Delay,@Count1,@Count2,@Co unt3,1)
END
ELSE IF @QuestID IN (4,5,6)
BEGIN
INSERT INTO CharQuests(CharID,QuestID,[Delay],Count1,Count2,Count3,Repeat) VALUES(@CharID,@QuestID,@Delay,@Count1,@Count2,@Co unt3,7)
END
ELSE IF @QuestID IN (7,8,9)
BEGIN
INSERT INTO CharQuests(CharID,QuestID,[Delay],Count1,Count2,Count3,Repeat) VALUES(@CharID,@QuestID,@Delay,@Count1,@Count2,@Co unt3,30)
END
ELSE
BEGIN
INSERT INTO CharQuests(CharID,QuestID,[Delay],Count1,Count2,Count3) VALUES(@CharID,@QuestID,@Delay,@Count1,@Count2,@Co unt3)
END

IF(@@ERROR = 0)
BEGIN
RETURN 1
END
...
Replace 1,2,3 with the QuestID(s) for 1 day, 4,5,6 with 7 days, 7,8,9 with 30 days.


Then you need to edit this procedure: [usp_Save_Char_FinishedQuest_E] like so

Quote:
...
SET NOCOUNT ON

DECLARE @Repeat int = (SELECT Repeat FROM PS_GameData.dbo.CharQuests WHERE CharID=@CharID AND QuestID=@QuestID)
IF(@Insert = 0)
BEGIN
IF @Repeat = 1
BEGIN
UPDATE CharQuests SET Success=@Success,Finish=1, FinishTime = DATEADD(DD,1,GETDATE()) WHERE CharID=@CharID AND QuestID=@QuestID
END
ELSE IF @Repeat = 7
BEGIN
UPDATE CharQuests SET Success=@Success,Finish=1, FinishTime = DATEADD(DD,7,GETDATE()) WHERE CharID=@CharID AND QuestID=@QuestID
END
ELSE IF @Repeat = 30
BEGIN
UPDATE CharQuests SET Success=@Success,Finish=1, FinishTime = DATEADD(MM,1,GETDATE()) WHERE CharID=@CharID AND QuestID=@QuestID
END
ELSE
BEGIN
UPDATE CharQuests SET Success=@Success,Finish=1, FinishTime = GETDATE() WHERE CharID=@CharID AND QuestID=@QuestID
END
END
ELSE
BEGIN
IF @Repeat = 1
BEGIN
INSERT INTO CharQuests(CharID,QuestID,[Delay],Success,Finish,FinishTime) VALUES(@CharID,@QuestID,0,@Success,1,DATEADD(DD,1, GETDATE()))
END
ELSE IF @Repeat = 7
BEGIN
INSERT INTO CharQuests(CharID,QuestID,[Delay],Success,Finish,FinishTime) VALUES(@CharID,@QuestID,0,@Success,1,DATEADD(DD,7, GETDATE()))
END
ELSE IF @Repeat = 30
BEGIN
INSERT INTO CharQuests(CharID,QuestID,[Delay],Success,Finish,FinishTime) VALUES(@CharID,@QuestID,0,@Success,1,DATEADD(MM,30 ,GETDATE()))
END
ELSE
BEGIN
INSERT INTO CharQuests(CharID,QuestID,[Delay],Success,Finish,FinishTime) VALUES(@CharID,@QuestID,0,@Success,1,GETDATE())
END

END

IF(@@ERROR = 0)
BEGIN
RETURN 1
END
...
Lastly, edit this procedure [usp_Read_Char_Quest_R]

Quote:
...
SET NOCOUNT ON

SELECT QuestID, [Delay], Count1, Count2, Count3 FROM CharQuests WHERE CharID=@CharID AND Finish=0 AND Del=0 AND FinishTime < GETDATE()

SET NOCOUNT OFF
...
This method would require that you edit [usp_Save_Char_Quest_Add_E] every time you add a new "daily, weekly or monthly" quest. You could also add an additional table to store all questIDs that are in that way "repeatable" after a certain amount of time.
I haven't tested it yet, but thought about it for a while and just edited the procedures for you. Maybe you can test it and see if it works.

I honestly don't know if this has been posted before, but that's how I would do it.

Also, there are definitely different approaches, if you want to reset those quests (e.g. daily) each day at 12:00 midnight. My approach works with when the quest was actually finished.

Hint about the midnight approach: You could use chatlog or actionlog procedure to reset the quests.
[-Silomatx] is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Selling] PUBG Cheat - Oreo - Daily,Weekly,Monthly
08/23/2018 - PlayerUnknown's Battlegrounds Trading - 6 Replies
Hi All. Test keys are available to test drive the Oreo cheat for 30 minutes. add me to discord. r00t#8167 I will show you my account that i am using with this cheat and stats. I have been using it for a month now. This cheat is aimed for closet hacking and doesn't have flying cars etc. and magic bullets. its Aimbot, ESP, Fight Mode, and MiniMap-Radar on the official PUBG minimap. Choose the style of your play and have fun. This cheat is created by a dev team. and they are very...
[Selling] YouTube with 16k+ subscribers, 300k+ monthly views, $200+ monthly ad revenue and more
02/18/2018 - Social Media Trading - 9 Replies
Stats: https://i.gyazo.com/4077da97cd341a6d3542315fe236c ef2.png Haven't really been uploading for the last month, as I don't really have the time anymore. Got so many projects, and I gotta sell a few of them to keep a focus on the ones I make the most on. Add Skype, or post on thread, and I will PM you.
[RELEASE]BackUp Script Weekly/Daily/Monthly
05/14/2013 - Metin2 PServer Guides & Strategies - 12 Replies
Hey, erstmal vorweg blabla es gibt genug davon ich weiß(oder auch nicht was weiß ich xD) so ich mach es mal kurz: Script: dir=/home/backup gamedir=/home/game



All times are GMT +2. The time now is 14:43.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.