mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 16:49:07 +00:00
More mage training arena (#509)
* Fixup points display * Only allow players to deposit up to 12k at one time * Apple damage and play animation * Update order or prices * Update Telekinetic.java
This commit is contained in:
+18
-3
@@ -13,7 +13,8 @@ import com.rs2.world.Boundary;
|
|||||||
|
|
||||||
public class Alchemy {
|
public class Alchemy {
|
||||||
|
|
||||||
private Player player;
|
private Player player;
|
||||||
|
private boolean warned = false;
|
||||||
|
|
||||||
public Alchemy(Player c) {
|
public Alchemy(Player c) {
|
||||||
this.player = c;
|
this.player = c;
|
||||||
@@ -41,7 +42,7 @@ public class Alchemy {
|
|||||||
}
|
}
|
||||||
// Item not found, player trying to alch a different item
|
// Item not found, player trying to alch a different item
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
player.getPacketSender().sendMessage("You cannot alch that item while here.");
|
player.getPacketSender().sendMessage("@red@You cannot alch that item while here.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check player has requirements for this spell
|
// Check player has requirements for this spell
|
||||||
@@ -65,12 +66,25 @@ public class Alchemy {
|
|||||||
}
|
}
|
||||||
player.getPacketSender().sendShowTab(6);
|
player.getPacketSender().sendShowTab(6);
|
||||||
player.getPlayerAssistant().refreshSkill(6);
|
player.getPlayerAssistant().refreshSkill(6);
|
||||||
|
|
||||||
|
int coins = player.getItemAssistant().getItemAmount(995);
|
||||||
|
System.out.println(warned + ": " + coins);
|
||||||
|
|
||||||
|
if (!warned && coins >= 10000) {
|
||||||
|
player.getPacketSender().sendMessage("@red@You can only deposit up to 12,000 coins at a time.");
|
||||||
|
player.getPacketSender().sendMessage("@red@If you try to deposit more than 12,000 coins you won't recieve any rewards.");
|
||||||
|
warned = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void collectCoins() {
|
public void collectCoins() {
|
||||||
int coins = player.getItemAssistant().getItemAmount(995);
|
int coins = player.getItemAssistant().getItemAmount(995);
|
||||||
if (coins < 100) {
|
if (coins < 100) {
|
||||||
player.getPacketSender().sendMessage("You need to deposit at least 100 coins.");
|
player.getPacketSender().sendMessage("@red@You need to deposit at least 100 coins.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (coins > 12000) {
|
||||||
|
player.getPacketSender().sendMessage("@red@We cannot allow you to deposit that many coins.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int points = (int) Math.floor(coins / 100);
|
int points = (int) Math.floor(coins / 100);
|
||||||
@@ -80,6 +94,7 @@ public class Alchemy {
|
|||||||
player.alchemyPoints += points;
|
player.alchemyPoints += points;
|
||||||
player.getItemAssistant().addItemToBank(995, toBank);
|
player.getItemAssistant().addItemToBank(995, toBank);
|
||||||
player.getPlayerAssistant().addSkillXP(bonusExp, GameConstants.MAGIC);
|
player.getPlayerAssistant().addSkillXP(bonusExp, GameConstants.MAGIC);
|
||||||
|
warned = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearItems() {
|
public void clearItems() {
|
||||||
|
|||||||
+9
-5
@@ -109,16 +109,20 @@ public class Graveyard {
|
|||||||
if (!Boundary.isIn(p, Boundary.MAGE_TRAINING_ARENA_GRAVEYARD)) {
|
if (!Boundary.isIn(p, Boundary.MAGE_TRAINING_ARENA_GRAVEYARD)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO: Find falling bones animation/gfx ID
|
applyDamage(p);
|
||||||
if (random.nextInt(1) == 0) {
|
|
||||||
p.dealDamage(2);
|
|
||||||
p.handleHitMask(2);
|
|
||||||
}
|
|
||||||
updateInterface(p);
|
updateInterface(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void applyDamage(Player player) {
|
||||||
|
if (random.nextInt(1) == 0) {
|
||||||
|
player.gfx0(520);
|
||||||
|
player.dealDamage(2);
|
||||||
|
player.handleHitMask(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void updateInterface(Player player) {
|
public static void updateInterface(Player player) {
|
||||||
if (!Boundary.isIn(player, Boundary.MAGE_TRAINING_ARENA_GRAVEYARD)) {
|
if (!Boundary.isIn(player, Boundary.MAGE_TRAINING_ARENA_GRAVEYARD)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
+6
-6
@@ -63,8 +63,8 @@ public class MageTrainingArena {
|
|||||||
|
|
||||||
player.getPacketSender().sendString(Integer.toString(player.telekineticPoints), 15955);
|
player.getPacketSender().sendString(Integer.toString(player.telekineticPoints), 15955);
|
||||||
player.getPacketSender().sendString(Integer.toString(player.enchantmentPoints), 15956);
|
player.getPacketSender().sendString(Integer.toString(player.enchantmentPoints), 15956);
|
||||||
player.getPacketSender().sendString(Integer.toString(player.graveyardPoints), 15957);
|
player.getPacketSender().sendString(Integer.toString(player.alchemyPoints), 15957);
|
||||||
player.getPacketSender().sendString(Integer.toString(player.alchemyPoints), 15958);
|
player.getPacketSender().sendString(Integer.toString(player.graveyardPoints), 15958);
|
||||||
player.getPacketSender().showInterface(15944);
|
player.getPacketSender().showInterface(15944);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,11 +245,11 @@ public class MageTrainingArena {
|
|||||||
public void sendItemValue(int itemId) {
|
public void sendItemValue(int itemId) {
|
||||||
player.getPacketSender().sendMessage(
|
player.getPacketSender().sendMessage(
|
||||||
ItemAssistant.getItemName(itemId) + " costs "
|
ItemAssistant.getItemName(itemId) + " costs "
|
||||||
+ getGraveyardPointValue(itemId) + " Graveyard points, "
|
+ getTelekineticPointValue(itemId) + " Telekinetic points, "
|
||||||
+ getAlchemyPointValue(itemId) + " Alchemy points,");
|
+ getGraveyardPointValue(itemId) + " Graveyard points,");
|
||||||
player.getPacketSender().sendMessage(
|
player.getPacketSender().sendMessage(
|
||||||
"" + getEnchantmentPointValue(itemId) + " Enchantment points, and "
|
getEnchantmentPointValue(itemId) + " Enchantment points and "
|
||||||
+ getTelekineticPointValue(itemId) + " Telekinetic points.");
|
+ getAlchemyPointValue(itemId) + " Alchemist points.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void buyItem(int itemId) {
|
public void buyItem(int itemId) {
|
||||||
|
|||||||
-2
@@ -219,8 +219,6 @@ public class Telekinetic {
|
|||||||
observingStatue = false;
|
observingStatue = false;
|
||||||
player.getPlayerAssistant().sendCameraReset();
|
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) {
|
public void resetStatue(int itemX, int itemY) {
|
||||||
|
|||||||
Reference in New Issue
Block a user