Jump to content

Release: Sader Attendance Requirement


sader1992

Recommended Posts


  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

Sader Attendance Requirement


this patch make the player must have a variable true to claim his attendance reward

 

the variable is

#Attendance_YYYYMMDD

ofc the variable change each day

this will allow you to create a script to make for example a quest that the player must do every day to claim the attendance

like for example the player must kill 500 monster before he can claim his attendance

or must gather items

or must be x level

or must player x amount of time in the day so he can claim the reward

of all the above

the file include an information script file

that have 2 function , one to set the variable and one to get the variable value (if you want to use them , just add them to your rathena/npc/other/Global_Functions.txt)

it also include 2 example quests for you to get some inspiration to create your own script

 

 

TODO: create function for gepard

 


 

  • Upvote 2
  • Love 1
  • MVP 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

nice this feature good !! for PSRO have multi client so every player must do something before claim the reward ::
thank you sader!!

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  60
  • Reputation:   3
  • Joined:  01/28/12
  • Last Seen:  

How to set this up.. player x amount of time in the day so he can claim the reward

 

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   5
  • Joined:  02/07/12
  • Last Seen:  

@sader1992 I am testing your script and sometimes it says the player has already redeemed the reward without redeeming it. I tested for 20 days and it occurred sometimes. Did you realize that?

"You have already collected your reward today." < The message appears a few times without the player redeeming it.

I created an extra check for Unique_ID when the player logs in:

 


OnPCLoginEvent:

        .@charid = 0;
        query_sql("SELECT `last_unique_id` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'", .@last_unique_id$);
        query_sql("SELECT `char_id` FROM `Attendance_unique_id` WHERE `unique_id` = '"+.@last_unique_id$+"'", .@charid);
        if(.@charid != 0)
        {
            //dispbottom "Attendance has already been collected.";
        }
        else
        {        
            //dispbottom "Attendance ready to be collected.";
            query_sql("delete from `Attendance_unique_id` where `unique_id` = '"+.@last_unique_id$+"'");
            query_sql("INSERT INTO `Attendance_unique_id` (`unique_id`,`char_id`) VALUES ('"+.@last_unique_id$+"', '"+getcharid(0)+"')");
            set_attendance_requirement();
        }

end;

OnClock0001:
    query_sql "TRUNCATE TABLE `Attendance_unique_id`";
end;



 

Edited by Badarosk0
Link to comment
Share on other sites


  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

15 minutes ago, Badarosk0 said:

@sader1992 I am testing your script and sometimes it says the player has already redeemed the reward without redeeming it. I tested for 20 days and it occurred sometimes. Did you realize that?

"You have already collected your reward today." < The message appears a few times without the player redeeming it.

I created an extra check for Unique_ID when the player logs in:

 



OnPCLoginEvent:

        .@charid = 0;
        query_sql("SELECT `last_unique_id` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'", .@last_unique_id$);
        query_sql("SELECT `char_id` FROM `Attendance_unique_id` WHERE `unique_id` = '"+.@last_unique_id$+"'", .@charid);
        if(.@charid != 0)
        {
            //dispbottom "Attendance has already been collected.";
        }
        else
        {        
            //dispbottom "Attendance ready to be collected.";
            query_sql("delete from `Attendance_unique_id` where `unique_id` = '"+.@last_unique_id$+"'");
            query_sql("INSERT INTO `Attendance_unique_id` (`unique_id`,`char_id`) VALUES ('"+.@last_unique_id$+"', '"+getcharid(0)+"')");
            set_attendance_requirement();
        }

end;

OnClock0001:
    query_sql "TRUNCATE TABLE `Attendance_unique_id`";
end;



 

this src mode only allow the player to redeem the reward , it does not auto redeem for the player , the player must redeem the reward hem self

the script you use will allow the first account with the gepard id given to redeem the reward , and if he didn't redeem it with that account , he can't redeem it with another account , he only can redeem it with that account (the first account he login with in the day)

 

 

i will soon create a function for gepard as planed , if you don't want to wait for god knows how long , the key is this , if the player did redeem the reward , the variable #AttendanceDate would be the date of that day

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   5
  • Joined:  02/07/12
  • Last Seen:  

3 hours ago, sader1992 said:

this src mode only allow the player to redeem the reward , it does not auto redeem for the player , the player must redeem the reward hem self

the script you use will allow the first account with the gepard id given to redeem the reward , and if he didn't redeem it with that account , he can't redeem it with another account , he only can redeem it with that account (the first account he login with in the day)

 

 

i will soon create a function for gepard as planed , if you don't want to wait for god knows how long , the key is this , if the player did redeem the reward , the variable #AttendanceDate would be the date of that day

Yes, what I did just allowed him to click if he didn't get another account on the day. But the next day the sql table was deleted. I think what I did has nothing to do with this problem.

Link to comment
Share on other sites

  • 4 years later...

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   1
  • Joined:  11/10/14
  • Last Seen:  

It works great, I'm looking forward to Gepard Function

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...