mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-01-15 23:04:31 -05:00
Add guild join time tracking for leaderboard qualification
This commit is contained in:
@@ -34,6 +34,7 @@ public class fishing extends script.base_script {
|
||||
public static final String OBJVAR_ELUSIVE_FISH_COUNT_TABLE_MADE = "elusive_fish.count_table_made";
|
||||
public static final String OBJVAR_ELUSIVE_FISH_COUNT_TOTAL= "elusive_fish.count_rewarded_total";
|
||||
public static final String OBJVAR_PLANET_OBJECT_REFERENCE = "master_fishing_object";
|
||||
public static final String OBJVAR_LARGEST_FISH_CAUGHT_THIS_PERIOD = "fishing.record_fish_current_max";
|
||||
|
||||
/**
|
||||
* getMasterFishingObject
|
||||
@@ -322,4 +323,20 @@ public class fishing extends script.base_script {
|
||||
return d;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if you are eligible to contribute to your city's fishing score in the current period
|
||||
* Based on the requirement that: You must have a declared residence in the city, and you must not have moved during the current period
|
||||
*/
|
||||
public static boolean isCityMemberEligibleToContributeToCityFishingScore(obj_id player) throws InterruptedException {
|
||||
return (getCitizenOfCityId(player) > 0) && (getIntObjVar(player, player_structure.VAR_RESIDENCE_CAN_DECLARE) > (getGameTime() + 25200));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if you are eligible to contribute to your guild's fishing score in the current period
|
||||
* Based on the requirement that you must be a member of a guild and held that membership for longer than the current period
|
||||
*/
|
||||
public static boolean isGuildMemberEligibleToContributeToGuildFishingScore(obj_id player) throws InterruptedException {
|
||||
return (getGuildId(player) > 0) && (getIntObjVar(player, guild.VAR_TIME_JOINED_CURRENT_GUILD) > (getGameTime() + 25200));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -234,6 +234,8 @@ public class guild extends script.base_script
|
||||
public static final int INTERFACE_GUILD_PERMISSION_LIST = 4;
|
||||
public static final int INTERFACE_GUILD_ELECTION = 5;
|
||||
public static final int INTERFACE_GUILD_WAR_PREFERENCES = 6;
|
||||
public static final String VAR_TIME_JOINED_CURRENT_GUILD = "guild.timeJoinedCurrentGuild";
|
||||
|
||||
public static String resolveGuildName(int guildId) throws InterruptedException
|
||||
{
|
||||
if (guildId != 0)
|
||||
@@ -517,6 +519,7 @@ public class guild extends script.base_script
|
||||
messageTo(memberId, "onGuildSponsorVerifyResponseProse", dict2, 0, false);
|
||||
mailToGuild(guildId, GUILD_MAIL_ACCEPT_SUBJECT, GUILD_MAIL_ACCEPT_TEXT, getName(actor), memberName);
|
||||
guildSetMemberPermissionAndAllegiance(guildId, memberId, GUILD_PERMISSION_MEMBER, guildGetLeader(guildId));
|
||||
setObjVar(memberId, VAR_TIME_JOINED_CURRENT_GUILD, getGameTime());
|
||||
mailToPerson(guildId, memberName, GUILD_MAIL_ACCEPT_TARGET_SUBJECT, GUILD_MAIL_ACCEPT_TARGET_TEXT, getName(actor), guildGetName(guildId));
|
||||
messageTo(memberId, "onGuildCreateTerminalDataObject", null, 0, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user