@@ -39,6 +39,7 @@ import constants.ServerConstants;
|
||||
import net.server.coordinator.MapleInviteCoordinator;
|
||||
import net.server.coordinator.MapleInviteCoordinator.InviteResult;
|
||||
import net.server.coordinator.MapleInviteCoordinator.InviteType;
|
||||
import net.server.coordinator.MapleInviteCoordinator.MapleInviteResult;
|
||||
import tools.Pair;
|
||||
|
||||
/**
|
||||
@@ -476,9 +477,9 @@ public class MapleTrade {
|
||||
}
|
||||
|
||||
public static void visitTrade(MapleCharacter c1, MapleCharacter c2) {
|
||||
Pair<InviteResult, MapleCharacter> inviteRes = MapleInviteCoordinator.answerInvite(InviteType.TRADE, c1.getId(), c2.getId(), true);
|
||||
MapleInviteResult inviteRes = MapleInviteCoordinator.answerInvite(InviteType.TRADE, c1.getId(), c2.getId(), true);
|
||||
|
||||
InviteResult res = inviteRes.getLeft();
|
||||
InviteResult res = inviteRes.result;
|
||||
if (res == InviteResult.ACCEPTED) {
|
||||
if (c1.getTrade() != null && c1.getTrade().getPartner() == c2.getTrade() && c2.getTrade() != null && c2.getTrade().getPartner() == c1.getTrade()) {
|
||||
c2.getClient().announce(MaplePacketCreator.getTradePartnerAdd(c1));
|
||||
@@ -499,7 +500,7 @@ public class MapleTrade {
|
||||
if (trade != null) {
|
||||
if (trade.getPartner() != null) {
|
||||
MapleCharacter other = trade.getPartner().getChr();
|
||||
if (MapleInviteCoordinator.answerInvite(InviteType.TRADE, c.getId(), other.getId(), false).getLeft() == InviteResult.DENIED) {
|
||||
if (MapleInviteCoordinator.answerInvite(InviteType.TRADE, c.getId(), other.getId(), false).result == InviteResult.DENIED) {
|
||||
other.message(c.getName() + " has declined your trade request.");
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ package server.life;
|
||||
import client.MapleBuffStat;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.MapleFamilyEntry;
|
||||
import client.MapleJob;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
@@ -522,6 +523,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
float bonusExp = partyBonusMod * playerExp;
|
||||
|
||||
this.giveExpToCharacter(chr, playerExp, bonusExp, whiteExpGain, hasPartySharers);
|
||||
giveFamilyRep(chr.getFamilyEntry());
|
||||
}
|
||||
|
||||
private void distributePartyExperience(Map<MapleCharacter, Long> partyParticipation, float expPerDmg, Set<MapleCharacter> underleveled, Map<Integer, Float> personalRatio, double sdevRatio) {
|
||||
@@ -548,7 +550,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
int totalPartyLevel = 0;
|
||||
|
||||
// thanks G h o s t, Alfred, Vcoc, BHB for poiting out a bug in detecting party members after membership transactions in a party took place
|
||||
if (!ServerConstants.USE_ENFORCE_MOB_LEVEL_RANGE) {
|
||||
if (ServerConstants.USE_ENFORCE_MOB_LEVEL_RANGE) {
|
||||
for (MapleCharacter member : partyParticipation.keySet().iterator().next().getPartyMembersOnSameMap()) {
|
||||
if (!leechInterval.inInterval(member.getLevel())) {
|
||||
underleveled.add(member);
|
||||
@@ -574,6 +576,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
|
||||
for (MapleCharacter mc : expMembers) {
|
||||
distributePlayerExperience(mc, participationExp, partyBonusMod, totalPartyLevel, mc == participationMvp, isWhiteExpGain(mc, personalRatio, sdevRatio), hasPartySharers);
|
||||
giveFamilyRep(mc.getFamilyEntry());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,6 +952,14 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
listener.monsterHealed(trueHeal);
|
||||
}
|
||||
}
|
||||
|
||||
private void giveFamilyRep(MapleFamilyEntry entry) {
|
||||
if(entry != null) {
|
||||
int repGain = isBoss() ? ServerConstants.FAMILY_REP_PER_BOSS_KILL : ServerConstants.FAMILY_REP_PER_KILL;
|
||||
if(getMaxHp() <= 1) repGain = 0; //don't count trash mobs
|
||||
entry.giveReputationToSenior(repGain, true);
|
||||
}
|
||||
}
|
||||
|
||||
public int getHighestDamagerId() {
|
||||
int curId = 0;
|
||||
|
||||
Reference in New Issue
Block a user