Jump to content

Recommended Posts

Posted

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
  • 3 weeks later...
  • 3 weeks later...
Posted (edited)

@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
Posted
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

Posted
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.

  • 4 years later...

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...