Merge pull request #244 from Reedux/Pet-Changes

Various Pet Changes See Commits for info
This commit is contained in:
John
2021-03-06 15:27:08 -06:00
committed by GitHub
7 changed files with 36 additions and 37 deletions

View File

@@ -749,10 +749,6 @@ public class beast extends script.base_script
sendDirtyObjectMenuNotification(self);
beast_lib.setBCDBeastName(beast_lib.getBeastBCD(self), beastName);
beast_lib.setBeastName(self, beastName);
if (hasObjVar(beast_lib.getBeastBCD(self), beast_lib.OBJVAR_OLD_PET_IDENTIFIER))
{
setObjVar(beast_lib.getBeastBCD(self), beast_lib.OBJVAR_OLD_PET_RENAMED, 1);
}
return SCRIPT_CONTINUE;
}
public int handleGroupInvite(obj_id self, dictionary params) throws InterruptedException

View File

@@ -46,7 +46,6 @@ public class beast_lib extends script.base_script
public static final String OBJVAR_BEAST_PARENT = "beast.parent_creature_template";
public static final String OBJVAR_BEAST_INCUBATION_BONUSES = "beast.incubation_bonuses";
public static final String OBJVAR_OLD_PET_IDENTIFIER = "beast.converted_pet";
public static final String OBJVAR_OLD_PET_RENAMED = "beast.old_pet_renamed";
public static final String OBJVAR_OLD_PET_REHUED = "beast.old_pet_rehued";
public static final String OBJVAR_BEAST_HUE = "beast.hue";
public static final String OBJVAR_BEAST_HUE2 = "beast.hue2";
@@ -175,15 +174,15 @@ public class beast_lib extends script.base_script
public static final String PLAYER_KNOWN_SKILLS_LIST = "beast_master.known_skills";
public static final String ATTENTION_PENALTY_DEBUFF = "bm_attention_penalty_";
public static final string_id SID_BEAST_WILD = new string_id("beast", "beast_wild");
public static final int LOYALTY_LVL_TWO = 2001;
public static final int LOYALTY_LVL_TWO = 1001;
public static final string_id SID_BEAST_DISOBEDIENT = new string_id("beast", "beast_disobedient");
public static final int LOYALTY_LVL_THREE = 10001;
public static final int LOYALTY_LVL_THREE = 5001;
public static final string_id SID_BEAST_TRAINED = new string_id("beast", "beast_trained");
public static final int LOYALTY_LVL_FOUR = 50001;
public static final int LOYALTY_LVL_FOUR = 25001;
public static final string_id SID_BEAST_LOYAL = new string_id("beast", "beast_loyal");
public static final int LOYALTY_LVL_FIVE = 250001;
public static final int LOYALTY_LVL_FIVE = 125001;
public static final string_id SID_BEAST_BFF = new string_id("beast", "beast_bff");
public static final int LOYALTY_MAX = 500000;
public static final int LOYALTY_MAX = 250000;
public static final String BEAST_LOYALTY_TITLE = "beast_loyalty_title";
public static final String BEAST_LOYALTY_PERCENTAGE_TITLE = "beast_loyalty_percentage_title";
public static final String PET_LOYALTY_OBJVAR = "beastmood.beastLoyalty";
@@ -1098,6 +1097,9 @@ public class beast_lib extends script.base_script
modifiedHappiness *= multiplier;
}
float newLoyalty = loyalty + modifiedHappiness;
if (buff.hasBuff(getBCDBeastCalled(bcd), "bm_beast_steroid")) {
newLoyalty *= utils.getIntScriptVar(getBCDBeastCalled(bcd), "beastBuff.beastXpBonusPercent");
}
if (loyalty < LOYALTY_LVL_TWO && newLoyalty >= LOYALTY_LVL_TWO)
{
incrementBeastLoyaltyLevel(bcd);
@@ -1894,7 +1896,7 @@ public class beast_lib extends script.base_script
stop(currentBeast);
storeBeast(bcd);
}
public static void incrementBeastExperience(obj_id beast) throws InterruptedException
public static void incrementBeastExperience(obj_id beast, dictionary params) throws InterruptedException
{
if (!isValidBeast(beast))
{
@@ -1925,6 +1927,9 @@ public class beast_lib extends script.base_script
if (isValidPlayer(master))
{
int experienceGain = Math.round(100 * percentageBonuses);
if (params.containsKey("xpAmount")) {
experienceGain = Math.round(params.getInt("xpAmount") * percentageBonuses);
}
experienceGain += experienceGain * 0.01f * getEnhancedSkillStatisticModifierUncapped(master, "bm_xp_mod_boost");
int multiplier = utils.stringToInt(getConfigSetting("GameServer", "xpMultiplier"));
if (multiplier > 1)
@@ -2001,7 +2006,7 @@ public class beast_lib extends script.base_script
int level = getBeastLevel(beast);
if (level < 90)
{
incrementBeastExperience(beast);
incrementBeastExperience(beast, new dictionary());
}
if (canBeastLevelUp(beast))
{

View File

@@ -321,7 +321,7 @@ public class player_beastmaster extends script.base_script
return;
}
debugSpeakMsg(beast, "Current experience: " + beast_lib.getBeastExperience(beast));
beast_lib.incrementBeastExperience(beast);
beast_lib.incrementBeastExperience(beast, new dictionary());
debugSpeakMsg(beast, "Incremented experience: " + beast_lib.getBeastExperience(beast));
}
public void showHappiness(obj_id self) throws InterruptedException

View File

@@ -13,7 +13,7 @@ public class beast_display extends script.base_script
}
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
{
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED) && getOwner(self) == player)
if (getOwner(self) == player)
{
mi.addRootMenu(menu_info_types.SERVER_MENU3, new string_id("beast", "name_beast"));
}
@@ -22,7 +22,7 @@ public class beast_display extends script.base_script
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
{
sendDirtyObjectMenuNotification(self);
if (item == menu_info_types.SERVER_MENU3 && !hasObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED) && getOwner(self) == player)
if (item == menu_info_types.SERVER_MENU3 && getOwner(self) == player)
{
sui.inputbox(self, player, "@beast:name_d", sui.OK_CANCEL, "@beast:name_t", sui.INPUT_NORMAL, null, "handleSetBeastName", null);
}
@@ -152,7 +152,6 @@ public class beast_display extends script.base_script
}
sendDirtyObjectMenuNotification(self);
setObjVar(self, "beast.beastName", beastName);
setObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED, 1);
setObjVar(self, incubator.DNA_PARENT_NAME, beastName);
return SCRIPT_CONTINUE;
}

