I'm posting my solution. I didn't modify the //setdonator command, since I wanted to grant yourself the donator status using my website, but this is the easy party.
First, run this SQL command:
ALTER TABLE `characters_custom_data` ADD COLUMN `donator_end_date` int(11) UNSIGNED NULL AFTER `hero_end_date`;
Then apply these patches (or make the changes manually, because my files are edited)
gameserver/handler/admincommandhandlers/AdminDonator.java:
### Eclipse Workspace Patch 1.0
#P L2J_Mobius_C6_Interlude
diff --git java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminDonator.java java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminDonator.java
index 1cd8f34..9a69bda 100644
--- java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminDonator.java
+++ java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminDonator.java
@@ -153,7 +153,7 @@
}
String INSERT_DATA = "REPLACE INTO characters_custom_data (obj_Id, char_name, hero, noble, donator) VALUES (?,?,?,?,?)";
- String DEL_DATA = "UPDATE characters_custom_data SET donator = 0 WHERE obj_Id=?";
+ String DEL_DATA = "UPDATE characters_custom_data SET donator = 0, donator_end_date = null WHERE obj_Id=?";
@Override
public String[] getAdminCommandList()
gameserver/model/actor/instance/PlayerInstance.java:
### Eclipse Workspace Patch 1.0
#P L2J_Mobius_C6_Interlude
diff --git java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index bf98275..3df945d 100644
--- java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -239,7 +239,7 @@
/** SQL queries */
private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,pc_point=?,name_color=?,title_color=?,aio=?,aio_end=? WHERE obj_id=?";
private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon,punish_level,punish_timer,newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,pc_point,name_color,title_color,first_log,aio,aio_end FROM characters WHERE obj_id=?";
- private static final String STATUS_DATA_GET = "SELECT hero, noble, donator, hero_end_date FROM characters_custom_data WHERE obj_Id = ?";
+ private static final String STATUS_DATA_GET = "SELECT hero, noble, donator, hero_end_date, donator_end_date FROM characters_custom_data WHERE obj_Id = ?";
private static final String RESTORE_SKILLS_FOR_CHAR_ALT_SUBCLASS = "SELECT skill_id,skill_level FROM character_skills WHERE char_obj_id=? ORDER BY (skill_level+0)";
private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC";
private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
@@ -15014,6 +15025,7 @@
int hero = 0;
int noble = 0;
int donator = 0;
+ long donatorEnd = 0;
long heroEnd = 0;
try (Connection con = DatabaseFactory.getConnection())
@@ -15029,6 +15041,7 @@
noble = rset.getInt("noble");
donator = rset.getInt("donator");
heroEnd = rset.getLong("hero_end_date");
+ donatorEnd = rset.getLong("donator_end_date");
}
rset.close();
statement.close();
@@ -15054,7 +15067,7 @@
setNoble(true);
}
- if (donator > 0)
+ if ((donator > 0) && ((donatorEnd * 1000) > System.currentTimeMillis()))
{
setDonator(true);
}
The only thing that is missing, is to edit gameserver/handler/admincommandhandlers/AdminDonator.java and do the following:
Check for a second argument, which is an int for days. Multiply this int with 86400, which is the amount in seconds. Then add this amount to the current timestamp. Eg current timestamp is 1595965496. So for +7 days, it would be 1596570296. Then just save this to the donator_end_date column from the updateDatabase function.
I hope this helps.