mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-04 16:49:04 +00:00
Telekinetic grab and stuff (#508)
* tidy up * Tidy up check for space * Telekinetic base * Don't allow player to pickup statue * Tidy up item pickup * fixup, statue spawn * Update telekinetic grab * 2nd option for guardian statue * handle telegrab on statue * Allow picking up global drops with telekinetic grab * Check if player can see/reach item * Update PickupItem.java * Allow pasting into chatbox * camera stuff * fixup clipboard stuff * Update PlayerAssistant.java * Update Commands.java * Add mazes initial * Tidy up the clipboard pasting * Update mazes * Calculate new position of statue * fixup telegrab * More tidy up, remove constant running of container * more tidy up.. * Handle moving statues * remove the statue from global drops * Update MagicOnFloorItems.java * Show telekinetic interface * Make public accessable * Only show items to player that are on the same height level * Moving statues around, Spawning * Reward exp, points, law runes * Show points, mazes completed * Add comment * Add observable statue (still needs work) * Fixup where camera focuses * Load items when player changes level * Graveyard base * Add a couple more checks * Update Player.java * Update Commands.java * Make sure statue is visible when player appears at maze * [Mage training arena] Graveyard * Update MageTrainingArena.java * Update MageTrainingArena.java * Update ItemHandler.java
This commit is contained in:
@@ -149,7 +149,9 @@ public class MagicData {
|
||||
// alch
|
||||
{ -1, 55, 713, 113, 0, 0, 0, 20, 554, 5, 561, 1, 0, 0, 0, 0, 0 }, // high
|
||||
// alch
|
||||
{ -1, 33, 728, 142, 143, 144, 0, 35, 556, 1, 563, 1, 0, 0, 0, 0, 0 } // telegrab
|
||||
{ -1, 33, 728, 142, 143, 144, 0, 35, 556, 1, 563, 1, 0, 0, 0, 0, 0 }, // telegrab
|
||||
{ -1, 15, 722, 141, 0, 0, 0, 25, 561, 1, 557, 2, 555, 2, 0, 0, 0, 0 }, // bones to bananas
|
||||
{ -1, 60, 722, 311, 0, 0, 0, 35, 561, 2, 557, 4, 555, 4, 0, 0, 0, 0 } // bones to peaches
|
||||
|
||||
};
|
||||
|
||||
|
||||
+11
-12
@@ -40,7 +40,7 @@ public class MagicRequirements {
|
||||
|
||||
public static boolean checkMagicReqs(Player c, int spell, boolean runesRequired) {
|
||||
int[] spellData = MagicData.MAGIC_SPELLS[spell];
|
||||
if (c.usingMagic && runesRequired) { // check for runes
|
||||
if (runesRequired) { // check for runes
|
||||
if (
|
||||
!c.getItemAssistant().playerHasItem(spellData[8], spellData[9]) && !wearingStaff(c, spellData[8])
|
||||
|| !c.getItemAssistant().playerHasItem(spellData[10], spellData[11]) && !wearingStaff(c, spellData[10])
|
||||
@@ -52,7 +52,7 @@ public class MagicRequirements {
|
||||
}
|
||||
}
|
||||
|
||||
if (c.usingMagic && c.playerIndex > 0) {
|
||||
if (c.playerIndex > 0) {
|
||||
if (PlayerHandler.players[c.playerIndex] != null) {
|
||||
for (int r = 0; r < c.REDUCE_SPELLS.length; r++) { // reducing
|
||||
// spells,
|
||||
@@ -81,7 +81,7 @@ public class MagicRequirements {
|
||||
}
|
||||
|
||||
int staffRequired = getStaffNeeded(c);
|
||||
if (c.usingMagic && staffRequired > 0 && runesRequired) { // staff
|
||||
if (staffRequired > 0 && runesRequired) { // staff
|
||||
// required
|
||||
if (c.playerEquipment[c.playerWeapon] != staffRequired) {
|
||||
c.getPacketSender()
|
||||
@@ -94,16 +94,15 @@ public class MagicRequirements {
|
||||
}
|
||||
}
|
||||
|
||||
if (c.usingMagic) { // check magic level
|
||||
if (c.playerLevel[GameConstants.MAGIC] < MagicData.MAGIC_SPELLS[spell][1]) {
|
||||
c.getPacketSender().sendMessage(
|
||||
"You need to have a magic level of "
|
||||
+ MagicData.MAGIC_SPELLS[spell][1]
|
||||
+ " to cast this spell.");
|
||||
return false;
|
||||
}
|
||||
// check magic level
|
||||
if (c.playerLevel[GameConstants.MAGIC] < MagicData.MAGIC_SPELLS[spell][1]) {
|
||||
c.getPacketSender().sendMessage(
|
||||
"You need to have a magic level of "
|
||||
+ MagicData.MAGIC_SPELLS[spell][1]
|
||||
+ " to cast this spell.");
|
||||
return false;
|
||||
}
|
||||
if (c.usingMagic && runesRequired) {
|
||||
if (runesRequired) {
|
||||
if (MagicData.MAGIC_SPELLS[spell][8] > 0) { // deleting runes
|
||||
if (!wearingStaff(c, MagicData.MAGIC_SPELLS[spell][8])) {
|
||||
c.getItemAssistant().deleteItem(
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import com.rs2.world.Boundary;
|
||||
|
||||
public class Alchemy {
|
||||
|
||||
private final Player player;
|
||||
private Player player;
|
||||
|
||||
public Alchemy(Player c) {
|
||||
this.player = c;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import com.rs2.world.Boundary;
|
||||
public class Enchanting {
|
||||
// TODO: Add dragonstone drops occasionally, double points when enchanted
|
||||
|
||||
private final Player player;
|
||||
private Player player;
|
||||
private int itemsEnchanted = 0;
|
||||
private int orbsDeposited = 0;
|
||||
|
||||
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
package com.rs2.game.content.minigames.magetrainingarena;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.rs2.GameConstants;
|
||||
import com.rs2.game.content.combat.magic.MagicData;
|
||||
import com.rs2.game.content.combat.magic.MagicRequirements;
|
||||
import com.rs2.game.content.music.sound.SoundList;
|
||||
import com.rs2.game.npcs.NpcHandler;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.game.players.PlayerHandler;
|
||||
import com.rs2.world.Boundary;
|
||||
|
||||
public class Graveyard {
|
||||
|
||||
private Player player;
|
||||
private int bonesCollected = 0;
|
||||
private int fruitDeposited = 0;
|
||||
|
||||
public Graveyard(Player c) {
|
||||
this.player = c;
|
||||
}
|
||||
|
||||
public void searchBonePile(int objectID) {
|
||||
int index = (int) Math.floor(bonesCollected / 4);
|
||||
if (player.getItemAssistant().freeSlots(items[index], 1) <= 0) {
|
||||
player.getPacketSender().sendMessage("You don't have enough space in your inventory.");
|
||||
return;
|
||||
}
|
||||
player.getItemAssistant().addItem(items[index], 1);
|
||||
bonesCollected = (bonesCollected + 1) % (items.length * 4);
|
||||
}
|
||||
|
||||
public void bonesToFood(int spellID) {
|
||||
if (!player.getCombatAssistant().checkMagicReqs(spellID)) {
|
||||
return;
|
||||
}
|
||||
player.boneDelay = System.currentTimeMillis();
|
||||
player.startAnimation(MagicData.MAGIC_SPELLS[spellID][2]);
|
||||
player.gfx100(MagicData.MAGIC_SPELLS[spellID][3]);
|
||||
player.getPlayerAssistant().addSkillXP(MagicData.MAGIC_SPELLS[spellID][7], GameConstants.MAGIC);
|
||||
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
|
||||
player.getPacketSender().sendShowTab(6);
|
||||
player.getPacketSender().sendSound(SoundList.BONES_TO_BANNAS, 100, 0);
|
||||
int amount = 0;
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
amount = player.getItemAssistant().getItemAmount(items[i]);
|
||||
if (amount > 0) {
|
||||
player.getItemAssistant().deleteItem(items[i], amount);
|
||||
player.getItemAssistant().addItem(spellID == 52 ? 1963 : 6883, amount * values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void depositFood() {
|
||||
int amount = player.getItemAssistant().getItemAmount(1963);
|
||||
amount += player.getItemAssistant().getItemAmount(6883);
|
||||
// remove all peaches and bananas
|
||||
player.getItemAssistant().deleteItem(1963, Integer.MAX_VALUE);
|
||||
player.getItemAssistant().deleteItem(6883, Integer.MAX_VALUE);
|
||||
fruitDeposited += amount;
|
||||
while (fruitDeposited >= 16) {
|
||||
int reward = random.nextInt(rewards.length);
|
||||
player.getItemAssistant().addOrDropItem(rewards[reward], 1);
|
||||
player.graveyardPoints++;
|
||||
fruitDeposited -= 16;
|
||||
}
|
||||
}
|
||||
|
||||
public void clearItems() {
|
||||
for (int item: items) {
|
||||
player.getItemAssistant().deleteItem(item, Integer.MAX_VALUE);
|
||||
}
|
||||
player.getItemAssistant().deleteItem(1963, Integer.MAX_VALUE);
|
||||
player.getItemAssistant().deleteItem(6883, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
/* ITEMS */
|
||||
// 6904 - Animal Bones
|
||||
// 6905 - Animal Bones
|
||||
// 6906 - Animal Bones
|
||||
// 6907 - Animal Bones
|
||||
public static int[] items = {6904, 6905, 6906, 6907};
|
||||
public static int[] values = {1, 2, 3, 4};
|
||||
public static int[] rewards = {555, 557, 561, 560, 565};
|
||||
|
||||
public static int ticks = 0;
|
||||
private static Random random = new Random();
|
||||
|
||||
/* OBJECTS */
|
||||
// 10735 - Food Chute
|
||||
|
||||
/* INTERFACES */
|
||||
// 15931 - Main interface
|
||||
|
||||
public static void process() {
|
||||
for (Player p : PlayerHandler.players) {
|
||||
if (p == null) {
|
||||
continue;
|
||||
}
|
||||
updateInterface(p);
|
||||
}
|
||||
// Every 12 ticks deal 2 damage to player (50% chance)
|
||||
if (++ticks % 12 == 0) {
|
||||
for (Player p : PlayerHandler.players) {
|
||||
if (p == null) {
|
||||
continue;
|
||||
}
|
||||
if (!Boundary.isIn(p, Boundary.MAGE_TRAINING_ARENA_GRAVEYARD)) {
|
||||
return;
|
||||
}
|
||||
// TODO: Find falling bones animation/gfx ID
|
||||
if (random.nextInt(1) == 0) {
|
||||
p.dealDamage(2);
|
||||
p.handleHitMask(2);
|
||||
}
|
||||
updateInterface(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateInterface(Player player) {
|
||||
if (!Boundary.isIn(player, Boundary.MAGE_TRAINING_ARENA_GRAVEYARD)) {
|
||||
return;
|
||||
}
|
||||
player.getPacketSender().sendString("" + player.graveyardPoints, 15935);
|
||||
player.getPacketSender().walkableInterface(15931);
|
||||
}
|
||||
}
|
||||
+11
-3
@@ -15,16 +15,22 @@ public class MageTrainingArena {
|
||||
public static void process() {
|
||||
Alchemy.process();
|
||||
Enchanting.process();
|
||||
Telekinetic.process();
|
||||
Graveyard.process();
|
||||
}
|
||||
|
||||
private final Player player;
|
||||
public final Enchanting enchanting;
|
||||
public final Alchemy alchemy;
|
||||
private Player player;
|
||||
public Enchanting enchanting;
|
||||
public Alchemy alchemy;
|
||||
public Telekinetic telekinetic;
|
||||
public Graveyard graveyard;
|
||||
|
||||
public MageTrainingArena(Player c) {
|
||||
this.player = c;
|
||||
this.enchanting = new Enchanting(c);
|
||||
this.alchemy = new Alchemy(c);
|
||||
this.telekinetic = new Telekinetic(c);
|
||||
this.graveyard = new Graveyard(c);
|
||||
}
|
||||
|
||||
private final int[] shopItems = {
|
||||
@@ -277,6 +283,8 @@ public class MageTrainingArena {
|
||||
} else {
|
||||
player.getItemAssistant().addItem(itemId, 1);
|
||||
}
|
||||
// Update point amounts
|
||||
openShop();
|
||||
}
|
||||
|
||||
public void enchantItem(int itemID, int spellID) {
|
||||
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
package com.rs2.game.content.minigames.magetrainingarena;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.Random;
|
||||
|
||||
import com.rs2.GameConstants;
|
||||
import com.rs2.GameEngine;
|
||||
import com.rs2.event.CycleEvent;
|
||||
import com.rs2.event.CycleEventContainer;
|
||||
import com.rs2.event.CycleEventHandler;
|
||||
import com.rs2.game.content.combat.magic.MagicData;
|
||||
import com.rs2.game.items.GroundItem;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.game.players.PlayerHandler;
|
||||
import com.rs2.world.Boundary;
|
||||
import com.rs2.world.clip.Region;
|
||||
|
||||
public class Telekinetic {
|
||||
|
||||
public static enum Maze {
|
||||
MAZE_0(3338, 9705, 0,
|
||||
3343, 9705,
|
||||
3347, 9714),
|
||||
MAZE_1(3366, 9711, 0,
|
||||
3375, 9715,
|
||||
3367, 9720),
|
||||
MAZE_2(3338, 9675, 0,
|
||||
3343, 9680,
|
||||
3342, 9684),
|
||||
MAZE_3(3369, 9673, 0,
|
||||
3373, 9678,
|
||||
3375, 9682),
|
||||
MAZE_4(3374, 9713, 1,
|
||||
3374, 9713,
|
||||
3383, 9713),
|
||||
MAZE_5(3341, 9708, 1,
|
||||
3350, 9717,
|
||||
3341, 9708),
|
||||
MAZE_6(3346, 9680, 1,
|
||||
3351, 9684,
|
||||
3353, 9680),
|
||||
MAZE_7(3376, 9677, 1,
|
||||
3376, 9686,
|
||||
3385, 9686),
|
||||
MAZE_8(3339, 9674, 2,
|
||||
3348, 9674,
|
||||
3339, 9683),
|
||||
MAZE_9(3343, 9709, 2,
|
||||
3346, 9718,
|
||||
3345, 9718);
|
||||
|
||||
public int minX, maxX, minY, maxY, height, startX, startY, endX, endY;
|
||||
public Boundary mazeArea, mazeUp, mazeRight, mazeDown, mazeLeft;
|
||||
public GroundItem statue;
|
||||
public boolean initialized = false;
|
||||
|
||||
private Maze(int minX, int minY, int height, int startX, int startY, int endX, int endY) {
|
||||
this.minX = minX;
|
||||
this.maxX = minX + 9;
|
||||
this.minY = minY;
|
||||
this.maxY = minY + 9;
|
||||
this.height = height;
|
||||
this.startX = startX;
|
||||
this.startY = startY;
|
||||
this.endX = endX;
|
||||
this.endY = endY;
|
||||
this.mazeArea = new Boundary(minX, maxX, minY, maxY, height);
|
||||
this.mazeUp = new Boundary(minX, maxX, maxY + 1, maxY + 2, height);
|
||||
this.mazeRight = new Boundary(maxX + 1, maxX + 2, minY, maxY, height);
|
||||
this.mazeDown = new Boundary(minX, maxX, minY - 2, minY - 1, height);
|
||||
this.mazeLeft = new Boundary(minX - 2, minX - 1, minY, maxY, height);
|
||||
this.statue = new GroundItem(6888, startX, startY, height, 1, -1, 0, "");
|
||||
}
|
||||
|
||||
public static Maze getMaze(int x, int y, int h) {
|
||||
for (Maze maze : values()){
|
||||
if (Boundary.isIn(x, y, h, maze.mazeArea)) {
|
||||
return maze;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Point calcDirection(Player player) {
|
||||
if (Boundary.isIn(player, mazeUp)) {
|
||||
return new Point(0, 1);
|
||||
}
|
||||
if (Boundary.isIn(player, mazeRight)) {
|
||||
return new Point(1, 0);
|
||||
}
|
||||
if (Boundary.isIn(player, mazeDown)) {
|
||||
return new Point(0, -1);
|
||||
}
|
||||
if (Boundary.isIn(player, mazeLeft)) {
|
||||
return new Point(-1, 0);
|
||||
}
|
||||
return new Point(0, 0);
|
||||
}
|
||||
|
||||
public Point getNewPos(int curX, int curY, int dirX, int dirY) {
|
||||
if (dirX != 0) {
|
||||
while(curX >= minX && curX <= maxX && Region.getClipping(curX + dirX, curY, this.height, dirX, dirY)) {
|
||||
curX += dirX;
|
||||
}
|
||||
}
|
||||
if (dirY != 0) {
|
||||
while(curY >= minY && curY <= maxY && Region.getClipping(curX, curY + dirY, this.height, dirX, dirY)) {
|
||||
curY += dirY;
|
||||
}
|
||||
}
|
||||
return new Point(curX, curY);
|
||||
}
|
||||
}
|
||||
|
||||
private Player player;
|
||||
private Random random = new Random();
|
||||
private boolean observingStatue = false;
|
||||
|
||||
public Telekinetic(Player c) {
|
||||
this.player = c;
|
||||
}
|
||||
|
||||
public void moveStatue(int itemX, int itemY) {
|
||||
// Play animation, Award XP
|
||||
player.walkingToItem = true;
|
||||
int offY = (player.getX() - itemX) * -1;
|
||||
int offX = (player.getY() - itemY) * -1;
|
||||
player.teleGrabX = itemX;
|
||||
player.teleGrabY = itemY;
|
||||
player.turnPlayerTo(itemX, itemY);
|
||||
player.teleGrabDelay = System.currentTimeMillis();
|
||||
player.startAnimation(MagicData.MAGIC_SPELLS[51][2]);
|
||||
player.gfx100(MagicData.MAGIC_SPELLS[51][3]);
|
||||
player.getPlayerAssistant().createPlayersStillGfx(144, itemX, itemY, 0, 72);
|
||||
player.getPlayerAssistant().createPlayersProjectile(player.getX(), player.getY(), offX, offY, 50, 70, MagicData.MAGIC_SPELLS[51][4], 50, 10, 0, 50);
|
||||
player.getPlayerAssistant().addSkillXP(MagicData.MAGIC_SPELLS[51][7], GameConstants.MAGIC);
|
||||
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
|
||||
player.stopMovement();
|
||||
|
||||
Maze maze = Maze.getMaze(itemX, itemY, player.heightLevel);
|
||||
if (maze == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Point direction = maze.calcDirection(player);
|
||||
Point newPosition = maze.getNewPos(itemX, itemY, direction.x, direction.y);
|
||||
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
if (!player.walkingToItem) {
|
||||
container.stop();
|
||||
} else if (System.currentTimeMillis() - player.teleGrabDelay > 1550) {
|
||||
if (GameEngine.itemHandler.itemExists(6888, itemX, itemY)) {
|
||||
GameEngine.itemHandler.moveItem(maze.statue, newPosition.x, newPosition.y);
|
||||
|
||||
if (newPosition.x == maze.endX && newPosition.y == maze.endY) {
|
||||
player.telekineticPoints += 2;
|
||||
player.telekineticMazesSolved++;
|
||||
|
||||
// Every 5 solves, give the player 8 extra points, 10 law runes, 1000 magic experience
|
||||
if (player.telekineticMazesSolved % 5 == 0) {
|
||||
player.telekineticPoints += 8;
|
||||
player.getItemAssistant().addOrDropItem(563, 10);
|
||||
player.getPlayerAssistant().addSkillXP(1000, GameConstants.MAGIC);
|
||||
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
|
||||
}
|
||||
|
||||
resetStatue(newPosition.x, newPosition.y);
|
||||
|
||||
if (observingStatue) {
|
||||
observingStatue = false;
|
||||
player.getPlayerAssistant().sendCameraReset();
|
||||
}
|
||||
goToMaze();
|
||||
}
|
||||
}
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
player.usingMagic = false;
|
||||
player.walkingToItem = false;
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
|
||||
public void goToMaze() {
|
||||
int r = random.nextInt(Maze.values().length);
|
||||
Maze maze = Maze.values()[r];
|
||||
player.getPlayerAssistant().startTeleport2(maze.minX - 1, maze.minY - 1, maze.height);
|
||||
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
GameEngine.itemHandler.reloadItems(player);
|
||||
container.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {}
|
||||
}, 8);
|
||||
}
|
||||
|
||||
public void observeStatue(int itemX, int itemY) {
|
||||
Maze maze = Maze.getMaze(itemX, itemY, player.heightLevel);
|
||||
if (maze == null) {
|
||||
return;
|
||||
}
|
||||
if (!observingStatue) {
|
||||
observingStatue = true;
|
||||
player.getPlayerAssistant().sendCameraCutscene((maze.minX + 5) - 8 * player.getMapRegionX(), (maze.minY - 1) - 8 * player.getMapRegionY(), 10, 25, 0);
|
||||
player.getPlayerAssistant().sendCameraCutscene2((maze.minX + 5) - 8 * player.getMapRegionX(), (maze.minY + 5) - 8 * player.getMapRegionY() - 8, 2400, 25, 0);
|
||||
player.getPacketSender().sendMessage("You overlook the maze..");
|
||||
player.getPacketSender().sendMessage("Click the statue again to leave this view.");
|
||||
} else {
|
||||
observingStatue = false;
|
||||
player.getPlayerAssistant().sendCameraReset();
|
||||
}
|
||||
// TODO: Figure out how to get this working correctly
|
||||
// not sure exactly where the camera is supposed to be facing etc
|
||||
}
|
||||
|
||||
public void resetStatue(int itemX, int itemY) {
|
||||
Maze maze = Maze.getMaze(itemX, itemY, player.heightLevel);
|
||||
if (maze == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// reset statue to start position
|
||||
GameEngine.itemHandler.moveItem(maze.statue, maze.startX, maze.startY);
|
||||
}
|
||||
|
||||
/* ITEMS */
|
||||
// 6888 - Guardian Statue
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* INTERFACES */
|
||||
// 15962 - Main interface
|
||||
// 15966 - Pizazz points
|
||||
// 15968 - Mazes solved
|
||||
|
||||
public static int ticks = 0;
|
||||
|
||||
public static void process() {
|
||||
for (Maze maze: Maze.values()) {
|
||||
if (!maze.initialized) {
|
||||
maze.initialized = true;
|
||||
GameEngine.itemHandler.createGlobalItem(maze.statue);
|
||||
}
|
||||
}
|
||||
for (Player p : PlayerHandler.players) {
|
||||
if (p == null) {
|
||||
continue;
|
||||
}
|
||||
updateInterface(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void updateInterface(Player player) {
|
||||
if (!Boundary.isIn(player, Boundary.MAGE_TRAINING_ARENA_TELEKINETIC)) {
|
||||
return;
|
||||
}
|
||||
player.getPacketSender().sendString("" + player.telekineticPoints, 15966);
|
||||
player.getPacketSender().sendString("" + player.telekineticMazesSolved, 15968);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.rs2.game.items;
|
||||
|
||||
public class GroundItem {
|
||||
|
||||
public int itemId, itemX, itemY, itemAmount, itemController, hideTicks, removeTicks;
|
||||
public int itemId, itemX, itemY, itemH, itemAmount, itemController, hideTicks, removeTicks;
|
||||
|
||||
public String ownerName;
|
||||
|
||||
@@ -11,6 +11,7 @@ public class GroundItem {
|
||||
itemId = id;
|
||||
itemX = x;
|
||||
itemY = y;
|
||||
itemH = h;
|
||||
itemAmount = amount;
|
||||
itemController = controller;
|
||||
this.hideTicks = hideTicks;
|
||||
@@ -29,6 +30,10 @@ public class GroundItem {
|
||||
return itemY;
|
||||
}
|
||||
|
||||
public int getItemH() {
|
||||
return itemH;
|
||||
}
|
||||
|
||||
public int getItemAmount() {
|
||||
return itemAmount;
|
||||
}
|
||||
|
||||
@@ -2636,9 +2636,18 @@ public class ObjectsActions {
|
||||
else if (player.absY == 3300)
|
||||
player.getPlayerAssistant().movePlayer(player.absX, player.absY - 2, 0);
|
||||
break;
|
||||
case 10725: // Bone Pile
|
||||
case 10726: // Bone Pile
|
||||
case 10727: // Bone Pile
|
||||
case 10728: // Bone Pile
|
||||
player.getMageTrainingArena().graveyard.searchBonePile(objectType);
|
||||
break;
|
||||
case 10734: // Coin Collector
|
||||
player.getMageTrainingArena().alchemy.collectCoins();
|
||||
break;
|
||||
case 10735: // Food Chute
|
||||
player.getMageTrainingArena().graveyard.depositFood();
|
||||
break;
|
||||
case 10771:
|
||||
player.getPlayerAssistant().movePlayer(3369, 3307, 1);
|
||||
break;
|
||||
@@ -2653,8 +2662,7 @@ public class ObjectsActions {
|
||||
break;
|
||||
case 10778:
|
||||
// TODO: Require Pizazz progress hat equiped
|
||||
player.getDialogueHandler().sendStatement("This area is currently closed.");
|
||||
// player.getPlayerAssistant().startTeleport2(3336, 9718, 0); // Telekinetic floor 0
|
||||
player.getMageTrainingArena().telekinetic.goToMaze();
|
||||
break;
|
||||
case 10779:
|
||||
// TODO: Require Pizazz progress hat equiped
|
||||
@@ -2670,8 +2678,7 @@ public class ObjectsActions {
|
||||
break;
|
||||
case 10781:
|
||||
// TODO: Require Pizazz progress hat equiped
|
||||
player.getDialogueHandler().sendStatement("This area is currently closed.");
|
||||
// player.getPlayerAssistant().startTeleport2(3364, 9639, 1); // Graveyard training
|
||||
player.getPlayerAssistant().startTeleport2(3364, 9639, 1); // Graveyard training
|
||||
break;
|
||||
case 10782: // Leave mage training rooms
|
||||
player.getPlayerAssistant().startTeleport2(3363, 3318, 0);
|
||||
|
||||
@@ -824,6 +824,10 @@ public abstract class Player {
|
||||
getPacketSender().walkableInterface(15892);
|
||||
} else if (Boundary.isIn(this, Boundary.MAGE_TRAINING_ARENA_ENCHANTING)) {
|
||||
getPacketSender().walkableInterface(15917);
|
||||
} else if (Boundary.isIn(this, Boundary.MAGE_TRAINING_ARENA_TELEKINETIC)) {
|
||||
getPacketSender().walkableInterface(15962);
|
||||
} else if (Boundary.isIn(this, Boundary.MAGE_TRAINING_ARENA_GRAVEYARD)) {
|
||||
getPacketSender().walkableInterface(15931);
|
||||
} else {
|
||||
getPacketSender().sendMapState(0);
|
||||
if (!isSnowy) {
|
||||
@@ -1642,7 +1646,7 @@ public abstract class Player {
|
||||
crystalBowArrowCount, playerMagicBook, teleGfx, teleEndAnimation,
|
||||
teleHeight, teleX, teleY, rangeItemUsed, killingNpcIndex,
|
||||
totalDamageDealt, globalDamageDealt, oldNpcIndex, fightMode, attackTimer,
|
||||
bowSpecShot, ectofuntusWorshipped, graveyardPoints, alchemyPoints, enchantmentPoints, telekineticPoints;
|
||||
bowSpecShot, ectofuntusWorshipped, graveyardPoints, alchemyPoints, enchantmentPoints, telekineticPoints, telekineticMazesSolved;
|
||||
public boolean magicFailed, oldMagicFailed;
|
||||
/**
|
||||
* End
|
||||
@@ -2160,14 +2164,21 @@ public abstract class Player {
|
||||
getMageTrainingArena().alchemy.clearItems();
|
||||
}
|
||||
if (Boundary.isIn(this, Boundary.MAGE_TRAINING_ARENA_ENCHANTING) && !Boundary.isIn(teleportToX, teleportToY, teleHeight, Boundary.MAGE_TRAINING_ARENA_ENCHANTING)) {
|
||||
// remove any alchemy training items
|
||||
// remove any enchanting training items
|
||||
getMageTrainingArena().enchanting.clearItems();
|
||||
}
|
||||
if (Boundary.isIn(this, Boundary.MAGE_TRAINING_ARENA_GRAVEYARD) && !Boundary.isIn(teleportToX, teleportToY, teleHeight, Boundary.MAGE_TRAINING_ARENA_GRAVEYARD)) {
|
||||
// remove any enchanting training items
|
||||
getMageTrainingArena().graveyard.clearItems();
|
||||
}
|
||||
currentX = teleportToX - 8 * mapRegionX;
|
||||
currentY = teleportToY - 8 * mapRegionY;
|
||||
absX = teleportToX;
|
||||
absY = teleportToY;
|
||||
heightLevel = teleHeight >= 0 ? teleHeight : heightLevel >= 0 ? heightLevel : 0;
|
||||
int newHeight = teleHeight >= 0 ? teleHeight : heightLevel >= 0 ? heightLevel : 0;
|
||||
if (heightLevel != newHeight)
|
||||
GameEngine.itemHandler.reloadItems(this);
|
||||
heightLevel = newHeight;
|
||||
resetWalkingQueue();
|
||||
|
||||
teleportToX = teleportToY = teleHeight = -1;
|
||||
|
||||
@@ -769,6 +769,9 @@ public class PlayerAssistant {
|
||||
player.npcIndex = 0;
|
||||
player.playerIndex = 0;
|
||||
player.faceUpdate(0);
|
||||
if (player.heightLevel != height) {
|
||||
player.refresh = true;
|
||||
}
|
||||
player.teleHeight = height;
|
||||
player.startAnimation(714);
|
||||
player.teleTimer = 11;
|
||||
@@ -833,6 +836,9 @@ public class PlayerAssistant {
|
||||
player.npcIndex = 0;
|
||||
player.playerIndex = 0;
|
||||
player.faceUpdate(0);
|
||||
if (player.heightLevel != height) {
|
||||
player.refresh = true;
|
||||
}
|
||||
player.teleHeight = height;
|
||||
player.startAnimation(714);
|
||||
player.teleTimer = 11;
|
||||
@@ -2302,8 +2308,25 @@ public class PlayerAssistant {
|
||||
*/
|
||||
public void sendCameraCutscene(int x, int y, int height, int speed, int angle) {
|
||||
player.getOutStream().createFrame(177);
|
||||
player.getOutStream().writeByte(x / 64); //
|
||||
player.getOutStream().writeByte(y / 64); //
|
||||
player.getOutStream().writeByte(x); // divided by 64 apparently allows real world coords
|
||||
player.getOutStream().writeByte(y); // divided by 64 apparently allows real world coords
|
||||
player.getOutStream().writeWord(height); //
|
||||
player.getOutStream().writeByte(speed); //
|
||||
player.getOutStream().writeByte(angle);
|
||||
}
|
||||
|
||||
/**
|
||||
* anchors the camera to a specific view (for cutscenes)
|
||||
* @param x The X Coordinate (Within the player's loaded area)
|
||||
* @param y The Y Coordinate (Within the player's loaded area)
|
||||
* @param height The Height of Camera (not relative to the game world height)
|
||||
* @param speed The Camera Speed (Speed at which the camera turns to where it should point?)
|
||||
* @param angle The Camera Angle
|
||||
*/
|
||||
public void sendCameraCutscene2(int x, int y, int height, int speed, int angle) {
|
||||
player.getOutStream().createFrame(166);
|
||||
player.getOutStream().writeByte(x); //
|
||||
player.getOutStream().writeByte(y); //
|
||||
player.getOutStream().writeWord(height); //
|
||||
player.getOutStream().writeByte(speed); //
|
||||
player.getOutStream().writeByte(angle);
|
||||
|
||||
@@ -399,6 +399,7 @@ public class PlayerHandler {
|
||||
|
||||
if (plr.refresh) {
|
||||
GlobalDropsHandler.reset((Client)plr);
|
||||
GameEngine.itemHandler.reloadItems(plr);
|
||||
plr.refresh = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,6 +425,9 @@ public class PlayerSave {
|
||||
case "telekinetic-points":
|
||||
player.telekineticPoints = Integer.parseInt(token2);
|
||||
break;
|
||||
case "telekinetic-mazes-solved":
|
||||
player.telekineticMazesSolved = Integer.parseInt(token2);
|
||||
break;
|
||||
case "unlocked-bones-to-peaches":
|
||||
player.unlockedBonesToPeaches = Boolean.parseBoolean(token2);
|
||||
break;
|
||||
@@ -806,6 +809,8 @@ public class PlayerSave {
|
||||
characterfile.newLine();
|
||||
characterfile.write("telekinetic-points = " + player.telekineticPoints);
|
||||
characterfile.newLine();
|
||||
characterfile.write("telekinetic-mazes-solved = " + player.telekineticMazesSolved);
|
||||
characterfile.newLine();
|
||||
characterfile.write("unlocked-bones-to-peaches = " + player.unlockedBonesToPeaches);
|
||||
characterfile.newLine();
|
||||
String voidStatus = "";
|
||||
|
||||
Reference in New Issue
Block a user