View File

@@ -22,12 +22,10 @@ public class decoration_item extends script.base_script
int management_root = mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_CONVERT_PET_ITEM_TO_DNA);
}
}
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_REHUED) && getOwner(self) == player)
{
mi.addRootMenu(menu_info_types.SERVER_MENU2, PCOLOR);
}
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED) && getOwner(self) == player)
{
if (getOwner(self) == player){
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_REHUED)){
mi.addRootMenu(menu_info_types.SERVER_MENU2, PCOLOR);
}
mi.addRootMenu(menu_info_types.SERVER_MENU3, new string_id("beast", "name_beast"));
}
return SCRIPT_CONTINUE;
@@ -43,17 +41,15 @@ public class decoration_item extends script.base_script
return SCRIPT_CONTINUE;
}
}
if (item == menu_info_types.SERVER_MENU2 && getOwner(self) == player)
{
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_REHUED))
{
sui.colorize(self, player, self, hue.INDEX_1, "handlePrimaryColorize");
if (getOwner(self) == player) {
if (item == menu_info_types.SERVER_MENU2) {
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_REHUED)){
sui.colorize(self, player, self, hue.INDEX_1, "handlePrimaryColorize");
}
} else if (item == menu_info_types.SERVER_MENU3) {
sui.inputbox(self, player, "@beast:name_d", sui.OK_CANCEL, "@beast:name_t", sui.INPUT_NORMAL, null, "handleSetBeastName", null);
}
}
if (item == menu_info_types.SERVER_MENU3 && !hasObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED) && getOwner(self) == player)
{
sui.inputbox(self, player, "@beast:name_d", sui.OK_CANCEL, "@beast:name_t", sui.INPUT_NORMAL, null, "handleSetBeastName", null);
}
return SCRIPT_CONTINUE;
}
public int OnInitialize(obj_id self) throws InterruptedException
@@ -146,7 +142,6 @@ public class decoration_item extends script.base_script
}
sendDirtyObjectMenuNotification(self);
setName(self, beastName);
setObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED, 1);
setObjVar(self, incubator.DNA_PARENT_NAME, beastName);
return SCRIPT_CONTINUE;
}

View File

@@ -158,8 +158,12 @@ 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)) {
dictionary returnDict = new dictionary();
returnDict.addInt("xpAmount", xp.getMissionXpAmount(objPlayer, intPlayerDifficulty) / 2);
beast_lib.incrementBeastExperience(beast_lib.getBeastOnPlayer(objPlayer), returnDict);
}
xp.grantMissionXp(objPlayer, intPlayerDifficulty);
}
transferBankCreditsFromNamedAccount(money.ACCT_MISSION_DYNAMIC, objPlayer, intReward, "testSuccess", "testFail", dctParams);

