Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // https://rathena.org/board/topic/107002-want-to-make-script-comeback-is-real-npc/
- /*
- ALTER TABLE `login` ADD `last_login_date` DATETIME;
- UPDATE `login` SET `last_login_date` = `last_login` WHERE `last_login_date` IS NULL
- */
- - script sample -1,{
- OnInit:
- .day_count = 365;
- end;
- OnPCLoginEvent:
- // sleep2 1000;
- query_sql("SELECT DATEDIFF(CURRENT_DATE, `last_login_date`) FROM `login` WHERE `account_id` = "+getcharid(3)+" LIMIT 1", .@daycount);
- if (.@daycount && .@daycount >= .day_count && .day_count) {
- getitem 512, 1;
- getitem 512, 2;
- getitem 512, 3;
- mes "You gained rewards for comeback after "+.day_count+" day(s).";
- close;
- }
- end;
- OnPCLogoutEvent:
- query_sql("UPDATE `login` SET `last_login_date` = CURRENT_DATE WHERE `account_id` = "+getcharid(3)+" LIMIT 1");
- end;
- }
Add Comment
Please, Sign In to add comment