Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/aCis_gameserver/config/ChampionMobs.properties b/aCis_gameserver/config/ChampionMobs.properties
- new file mode 100644
- index 0000000..416848e
- --- /dev/null
- +++ b/aCis_gameserver/config/ChampionMobs.properties
- @@ -0,0 +1,52 @@
- +# ---------------------------------------------------------------------------
- +# Custom - non-retail-like systems that have been integrated into the project.
- +# Be warned that there may be no support for these mods ban the original author's assistance.
- +# ---------------------------------------------------------------------------
- +# Champion mobs - Turn random mobs into Champions
- +# ---------------------------------------------------------------------------
- +
- +# Enable/Disable Champion Mob System.
- +ChampionEnable = True
- +
- +# Force Champion mobs to be passive?
- +# To leave champion mobs to default/Aggressive, set to False.
- +# To set all champion mobs to Passive, set True.
- +ChampionPassive = False
- +
- +# % chance for a mob to became champion (0 to disable).
- +ChampionFrequency = 25
- +
- +# Title of all Champion Mobs.
- +ChampionTitle = *Champion*
- +
- +# Min and max levels allowed for a mob to be a Champion mob.
- +ChampionMinLevel = 75
- +ChampionMaxLevel = 80
- +
- +# Stats Multiplier for Champion mobs.
- +ChampionHp = 20
- +ChampionPatk = 3
- +ChampionPdef = 20
- +ChampionMatk = 5
- +ChampionMdef = 20
- +
- +# XP / SP Multiplier
- +ChampionRewards = 20
- +
- +# Adena rewards multiplier for Champion mobs.
- +ChampionAdenasRewards = 10
- +
- +# Specified reward item ID
- +ChampionRewardItemID = 6673
- +
- +# The amount of the specified reward a player will receive if they are awarded the item.
- +ChampionRewardItemQty = 5
- +
- +# % Chance to obtain a specified reward item from a higher level Champion mob.
- +# Default: 0
- +# not working
- +ChampionRewardLowerLvlItemChance = 100
- +
- +# % Chance to obtain a specified reward item from a lower level Champion mob.
- +# Default: 0
- +ChampionRewardHigherLvlItemChance = 100
- \ No newline at end of file
- diff --git a/aCis_gameserver/java/net/sf/l2j/Config.java b/aCis_gameserver/java/net/sf/l2j/Config.java
- index 1c2cdcb..56e3b0d 100644
- --- a/aCis_gameserver/java/net/sf/l2j/Config.java
- +++ b/aCis_gameserver/java/net/sf/l2j/Config.java
- @@ -714,9 +714,52 @@ public final class Config
- public static int CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN = 1; // default 1
- public static int CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = 1; // default 1
- public static int CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = 5; // default 5
- -
- +
- + /** Champion mobs */
- + public static final String CHAMPION_FILE = "./config/ChampionMobs.properties";
- + public static boolean L2JDEV_CHAMPION_ENABLE;
- + public static boolean L2JDEV_CHAMPION_PASSIVE;
- + public static int L2JDEV_CHAMPION_FREQUENCY;
- + public static String L2JDEV_CHAMP_TITLE;
- + public static int L2JDEV_CHAMP_MIN_LVL;
- + public static int L2JDEV_CHAMP_MAX_LVL;
- + public static int L2JDEV_CHAMPION_HP;
- + public static int L2JDEV_CHAMPION_REWARDS;
- + public static float L2JDEV_CHAMPION_ADENAS_REWARDS;
- + public static float L2JDEV_CHAMPION_ChampionPatk;
- + public static float L2JDEV_CHAMPION_ChampionPdef;
- + public static float L2JDEV_CHAMPION_ChampionMatk;
- + public static float L2JDEV_CHAMPION_ChampionMdef;
- + public static int L2JDEV_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
- + public static int L2JDEV_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
- + public static int L2JDEV_CHAMPION_REWARD_ID;
- + public static int L2JDEV_CHAMPION_REWARD_QTY;
- +
- + public static final void loadChampion() {
- + final ExProperties CHAMPION = initProperties(CHAMPION_FILE);
- +
- + L2JDEV_CHAMPION_ENABLE = CHAMPION.getProperty("ChampionEnable", false);
- + L2JDEV_CHAMPION_PASSIVE = CHAMPION.getProperty("ChampionPassive", false);
- + L2JDEV_CHAMPION_FREQUENCY = CHAMPION.getProperty("ChampionFrequency", 0);
- + L2JDEV_CHAMP_TITLE = CHAMPION.getProperty("ChampionTitle", "Champion");
- + L2JDEV_CHAMP_MIN_LVL = CHAMPION.getProperty("ChampionMinLevel", 20);
- + L2JDEV_CHAMP_MAX_LVL = CHAMPION.getProperty("ChampionMaxLevel", 60);
- + L2JDEV_CHAMPION_HP = CHAMPION.getProperty("ChampionHp", 7);
- + L2JDEV_CHAMPION_ChampionPatk = CHAMPION.getProperty("ChampionPatk", 1);
- + L2JDEV_CHAMPION_ChampionPdef = CHAMPION.getProperty("ChampionPdef", 1);
- + L2JDEV_CHAMPION_ChampionMatk = CHAMPION.getProperty("ChampionMatk", 1);
- + L2JDEV_CHAMPION_ChampionMdef = CHAMPION.getProperty("ChampionMdef", 1);
- + L2JDEV_CHAMPION_REWARDS = CHAMPION.getProperty("ChampionRewards", 8);
- + L2JDEV_CHAMPION_ADENAS_REWARDS = CHAMPION.getProperty("ChampionAdenasRewards", 1);
- +
- + L2JDEV_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = CHAMPION.getProperty("ChampionRewardLowerLvlItemChance", 0);
- + L2JDEV_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = CHAMPION.getProperty("ChampionRewardHigherLvlItemChance", 0);
- + L2JDEV_CHAMPION_REWARD_ID = CHAMPION.getProperty("ChampionRewardItemID", 6393);
- + L2JDEV_CHAMPION_REWARD_QTY = CHAMPION.getProperty("ChampionRewardItemQty", 1);
- +
- + }
- // --------------------------------------------------
- -
- +
- /**
- * Initialize {@link ExProperties} from specified configuration file.
- * @param filename : File name to be loaded.
- @@ -1526,6 +1569,9 @@ public final class Config
- // vote settings
- loadVoteSystem();
- +
- + // load champion inside loadGameServer()
- + loadChampion();
- }
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Attackable.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Attackable.java
- index cb3aad3..a1d31a0 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Attackable.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Attackable.java
- @@ -116,6 +116,19 @@ public class Attackable extends Npc
- ThreadPool.schedule(() -> quest.notifyKill(this, killer), 3000);
- _attackedBy.clear();
- +
- + setChampion(false);
- + if (Config.L2JDEV_CHAMPION_ENABLE) {
- + // Set champion on next spawn
- + if (!(killer instanceof Monster) && (Config.L2JDEV_CHAMPION_FREQUENCY > 0)
- + && (getStatus().getLevel() >= Config.L2JDEV_CHAMP_MIN_LVL)
- + && (getStatus().getLevel() <= Config.L2JDEV_CHAMP_MAX_LVL)) {
- +
- + if (Rnd.get(100) <= Config.L2JDEV_CHAMPION_FREQUENCY) {
- + setChampion(true);
- + }
- + }
- + }
- return true;
- }
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Creature.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Creature.java
- index 2c23a36..5bec8a5 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Creature.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Creature.java
- @@ -169,6 +169,17 @@ public abstract class Creature extends WorldObject {
- return "[Creature objId=" + getObjectId() + "]";
- }
- + private boolean _champion = false;
- +
- + public boolean isChampion() {
- + return _champion;
- + }
- +
- + public void setChampion(boolean chanpion) {
- + _champion = true;
- + _champion = chanpion;
- + }
- +
- /**
- * Set all related {@link Func}s of this {@link Creature}.
- */
- @@ -1593,6 +1604,11 @@ public abstract class Creature extends WorldObject {
- public void reduceCurrentHp(double i, Creature attacker, boolean awake, boolean isDOT, L2Skill skill) {
- getStatus().reduceHp(i, attacker, awake, isDOT, false);
- +
- + if (Config.L2JDEV_CHAMPION_ENABLE && isChampion() && (Config.L2JDEV_CHAMPION_HP != 0)) {
- + getStatus().reduceHp(i / Config.L2JDEV_CHAMPION_HP, attacker, awake, isDOT, false);
- + } else
- + getStatus().reduceHp(i, attacker, awake, isDOT, false);
- }
- /**
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/Monster.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/Monster.java
- index b119ef2..1044a49 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/Monster.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/Monster.java
- @@ -160,6 +160,11 @@ public class Monster extends Attackable {
- exp *= 1 - penalty;
- + if (Config.L2JDEV_CHAMPION_ENABLE && isChampion()) {
- + exp *= Config.L2JDEV_CHAMPION_REWARDS;
- + sp *= Config.L2JDEV_CHAMPION_REWARDS;
- + }
- +
- // Test over-hit.
- if (_overhitState.isValidOverhit(attacker)) {
- attacker.sendPacket(SystemMessageId.OVER_HIT);
- @@ -232,6 +237,11 @@ public class Monster extends Attackable {
- exp *= partyMul;
- sp *= partyMul;
- + if (Config.L2JDEV_CHAMPION_ENABLE && isChampion()) {
- + exp *= Config.L2JDEV_CHAMPION_REWARDS;
- + sp *= Config.L2JDEV_CHAMPION_REWARDS;
- + }
- +
- // Test over-hit.
- if (_overhitState.isValidOverhit(attacker)) {
- attacker.sendPacket(SystemMessageId.OVER_HIT);
- @@ -840,6 +850,9 @@ public class Monster extends Attackable {
- continue;
- dropOrAutoLootItem(player, holder, true);
- +
- + if (holder.getId() == 57)
- + championMobDropAdena(player,holder );
- }
- }
- @@ -853,6 +866,8 @@ public class Monster extends Attackable {
- dropOrAutoLootItem(player, holder, false);
- }
- }
- +
- + championMobDropSpecialItem(player);
- }
- /**
- @@ -923,6 +938,7 @@ public class Monster extends Attackable {
- // Create the ItemInstance and add it in the world as a visible object.
- final ItemInstance item = ItemInstance.create(holder.getId(), holder.getValue(), player, this);
- item.setDropProtection(player.getObjectId(), isRaidBoss());
- + item.setDropProtection(player.getObjectId(), isChampion());
- item.dropMe(this, 70);
- // If stackable, end loop as entire count is included in 1 instance of item.
- @@ -997,4 +1013,34 @@ public class Monster extends Attackable {
- }
- }
- + private void championMobDropSpecialItem(Player player){
- + // Champion mod
- + // Apply Special Item drop with random(rnd) quantity(qty) for champions.
- + if (Config.L2JDEV_CHAMPION_ENABLE && isChampion()
- + && (Config.L2JDEV_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE > 0)) {
- +
- + int champqty = Rnd.get(Config.L2JDEV_CHAMPION_REWARD_QTY);
- + IntIntHolder item = new IntIntHolder(Config.L2JDEV_CHAMPION_REWARD_ID, champqty);
- +
- + if (Rnd.get(100) <= Config.L2JDEV_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE) {
- + if (Config.AUTO_LOOT) {
- + player.addItem("ChampionLoot", item.getId(), item.getValue(), this, true);
- + } else {
- + if ((Rnd.get(1, 10) == 1))
- + dropItem(player, item);
- + else
- + player.addItem("ChampionLoot", item.getId(), item.getValue(), this, true);
- + }
- + }
- + }
- + }
- +
- + private void championMobDropAdena(Player player, IntIntHolder holder) {
- + if (Config.L2JDEV_CHAMPION_ENABLE && isChampion()
- + && (Config.L2JDEV_CHAMPION_ADENAS_REWARDS > 1)) {
- + player.addAdena("ChampionLoot", (int) (holder.getValue() * (Config.L2JDEV_CHAMPION_ADENAS_REWARDS)), this,
- + true);
- + }
- + }
- +
- }
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/status/CreatureStatus.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/status/CreatureStatus.java
- index e4afd17..fca3a0b 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/status/CreatureStatus.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/status/CreatureStatus.java
- @@ -627,7 +627,7 @@ public class CreatureStatus<T extends Creature>
- */
- public int getMAtk(Creature target, L2Skill skill)
- {
- - return (int) calcStat(Stats.MAGIC_ATTACK, _actor.getTemplate().getBaseMAtk(), target, skill);
- + return (int) calcStat(Stats.MAGIC_ATTACK, _actor.getTemplate().getBaseMAtk() * ((_actor.isChampion()) ? Config.L2JDEV_CHAMPION_ChampionMatk : 1), target, skill);
- }
- /**
- @@ -646,7 +646,7 @@ public class CreatureStatus<T extends Creature>
- public int getMDef(Creature target, L2Skill skill)
- {
- // Calculate modifiers Magic Attack
- - return (int) calcStat(Stats.MAGIC_DEFENCE, _actor.getTemplate().getBaseMDef() * ((_actor.isRaidRelated()) ? Config.RAID_DEFENCE_MULTIPLIER : 1), target, skill);
- + return (int) calcStat(Stats.MAGIC_DEFENCE, _actor.getTemplate().getBaseMDef() * ((_actor.isRaidRelated()) ? Config.RAID_DEFENCE_MULTIPLIER : 1) * ((_actor.isChampion()) ? Config.L2JDEV_CHAMPION_ChampionMdef : 1), target, skill);
- }
- /**
- @@ -655,7 +655,7 @@ public class CreatureStatus<T extends Creature>
- */
- public int getPAtk(Creature target)
- {
- - return (int) calcStat(Stats.POWER_ATTACK, _actor.getTemplate().getBasePAtk(), target, null);
- + return (int) calcStat(Stats.POWER_ATTACK, _actor.getTemplate().getBasePAtk() * ((_actor.isChampion()) ? Config.L2JDEV_CHAMPION_ChampionPatk : 1), target, null);
- }
- /**
- @@ -672,7 +672,7 @@ public class CreatureStatus<T extends Creature>
- */
- public int getPDef(Creature target)
- {
- - return (int) calcStat(Stats.POWER_DEFENCE, _actor.getTemplate().getBasePDef() * ((_actor.isRaidRelated()) ? Config.RAID_DEFENCE_MULTIPLIER : 1), target, null);
- + return (int) calcStat(Stats.POWER_DEFENCE, _actor.getTemplate().getBasePDef() * ((_actor.isRaidRelated()) ? Config.RAID_DEFENCE_MULTIPLIER : 1) * ((_actor.isChampion()) ? Config.L2JDEV_CHAMPION_ChampionPdef : 1), target, null);
- }
- /**
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java
- index 1b3ee71..c9fe0d6 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java
- @@ -10,104 +10,100 @@ import net.sf.l2j.gameserver.model.actor.instance.Monster;
- if (Config.SHOW_NPC_LVL && _npc instanceof Monster)
- - _title = "Lv " + _npc.getStatus().getLevel() + (_npc.getTemplate().getAggroRange() > 0 ? "* " : " ") + _title;
- -
- + _title = "Lv " + _npc.getStatus().getLevel() + (_npc.getTemplate().getAggroRange() > 0 ? "* " : " ")
- + + _title;
- +
- + if (Config.L2JDEV_CHAMPION_ENABLE && _npc.isChampion())
- + _title = "" + Config.L2JDEV_CHAMP_TITLE;
- +
Advertisement
Add Comment
Please, Sign In to add comment