Quick patch (#316)

- Fixed npc drops/anims
- Fixed some combat sounds that were not working
- Made Kalphite Queen a multi area
This commit is contained in:
Mr Extremez
2019-12-23 11:23:04 -06:00
committed by Daniel Ginovker
parent bc4320ee68
commit 32bbf1e003
5 changed files with 31 additions and 56 deletions
@@ -61,7 +61,7 @@ public class CombatAssistant {
NpcHandler.npcs[i].animUpdateRequired = true;
NpcHandler.npcs[i].updateRequired = true;
}
if (CombatConstants.COMBAT_SOUNDS && NpcHandler.npcs[i].npcType < 3177 && NpcHandler.npcs[i].npcType > 3180) {
if (CombatConstants.COMBAT_SOUNDS) {
c.getPacketSender().sendSound(CombatSounds.getNpcBlockSound(NpcHandler.npcs[c.oldNpcIndex].npcType), 100, 0);
}
NpcHandler.npcs[i].facePlayer(c.playerId);
@@ -644,9 +644,7 @@ public class CombatAssistant {
return;
}
if (c.usingRangeWeapon || c.usingBow
&& CombatConstants.COMBAT_SOUNDS
&& NpcHandler.npcs[i].npcType < 3177
&& NpcHandler.npcs[i].npcType > 3180) {
&& CombatConstants.COMBAT_SOUNDS) {
c.getPacketSender().sendSound(SoundList.SHOOT_ARROW,
100, 0);
}
@@ -241,9 +241,7 @@ public class NpcCombat {
c.singleCombatDelay2 = System.currentTimeMillis();
NpcHandler.npcs[i].oldIndex = c.playerId;
NpcData.startAnimation(NpcEmotes.getAttackEmote(i), i);
if (CombatConstants.COMBAT_SOUNDS
&& NpcHandler.npcs[i].npcType < 3177
&& NpcHandler.npcs[i].npcType > 3180) {
if (CombatConstants.COMBAT_SOUNDS) {
c.getPacketSender()
.sendSound(
CombatSounds
@@ -165,43 +165,25 @@ public enum NpcEmotes {
return -1;
}
// public static int getDeadEmote(Player player, int i) {
// for (NpcEmotes e : NpcEmotes.values()) {
// for (int f = 0; f < e.getNpcId().length; f++) {
// if (NpcHandler.npcs[i].npcType == e.getNpcId()[f]) {
// return e.getDead();
// } else {
// switch (NpcHandler.npcs[i].npcType) {
// case 2745:
// return 2654;
// case 1158:
// GameEngine.npcHandler.spawnSecondForm(player, i);
// return 6242;
// case 1160:
// GameEngine.npcHandler.spawnFirstForm(player, i);
// return 6233;
// }
// }
// }
// }
// return 2304;
// }
//
//}
public static int getDeadEmote(int i) {
for (NpcEmotes e : NpcEmotes.values()) {
for (int f = 0; f < e.getNpcId().length; f++) {
if (NpcHandler.npcs[i].npcType == e.getNpcId()[f]) {
return e.getDead();
} else {
switch (NpcHandler.npcs[i].npcType) {
public static int getDeadEmote(Player player, int i) {
for (NpcEmotes e : NpcEmotes.values()) {
for (int f = 0; f < e.getNpcId().length; f++) {
if (NpcHandler.npcs[i].npcType == e.getNpcId()[f]) {
return e.getDead();
} else {
switch (NpcHandler.npcs[i].npcType) {
case 2745:
return 2654;
case 1158:
GameEngine.npcHandler.spawnSecondForm(player, i);
return 6242;
case 1160:
GameEngine.npcHandler.spawnFirstForm(player, i);
return 6233;
}
}
}
}
return 2304;
}
return 2304;
}
}
@@ -647,27 +647,16 @@ public class NpcHandler {
}
if (npcs[i].isDead) {
if (npcs[i].actionTimer == 0 && npcs[i].applyDead == false
&& npcs[i].needRespawn == false) {
if (npcs[i].actionTimer == 0 && npcs[i].applyDead == false && npcs[i].needRespawn == false) {
npcs[i].updateRequired = true;
npcs[i].facePlayer(0);
if (npcs[i].killedBy <= 0)
npcs[i].killedBy = NpcData.getNpcKillerId(i);
npcs[i].animNumber = NpcEmotes.getDeadEmote(i); // dead
// emote
Player c = (Client) PlayerHandler.players[npcs[i].killedBy];
if (c != null) {
// if (npcs[i].killedBy <= 0)
// npcs[i].killedBy = NpcData.getNpcKillerId(i);
// npcs[i].animNumber = NpcEmotes.getDeadEmote(c, i); // dead emote
if (CombatConstants.COMBAT_SOUNDS
&& NpcHandler.npcs[i].npcType < 3177
&& NpcHandler.npcs[i].npcType > 3180) {
c.getPacketSender()
.sendSound(
CombatSounds
.getNpcDeathSounds(npcs[i].npcType),
100, 0);
npcs[i].animNumber = NpcEmotes.getDeadEmote(c, i); // dead emote
if (CombatConstants.COMBAT_SOUNDS) {
c.getPacketSender().sendSound(CombatSounds.getNpcDeathSounds(npcs[i].npcType), 100, 0);
}
}
npcs[i].animUpdateRequired = true;
@@ -1706,7 +1706,15 @@ public abstract class Player {
|| absX >= 2371 && absX <= 2422 && absY >= 5062 && absY <= 5117
|| absX >= 2896 && absX <= 2927 && absY >= 3595 && absY <= 3630
|| absX >= 2892 && absX <= 2932 && absY >= 4435 && absY <= 4464
|| absX >= 2256 && absX <= 2287 && absY >= 4680 && absY <= 4711) {
|| absX >= 2256 && absX <= 2287 && absY >= 4680 && absY <= 4711
|| inKqArea()) {
return true;
}
return false;
}
public boolean inKqArea() {
if (absX >= 3467 && absX <= 3506 && absY >= 9477 && absY <= 9513) {
return true;
}
return false;