Mage Training Arena and stuff (#504)

* Fixup door/stairs in mage training arena

* Fixup bedsheets, should be worn on head, not weapon slot

* [Mage Training Arena] spawn rewards guardian

* [Mage Training Arena] Add arena teleports (non functioning)

* Just adding some comments

* [Mage Training Arena] Basic mage training arena stuff

* [Mage Training Arena] Allow shop to open and show items correctly

* [Mage Training Arena] Show shop prices when clicked

* noclip

* [Mage Training Arena] Add 2nd option handler (filler)

* [Mage Training Arena] Be able to purchase stuff, lock bones to peaches

* Update MageArena.java

* [Mage Training Arena] setup boundary

* Readability

* Tidy up enchanting

* MageArena -> MageTrainingArena

* Create Alchemy.java

* Update RSInterface.java

* [Mage Training Arena] Spawn entrance npcs

* [Mage Training Arena] Initial Alchemy

* [Mage Training Arena]  Add comments

* [Mage Training Arena] Handle alchemy while in arena

* [Mage Training Arena] Show interface for alchemy room

* [Mage Training Arena] Display values, Search cupboards

* [Mage Training Arena] Don't allow the player to wear items from the Alchemy game

* [Mage Training Arena] Announce when items are changing

* Don't allow the player to bring any coins with them

* Sort by values

* [Mage Training Arena] Allow alching items etc

* Update method name

* Show magic tab after using alch even if can't alch

* [Mage Training Arena] Coin collector - temp

* [Mage Training Arena] Give player points, take items, add bonus xp, add bank items

* [Mage Training Arena] Remove items when player leaves the alchemy training area

* Fixup staffs for runes, Tidy up checks

Was missing all Mystic staff
This commit is contained in:
Danial
2021-10-01 10:25:48 +13:00
committed by GitHub
parent 8589277ece
commit bbe1587e20
23 changed files with 821 additions and 418 deletions
@@ -32,6 +32,7 @@ import com.rs2.game.content.minigames.Dueling;
import com.rs2.game.content.minigames.FightPits;
import com.rs2.game.content.minigames.PestControl;
import com.rs2.game.content.minigames.castlewars.CastleWars;
import com.rs2.game.content.minigames.magetrainingarena.MageTrainingArena;
import com.rs2.game.content.music.PlayList;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.content.skills.SkillInterfaces;
@@ -114,6 +115,7 @@ public abstract class Player {
public IoSession session;
private final ItemAssistant itemAssistant = new ItemAssistant(this);
private final ShopAssistant shopAssistant = new ShopAssistant(this);
private final MageTrainingArena mageArena = new MageTrainingArena(this);
private final Trading trading = new Trading(this);
private final Dueling duel = new Dueling(this);
private final PlayerAssistant playerAssistant = new PlayerAssistant(this);
@@ -400,6 +402,10 @@ public abstract class Player {
return shopAssistant;
}
public MageTrainingArena getMageTrainingArena() {
return mageArena;
}
public Trading getTrading() {
return trading;
}
@@ -814,6 +820,8 @@ public abstract class Player {
isSnowy = false;
} else if (inCw() || inPits) {
getPacketSender().showOption(3, 0, "Attack", 1);
} else if (Boundary.isIn(this, Boundary.MAGE_TRAINING_ARENA_ALCHEMY)) {
getPacketSender().walkableInterface(15892);
} else {
getPacketSender().sendMapState(0);
if (!isSnowy) {
@@ -1624,7 +1632,7 @@ public abstract class Player {
* Combat variables
*/
public boolean doubleHit, usingSpecial, usingRangeWeapon,
usingBow, usingMagic, castingMagic;
usingBow, usingMagic, castingMagic, unlockedBonesToPeaches;
public int castingSpellId, oldSpellId,
spellId, hitDelay;
public int specMaxHitIncrease, freezeDelay, freezeTimer = -6, killerId,
@@ -1632,7 +1640,7 @@ public abstract class Player {
crystalBowArrowCount, playerMagicBook, teleGfx, teleEndAnimation,
teleHeight, teleX, teleY, rangeItemUsed, killingNpcIndex,
totalDamageDealt, globalDamageDealt, oldNpcIndex, fightMode, attackTimer,
bowSpecShot, ectofuntusWorshipped;
bowSpecShot, ectofuntusWorshipped, graveyardPoints, alchemyPoints, enchantmentPoints, telekineticPoints;
public boolean magicFailed, oldMagicFailed;
/**
* End
@@ -2145,13 +2153,18 @@ public abstract class Player {
mapRegionX = (teleportToX >> 3) - 6;
mapRegionY = (teleportToY >> 3) - 6;
}
if (Boundary.isIn(this, Boundary.MAGE_TRAINING_ARENA_ALCHEMY) && !Boundary.isIn(teleportToX, teleportToY, teleHeight, Boundary.MAGE_TRAINING_ARENA_ALCHEMY)) {
// remove any alchemy training items
getMageTrainingArena().alchemy.clearItems();
}
currentX = teleportToX - 8 * mapRegionX;
currentY = teleportToY - 8 * mapRegionY;
absX = teleportToX;
absY = teleportToY;
heightLevel = teleHeight >= 0 ? teleHeight : heightLevel >= 0 ? heightLevel : 0;
resetWalkingQueue();
teleportToX = teleportToY = -1;
teleportToX = teleportToY = teleHeight = -1;
didTeleport = true;
updateWalkEntities();
} else {