mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-20 13:30:27 -07:00
Some summoning-related fixes:
- Add sound effects for scroll, call, summon, point recharge (also ectophial refill sfx). - Fix the check for summoning/calling a size > 1 familiar into an enclosed space. - Fix some combat interactions with multi-square npcs.
This commit is contained in:
parent
a3632c0331
commit
7b74b2eb7f
8 changed files with 41 additions and 18 deletions
|
|
@ -133,6 +133,7 @@ public final class AnimalMagnetismPlugin extends OptionHandler {
|
|||
player.faceLocation(new Location(3659, 3519, 0));
|
||||
if (player.getInventory().containsItem(new Item(4252))) {
|
||||
player.animate(Animation.create(1652));
|
||||
player.getAudioManager().send(1132);
|
||||
player.getInventory().remove(new Item(4252));
|
||||
player.getInventory().add(item);
|
||||
player.sendMessage("You refill the ectophial from the Ectofuntus.");
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public class EctoplasmFillPlugin extends UseWithHandler {
|
|||
public boolean handle(NodeUsageEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
player.animate(Animation.create(4471));
|
||||
player.getAudioManager().send(1132);
|
||||
player.getPacketDispatch().sendMessage("You fill the bucket with ectoplasm.");
|
||||
player.getPulseManager().run(new Pulse(3, player) {
|
||||
@Override
|
||||
|
|
@ -46,6 +47,7 @@ public class EctoplasmFillPlugin extends UseWithHandler {
|
|||
player.getInventory().add(new Item(4286));
|
||||
if (player.getInventory().contains(1925, 1)) {
|
||||
player.animate(Animation.create(4471), 1);
|
||||
player.getAudioManager().send(1132);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public class EctophialFillPlugin extends UseWithHandler {
|
|||
final Player player = event.getPlayer();
|
||||
player.lock(3);
|
||||
player.animate(Animation.create(1652));
|
||||
player.getAudioManager().send(1132);
|
||||
GameWorld.getPulser().submit(new Pulse(3, player) {
|
||||
@Override
|
||||
public boolean pulse() {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public final class ObeliskOptionPlugin extends OptionHandler {
|
|||
return true;
|
||||
}
|
||||
player.visualize(Animation.create(8502), Graphics.create(1308));
|
||||
player.getAudioManager().send(4214);
|
||||
player.getSkills().setLevel(Skills.SUMMONING, player.getSkills().getStaticLevel(Skills.SUMMONING));
|
||||
player.getPacketDispatch().sendMessage("You renew your summoning points.");
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -112,6 +112,8 @@ public abstract class Familiar extends NPC implements Plugin<Object> {
|
|||
*/
|
||||
private final int attackStyle;
|
||||
|
||||
private boolean firstCall = true;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code Familiar} {@code Object}.
|
||||
* @param owner The owner.
|
||||
|
|
@ -346,6 +348,7 @@ public abstract class Familiar extends NPC implements Plugin<Object> {
|
|||
if (specialMove(special)) {
|
||||
setAttribute("special-delay", GameWorld.getTicks() + 3);
|
||||
owner.getInventory().remove(new Item(scroll.getItemId()));
|
||||
owner.getAudioManager().send(4161);
|
||||
visualizeSpecialMove();
|
||||
updateSpecialPoints(specialCost);
|
||||
owner.getSkills().addExperience(Skills.SUMMONING, scroll.getExperience(), true);
|
||||
|
|
@ -536,6 +539,12 @@ public abstract class Familiar extends NPC implements Plugin<Object> {
|
|||
setInvisible(getZoneMonitor().isRestricted(ZoneRestriction.FOLLOWERS) && !owner.getLocks().isLocked("enable_summoning"));
|
||||
getProperties().setTeleportLocation(destination);
|
||||
if (!(this instanceof Pet)) {
|
||||
if(firstCall) {
|
||||
owner.getAudioManager().send(4366);
|
||||
firstCall = false;
|
||||
} else {
|
||||
owner.getAudioManager().send(188);
|
||||
}
|
||||
if (size() > 1) {
|
||||
graphics(LARGE_SUMMON_GRAPHIC);
|
||||
} else {
|
||||
|
|
@ -734,4 +743,4 @@ public abstract class Familiar extends NPC implements Plugin<Object> {
|
|||
public int getSpecialPoints() {
|
||||
return specialPoints;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,21 +295,19 @@ object RegionManager {
|
|||
return null
|
||||
}
|
||||
var destination: Location? = null
|
||||
for (i in 0..3) {
|
||||
outer@ for (i in 0..7) {
|
||||
val dir = Direction.get(i)
|
||||
val l = owner.location.transform(dir, if (dir.toInteger() < 2) 1 else node.size())
|
||||
var success = true
|
||||
for (x in 0 until node.size()) {
|
||||
for (y in 0 until node.size()) {
|
||||
if (isClipped(l.transform(x, y, 0))) {
|
||||
success = false
|
||||
break
|
||||
inner@for(j in 0 until node.size()) {
|
||||
val l = owner.location.transform(dir, j)
|
||||
for (x in 0 until node.size()) {
|
||||
for (y in 0 until node.size()) {
|
||||
if (isClipped(l.transform(x, y, 0))) {
|
||||
continue@inner
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (success) {
|
||||
destination = l
|
||||
break
|
||||
break@outer
|
||||
}
|
||||
}
|
||||
return destination
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import core.game.node.entity.player.link.audio.Audio
|
|||
import core.game.node.entity.player.link.prayer.PrayerType
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.node.entity.skill.summoning.familiar.Familiar
|
||||
import core.game.world.map.RegionManager
|
||||
import core.game.world.map.path.Pathfinder
|
||||
import core.game.world.update.flag.context.Animation
|
||||
import core.tools.RandomFunction
|
||||
|
|
@ -521,11 +522,21 @@ abstract class CombatSwingHandler(var type: CombatStyle?) {
|
|||
*/
|
||||
@JvmStatic
|
||||
fun isProjectileClipped(entity: Node, victim: Node?, checkClose: Boolean): Boolean {
|
||||
return if (checkClose) {
|
||||
if (entity.id == 54) { // /temp until emp is back.
|
||||
Pathfinder.find(entity as Entity, victim!!, false, Pathfinder.SMART).isSuccessful
|
||||
} else Pathfinder.find(entity as Entity, victim!!, false, Pathfinder.DUMB).isSuccessful
|
||||
} else Pathfinder.find(entity as Entity, victim!!, false, Pathfinder.PROJECTILE).isSuccessful
|
||||
for(x1 in 0 until entity.size()) {
|
||||
for(y1 in 0 until entity.size()) {
|
||||
val src = entity.location.transform(x1, y1, 0)
|
||||
for(x2 in 0 until victim!!.size()) {
|
||||
for(y2 in 0 until victim!!.size()) {
|
||||
val dst = victim!!.location.transform(x2, y2, 0)
|
||||
val path = Pathfinder.PROJECTILE.find(src, 1, dst, 1, 1, 0, 0, 0, false, RegionManager::getClippingFlag)
|
||||
if(path.isSuccessful && (!checkClose || path.points.size <= 1)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ open class MeleeSwingHandler
|
|||
distance += if (entity.walkingQueue.isRunningBoth) 2 else 1
|
||||
goodRange = canMelee(entity, victim, distance)
|
||||
}
|
||||
if (!isProjectileClipped(entity, victim, true)) {
|
||||
if (!isProjectileClipped(entity, victim, !usingHalberd(entity))) {
|
||||
return InteractionType.NO_INTERACT
|
||||
}
|
||||
val isRunning = entity.walkingQueue.runDir != -1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue