Ensure corporeal beast takes half-damage from non-spears
Ensure familiars enter the corporeal beast arena Corrected Vesta's spear attack rate
This commit is contained in:
@@ -122114,7 +122114,7 @@
|
|||||||
"walk_anim": "1205",
|
"walk_anim": "1205",
|
||||||
"has_special": "true",
|
"has_special": "true",
|
||||||
"turn90ccw_anim": "1208",
|
"turn90ccw_anim": "1208",
|
||||||
"attack_speed": "4",
|
"attack_speed": "5",
|
||||||
"two_handed": "true",
|
"two_handed": "true",
|
||||||
"turn180_anim": "1206",
|
"turn180_anim": "1206",
|
||||||
"absorb": "0,0,0",
|
"absorb": "0,0,0",
|
||||||
@@ -122165,6 +122165,10 @@
|
|||||||
"two_handed": "true",
|
"two_handed": "true",
|
||||||
"weapon_interface": "14",
|
"weapon_interface": "14",
|
||||||
"absorb": "0,0,0",
|
"absorb": "0,0,0",
|
||||||
|
"turn90ccw_anim": "1208",
|
||||||
|
"walk_anim": "1205",
|
||||||
|
"defence_anim": "2079",
|
||||||
|
"attack_anims": "2080,2081,2082,2080",
|
||||||
"render_anim": "28",
|
"render_anim": "28",
|
||||||
"equipment_slot": "3",
|
"equipment_slot": "3",
|
||||||
"destroy_message": "Drop",
|
"destroy_message": "Drop",
|
||||||
|
|||||||
@@ -11146,5 +11146,9 @@
|
|||||||
{
|
{
|
||||||
"npc_id": "5084",
|
"npc_id": "5084",
|
||||||
"loc_data": "{2703,3829,1,1,0}-{2708,3824,1,1,0}-{2714,3826,1,1,0}-{2722,3833,1,1,0}-{2724,3771,0,1,0}-{2738,3769,0,1,0}-{2737,3776,0,1,0}"
|
"loc_data": "{2703,3829,1,1,0}-{2708,3824,1,1,0}-{2714,3826,1,1,0}-{2722,3833,1,1,0}-{2724,3771,0,1,0}-{2738,3769,0,1,0}-{2737,3776,0,1,0}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"npc_id": "8133",
|
||||||
|
"loc_data": "{2993,4380,2,1,0}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package content.region.wilderness.handlers
|
|||||||
|
|
||||||
import core.api.*
|
import core.api.*
|
||||||
import core.game.node.entity.Entity
|
import core.game.node.entity.Entity
|
||||||
|
import core.game.node.entity.npc.NPC;
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import content.global.skill.summoning.familiar.Familiar
|
import content.global.skill.summoning.familiar.Familiar
|
||||||
import core.game.world.map.zone.ZoneBorders
|
import core.game.world.map.zone.ZoneBorders
|
||||||
@@ -11,7 +12,7 @@ import core.tools.secondsToTicks
|
|||||||
class CorpAreaController : MapArea, TickListener {
|
class CorpAreaController : MapArea, TickListener {
|
||||||
companion object {
|
companion object {
|
||||||
var activePlayers = ArrayList<Player>()
|
var activePlayers = ArrayList<Player>()
|
||||||
var corpBeast: CorporealBeastNPC? = null
|
var corpBeast: NPC? = null
|
||||||
var borders = ZoneBorders(2974, 4369, 3007, 4400)
|
var borders = ZoneBorders(2974, 4369, 3007, 4400)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,11 +27,14 @@ class CorpAreaController : MapArea, TickListener {
|
|||||||
override fun areaEnter(entity: Entity) {
|
override fun areaEnter(entity: Entity) {
|
||||||
if (entity is Player) {
|
if (entity is Player) {
|
||||||
activePlayers.add(entity)
|
activePlayers.add(entity)
|
||||||
|
if(entity.familiarManager.hasFamiliar()) {
|
||||||
|
entity.familiarManager.familiar.call()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (entity is Familiar) {
|
else if (entity is Familiar) {
|
||||||
entity.setAttribute("corp-time-remaining", secondsToTicks(10)) //Familiars last about 10 seconds, based on https://www.youtube.com/watch?v=kOd6q5Q5ZKI
|
entity.setAttribute("corp-time-remaining", secondsToTicks(10)) //Familiars last about 10 seconds, based on https://www.youtube.com/watch?v=kOd6q5Q5ZKI
|
||||||
}
|
}
|
||||||
else if (entity is CorporealBeastNPC) {
|
else if (entity is NPC && entity.behavior is CorporealBeastNPC) {
|
||||||
corpBeast = entity
|
corpBeast = entity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,9 +49,10 @@ class CorpAreaController : MapArea, TickListener {
|
|||||||
if (activePlayers.size == 0) {
|
if (activePlayers.size == 0) {
|
||||||
corpBeast?.let {
|
corpBeast?.let {
|
||||||
it.skills.lifepoints = it.skills.maximumLifepoints
|
it.skills.lifepoints = it.skills.maximumLifepoints
|
||||||
if (it.darkEnergyCore != null) {
|
val behavior = it.behavior as CorporealBeastNPC
|
||||||
it.darkEnergyCore.clear()
|
if (behavior.darkEnergyCore != null) {
|
||||||
it.darkEnergyCore = null
|
behavior.darkEnergyCore.clear()
|
||||||
|
behavior.darkEnergyCore = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,14 +4,19 @@ import content.data.BossKillCounter;
|
|||||||
import core.game.node.entity.Entity;
|
import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.combat.BattleState;
|
import core.game.node.entity.combat.BattleState;
|
||||||
import core.game.node.entity.combat.CombatStyle;
|
import core.game.node.entity.combat.CombatStyle;
|
||||||
|
import core.game.node.entity.combat.CombatSwingHandler;
|
||||||
import core.game.node.entity.combat.ImpactHandler.HitsplatType;
|
import core.game.node.entity.combat.ImpactHandler.HitsplatType;
|
||||||
|
import core.game.node.entity.combat.MultiSwingHandler;
|
||||||
import core.game.node.entity.combat.equipment.SwitchAttack;
|
import core.game.node.entity.combat.equipment.SwitchAttack;
|
||||||
|
import core.game.node.entity.combat.equipment.Weapon;
|
||||||
import core.game.node.entity.impl.Projectile;
|
import core.game.node.entity.impl.Projectile;
|
||||||
import core.game.node.entity.npc.AbstractNPC;
|
import core.game.node.entity.npc.AbstractNPC;
|
||||||
import core.game.node.entity.npc.NPC;
|
import core.game.node.entity.npc.NPC;
|
||||||
|
import core.game.node.entity.npc.NPCBehavior;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.entity.skill.Skills;
|
import core.game.node.entity.skill.Skills;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Location;
|
import core.game.world.map.Location;
|
||||||
import core.game.world.map.RegionManager;
|
import core.game.world.map.RegionManager;
|
||||||
import core.game.world.update.flag.context.Animation;
|
import core.game.world.update.flag.context.Animation;
|
||||||
@@ -19,9 +24,7 @@ import core.game.world.update.flag.context.Graphics;
|
|||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
import core.tools.RandomFunction;
|
import core.tools.RandomFunction;
|
||||||
import core.game.node.entity.combat.CombatSwingHandler;
|
import org.rs09.consts.NPCs;
|
||||||
import core.game.node.entity.combat.MultiSwingHandler;
|
|
||||||
import core.game.world.GameWorld;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -32,7 +35,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Initializable
|
@Initializable
|
||||||
public final class CorporealBeastNPC extends AbstractNPC {
|
public final class CorporealBeastNPC extends NPCBehavior {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The combat handler.
|
* The combat handler.
|
||||||
@@ -48,63 +51,50 @@ public final class CorporealBeastNPC extends AbstractNPC {
|
|||||||
* Constructs a new {@code CorporealBeastNPC} {@code Object}.
|
* Constructs a new {@code CorporealBeastNPC} {@code Object}.
|
||||||
*/
|
*/
|
||||||
public CorporealBeastNPC() {
|
public CorporealBeastNPC() {
|
||||||
this(8133, Location.create(2993, 4380, 2));
|
super(new int[]{NPCs.CORPOREAL_BEAST_8133});
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code CorporealBeastNPC} {@code Object}.
|
|
||||||
* @param id The NPC id.
|
|
||||||
* @param location The location.
|
|
||||||
*/
|
|
||||||
public CorporealBeastNPC(int id, Location location) {
|
|
||||||
super(id, location);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void onCreation(NPC self) {
|
||||||
super.init();
|
self.configureBossData();
|
||||||
configureBossData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CombatSwingHandler getSwingHandler(boolean swing) {
|
public CombatSwingHandler getSwingHandlerOverride(NPC self, CombatSwingHandler original) {
|
||||||
return combatHandler;
|
return combatHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AbstractNPC construct(int id, Location location, Object... objects) {
|
public void beforeDamageReceived(NPC self, Entity attacker, BattleState state) {
|
||||||
return new CorporealBeastNPC(id, location);
|
if(state.getStyle() == CombatStyle.MELEE || state.getStyle() == CombatStyle.RANGE) {
|
||||||
}
|
Weapon w = state.getWeapon();
|
||||||
|
String name = w != null ? w.getName() : "";
|
||||||
|
if(w == null || name.toLowerCase().indexOf("spear") == -1) {
|
||||||
|
if(state.getEstimatedHit() > 0) {
|
||||||
|
state.setEstimatedHit(state.getEstimatedHit()/2);
|
||||||
|
}
|
||||||
|
if(state.getSecondaryHit() > 0) {
|
||||||
|
state.setSecondaryHit(state.getSecondaryHit()/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(state.getEstimatedHit() > 100) {
|
||||||
|
state.setEstimatedHit(100);
|
||||||
|
}
|
||||||
|
if(state.getSecondaryHit() > 100) {
|
||||||
|
state.setSecondaryHit(100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getFormattedHit(BattleState state, int hit) {
|
public void onDeathFinished(NPC self, Entity killer) {
|
||||||
if (hit > 100) {
|
BossKillCounter.addtoKillcount((Player) killer, NPCs.CORPOREAL_BEAST_8133);
|
||||||
hit = 100;
|
|
||||||
}
|
|
||||||
return super.getFormattedHit(state, hit);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 8133 };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void finalizeDeath(Entity killer) {
|
|
||||||
super.finalizeDeath(killer);
|
|
||||||
BossKillCounter.addtoKillcount((Player) killer, this.getId());
|
|
||||||
if (darkEnergyCore != null) {
|
if (darkEnergyCore != null) {
|
||||||
darkEnergyCore.clear();
|
darkEnergyCore.clear();
|
||||||
darkEnergyCore = null;
|
darkEnergyCore = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
init();
|
|
||||||
return super.newInstance(arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the Corporeal beast's combat.
|
* Handles the Corporeal beast's combat.
|
||||||
* @author Emperor
|
* @author Emperor
|
||||||
@@ -133,7 +123,7 @@ public final class CorporealBeastNPC extends AbstractNPC {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int swing(Entity entity, Entity victim, BattleState state) {
|
public int swing(Entity entity, Entity victim, BattleState state) {
|
||||||
spawnDarkCore((CorporealBeastNPC) entity, victim);
|
spawnDarkCore(entity, (CorporealBeastNPC)((NPC) entity).behavior, victim);
|
||||||
if (doStompAttack(entity)) {
|
if (doStompAttack(entity)) {
|
||||||
entity.getProperties().getCombatPulse().setNextAttack(entity.getProperties().getAttackSpeed());
|
entity.getProperties().getCombatPulse().setNextAttack(entity.getProperties().getAttackSpeed());
|
||||||
return -1;
|
return -1;
|
||||||
@@ -158,19 +148,19 @@ public final class CorporealBeastNPC extends AbstractNPC {
|
|||||||
* @param npc The corporeal beast NPC.
|
* @param npc The corporeal beast NPC.
|
||||||
* @param victim The victim.
|
* @param victim The victim.
|
||||||
*/
|
*/
|
||||||
private void spawnDarkCore(final CorporealBeastNPC npc, Entity victim) {
|
private void spawnDarkCore(Entity corp, final CorporealBeastNPC npc, Entity victim) {
|
||||||
if (npc.darkEnergyCore != null && npc.darkEnergyCore.isActive()) {
|
if (npc.darkEnergyCore != null && npc.darkEnergyCore.isActive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double max = npc.getSkills().getMaximumLifepoints() * (0.3 + (npc.getViewport().getCurrentPlane().getPlayers().size() * 0.05));
|
double max = corp.getSkills().getMaximumLifepoints() * (0.3 + (corp.getViewport().getCurrentPlane().getPlayers().size() * 0.05));
|
||||||
if (npc.getSkills().getLifepoints() > max) {
|
if (corp.getSkills().getLifepoints() > max) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Location l = RegionManager.getTeleportLocation(victim.getLocation(), 3);
|
Location l = RegionManager.getTeleportLocation(victim.getLocation(), 3);
|
||||||
npc.darkEnergyCore = NPC.create(8127, l, npc);
|
npc.darkEnergyCore = NPC.create(8127, l, corp);
|
||||||
npc.darkEnergyCore.setActive(true);
|
npc.darkEnergyCore.setActive(true);
|
||||||
Projectile.create(npc.getLocation().transform(2, 2, 0), l, 1828, 60, 0, 0, 60, 20, 0).send();
|
Projectile.create(corp.getLocation().transform(2, 2, 0), l, 1828, 60, 0, 0, 60, 20, 0).send();
|
||||||
GameWorld.getPulser().submit(new Pulse(2, npc) {
|
GameWorld.getPulser().submit(new Pulse(2, corp) {
|
||||||
@Override
|
@Override
|
||||||
public boolean pulse() {
|
public boolean pulse() {
|
||||||
npc.darkEnergyCore.init();
|
npc.darkEnergyCore.init();
|
||||||
|
|||||||
@@ -41,25 +41,6 @@ public abstract class AbstractNPC extends NPC implements Plugin<Object> {
|
|||||||
super.setWalks(autowalk);
|
super.setWalks(autowalk);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures default boss data.
|
|
||||||
*/
|
|
||||||
public void configureBossData() {
|
|
||||||
getProperties().setNPCWalkable(true);
|
|
||||||
getProperties().setCombatTimeOut(2);
|
|
||||||
if (!isAggressive()) {
|
|
||||||
setAggressive(true);
|
|
||||||
setDefaultBehavior();
|
|
||||||
}
|
|
||||||
if (getAggressiveHandler() != null) {
|
|
||||||
getAggressiveHandler().setChanceRatio(6);
|
|
||||||
getAggressiveHandler().setAllowTolerance(false);
|
|
||||||
getAggressiveHandler().setTargetSwitching(true);
|
|
||||||
getAggressiveHandler().setRadius(64);
|
|
||||||
}
|
|
||||||
walkRadius = 64;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||||
for (int id : getIds()) {
|
for (int id : getIds()) {
|
||||||
|
|||||||
@@ -241,6 +241,25 @@ public class NPC extends Entity {
|
|||||||
// getViewport().setRegion(null);
|
// getViewport().setRegion(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures default boss data.
|
||||||
|
*/
|
||||||
|
public void configureBossData() {
|
||||||
|
getProperties().setNPCWalkable(true);
|
||||||
|
getProperties().setCombatTimeOut(2);
|
||||||
|
if (!isAggressive()) {
|
||||||
|
setAggressive(true);
|
||||||
|
setDefaultBehavior();
|
||||||
|
}
|
||||||
|
if (getAggressiveHandler() != null) {
|
||||||
|
getAggressiveHandler().setChanceRatio(6);
|
||||||
|
getAggressiveHandler().setAllowTolerance(false);
|
||||||
|
getAggressiveHandler().setTargetSwitching(true);
|
||||||
|
getAggressiveHandler().setRadius(64);
|
||||||
|
}
|
||||||
|
walkRadius = 64;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the configurations.
|
* Initializes the configurations.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user