View File

@@ -869,12 +869,12 @@ en_holographic_image en_holographic_image Entertainer:HolographicBackupImage
en_holographic_recall en_holographic_recall Entertainer:RecallHolographicImages STANDARD en_holographic_recall
en_unhealthy_fixation en_unhealthy_fixation Entertainer:UnhealthyFixation STANDARD NON_DAMAGE_ATTACK 1 1 fire_1_single_medium attack_special_knee_strike_medium OFF OFF OFF OFF ON SINGLE_TARGET 30 0 -10 en_unhealthy_fixation_debuff en_unhealthy_fixation_debuff
forceCrystalForce forceCrystalForce FSVillageCrystalProc clienteffect/cyborg_cbt_electric_hit.cef weapon 1 500 1250 100 ELEMENTAL_ELECTRICAL no_proc
bm_soothing_comfort_1 bm_soothing_comfort_1 PetOnlyRemoveHarmful MOB NON_DAMAGE_ATTACK appearance/pt_force_avoid_incapacitation.prt 1 heal_other OFF OFF OFF OFF ON SINGLE_TARGET 64 0 -18 bm_pet_cure bm_cure perform_notarget NO_HIT_SPAM
bm_soothing_comfort_1 bm_soothing_comfort_1 PetOnlyRemoveHarmful MOB NON_DAMAGE_ATTACK appearance/pt_force_avoid_incapacitation.prt 1 heal_other OFF OFF OFF OFF ON SINGLE_TARGET 64 0 -9 bm_pet_cure bm_cure perform_notarget NO_HIT_SPAM
bm_mend_pet_1 bm_mend_pet_1 PetHeal MOB NON_ATTACK HEALTH appearance/pt_heal_over_time_2.prt 1 heal_other OFF OFF OFF OFF ON SINGLE_TARGET 64 1850 0 1 -20 bm_heal perform_notarget
bm_mend_pet_2 bm_mend_pet_2 PetHeal MOB NON_ATTACK HEALTH appearance/pt_heal_over_time_2.prt 1 heal_other OFF OFF OFF OFF ON SINGLE_TARGET 64 2500 0 1 -20 bm_heal perform_notarget
bm_mend_pet_3 bm_mend_pet_3 PetHeal MOB NON_ATTACK HEALTH appearance/pt_heal_over_time_2.prt 1 heal_other OFF OFF OFF OFF ON SINGLE_TARGET 64 3300 0 1 -20 bm_heal perform_notarget
bm_revive_pet_1 bm_revive_pet_1 PetRevive MOB NON_ATTACK appearance/pt_heal_2.prt root 0 0 heal_other OFF OFF OFF OFF ON SINGLE_TARGET 7 -60 bm_revive perform_target
bm_revive_pet_2 bm_revive_pet_2 PetRevive2 MOB NON_ATTACK appearance/pt_heal_2.prt root 0 0 heal_other OFF OFF OFF OFF ON SINGLE_TARGET 7 -40 bm_revive perform_target
bm_revive_pet_1 bm_revive_pet_1 PetRevive MOB NON_ATTACK appearance/pt_heal_2.prt root 0 0 heal_other OFF OFF OFF OFF ON SINGLE_TARGET 7 -30 bm_revive perform_target
bm_revive_pet_2 bm_revive_pet_2 PetRevive2 MOB NON_ATTACK appearance/pt_heal_2.prt root 0 0 heal_other OFF OFF OFF OFF ON SINGLE_TARGET 7 -20 bm_revive perform_target
bm_charge_1 bm_charge_1 STANDARD ATTACK 1 clienteffect/cyborg_cbt_electric_hit.cef 0 0 *creature_attack_ranged OFF OFF OFF OFF OFF SINGLE_TARGET 0 0 5 30 100 40 charge_stun_debuff bm_charge_1_buff 1 100 100 30 beast_only
bm_charge_2 bm_charge_2 STANDARD ATTACK 1 clienteffect/cyborg_cbt_electric_hit.cef 0 0 *creature_attack_ranged OFF OFF OFF OFF OFF SINGLE_TARGET 0 0 5 30 200 40 charge_stun_debuff bm_charge_1_buff 1 225 225 30 beast_only
bm_charge_3 bm_charge_3 STANDARD ATTACK 1 clienteffect/cyborg_cbt_electric_hit.cef 0 0 *creature_attack_ranged OFF OFF OFF OFF OFF SINGLE_TARGET 0 0 5 30 300 40 charge_stun_debuff bm_charge_1_buff 1 500 500 30 beast_only