mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-01-17 00:05:07 -05:00
When receiving a COMPNOR experience bonus from a destroy mission, your pet will now also receive 50% of the experience needed for the pets current level.
https://github.com/SWG-Source/qa-testing/issues/286
This commit is contained in:
@@ -1940,6 +1940,41 @@ public class beast_lib extends script.base_script
|
||||
setBeastExperience(beast, experience);
|
||||
setBCDBeastExperience(bcd, experience);
|
||||
}
|
||||
public static void incrementBeastExperienceMission(obj_id beast, int xpAmountToGrant) throws InterruptedException {
|
||||
if (!isValidBeast(beast)) {
|
||||
return;
|
||||
}
|
||||
int experience = getBeastExperience(beast);
|
||||
int previousExperience = experience;
|
||||
obj_id bcd = getBeastBCD(beast);
|
||||
if (!isValidBCD(bcd)) {
|
||||
return;
|
||||
}
|
||||
float happinessAdjustment = (getBCDBeastHappiness(bcd) / 100.0f) + 1.0f;
|
||||
if (happinessAdjustment > 1.5f) {
|
||||
happinessAdjustment = 1.5f;
|
||||
} else if (happinessAdjustment < 0.5f) {
|
||||
happinessAdjustment = 0.5f;
|
||||
}
|
||||
float percentageBonuses = happinessAdjustment;
|
||||
if (buff.hasBuff(beast, "bm_beast_steroid")) {
|
||||
percentageBonuses += 0.01f * utils.getIntScriptVar(beast, "beastBuff.beastXpBonusPercent");
|
||||
}
|
||||
obj_id master = getMaster(beast);
|
||||
if (isValidPlayer(master)) {
|
||||
int experienceGain = Math.round(xpAmountToGrant * percentageBonuses);
|
||||
experienceGain += experienceGain * 0.01f * getEnhancedSkillStatisticModifierUncapped(master, "bm_xp_mod_boost");
|
||||
int multiplier = utils.stringToInt(getConfigSetting("GameServer", "xpMultiplier"));
|
||||
if (multiplier > 1) {
|
||||
experienceGain *= multiplier;
|
||||
}
|
||||
experience += experienceGain;
|
||||
prose_package pp = prose.getPackage(xp.SID_FLYTEXT_XP, experience - previousExperience);
|
||||
showFlyTextPrivate(beast, master, pp, 2.5f, new color(180, 60, 240, 255));
|
||||
}
|
||||
setBeastExperience(beast, experience);
|
||||
setBCDBeastExperience(bcd, experience);
|
||||
}
|
||||
public static void incrementBeastLevel(obj_id beast) throws InterruptedException
|
||||
{
|
||||
if (!isValidBeast(beast))
|
||||
|
||||
@@ -158,8 +158,10 @@ public class mission_base extends script.base_script
|
||||
}
|
||||
float divisor = missions.alterMissionPayoutDivisorDaily(objPlayer);
|
||||
intReward = intReward / (int)divisor;
|
||||
if (missions.canEarnDailyMissionXp(objPlayer) && missions.isDestroyMission(objMissionData))
|
||||
{
|
||||
if (missions.canEarnDailyMissionXp(objPlayer) && missions.isDestroyMission(objMissionData)){
|
||||
if (beast_lib.isBeastMaster(objPlayer) && beast_lib.hasActiveBeast(objPlayer)) {
|
||||
beast_lib.incrementBeastExperienceMission(beast_lib.getBeastOnPlayer(objPlayer), xp.getMissionXpAmount(objPlayer, intPlayerDifficulty));
|
||||
}
|
||||
xp.grantMissionXp(objPlayer, intPlayerDifficulty);
|
||||
}
|
||||
transferBankCreditsFromNamedAccount(money.ACCT_MISSION_DYNAMIC, objPlayer, intReward, "testSuccess", "testFail", dctParams);
|
||||
|
||||
Reference in New Issue
Block a user