Redwings Content Drop: Blast Furnace, Secondary Banks, Seers Diary
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package core.game.interaction.object;
|
||||
|
||||
import static api.ContentAPIKt.*;
|
||||
|
||||
import api.Container;
|
||||
import core.cache.def.impl.NPCDefinition;
|
||||
import core.cache.def.impl.SceneryDefinition;
|
||||
import core.game.component.CloseEvent;
|
||||
@@ -30,6 +32,7 @@ import core.game.world.update.flag.context.Animation;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
import kotlin.Unit;
|
||||
import org.rs09.consts.Items;
|
||||
import rs09.game.content.dialogue.DumpContainer;
|
||||
import rs09.game.ge.GrandExchangeOffer;
|
||||
import rs09.game.world.World;
|
||||
@@ -188,8 +191,14 @@ public final class BankingPlugin extends OptionHandler {
|
||||
stage = 0;
|
||||
break;
|
||||
case 0:
|
||||
interpreter.sendOptions("What would you like to say?", "I'd like to access my bank account, please.", "I'd like to check my PIN settings.", "I'd like to see my collection box.", "What is this place?");
|
||||
stage = 10;
|
||||
if(player.getAttribute("UnlockedSecondaryBank",false)){
|
||||
interpreter.sendOptions("What would you like to say?", "I'd like to access my bank account, please.", "I'd like to check my PIN settings.", "I'd like to see my collection box.", "I'd like to switch to my " + (player.useSecondaryBank ? "primary": "secondary") + " bank account.", "What is this place?");
|
||||
stage = 10;
|
||||
}
|
||||
else if(!player.getAttribute("UnlockedSecondaryBank",false)){
|
||||
interpreter.sendOptions("What would you like to say?", "I'd like to access my bank account, please.", "I'd like to check my PIN settings.", "I'd like to see my collection box.", "Can I open a second bank account?", "What is this place?");
|
||||
stage = 20;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
interpreter.sendDialogues(id, FacialExpression.HALF_GUILTY, "This is a branch of the Bank of " + World.getSettings().getName() + ". We have", "branches in many towns.");
|
||||
@@ -204,7 +213,7 @@ public final class BankingPlugin extends OptionHandler {
|
||||
player("And what do you do?");
|
||||
stage = 4;
|
||||
} else if (buttonId == 2) {
|
||||
player("Didnt you used to be called the Bank of Varrock?");
|
||||
player("Didn't you used to be called the Bank of Varrock?");
|
||||
stage = 5;
|
||||
}
|
||||
break;
|
||||
@@ -216,6 +225,71 @@ public final class BankingPlugin extends OptionHandler {
|
||||
interpreter.sendDialogues(id, FacialExpression.HALF_GUILTY, "Yes we did, but people kept on coming into our", "signs were wrong. They acted as if we didn't know", "what town we were in or something.");
|
||||
stage = 100;
|
||||
break;
|
||||
case 6:
|
||||
player.useSecondaryBank = !player.useSecondaryBank;
|
||||
interpreter.sendDialogues(id, FacialExpression.HALF_GUILTY, "I've switched you over to your " + (player.useSecondaryBank ? "secondary" : "primary") + " bank account");
|
||||
stage = 100;
|
||||
break;
|
||||
case 7:
|
||||
interpreter.sendDialogues(id, FacialExpression.WORRIED, "A second account??? What is four hundred and ninety","six slots not enough for you??? What are","you even hoarding?");
|
||||
stage = 8;
|
||||
break;
|
||||
case 8:
|
||||
player(FacialExpression.ANNOYED,"Listen, an entrepreneur like me needs","a lot of space for my business ventures");
|
||||
stage = 9;
|
||||
break;
|
||||
case 9:
|
||||
interpreter.sendDialogues(id, FacialExpression.ANNOYED,"Oh an entrepreneur eh? Well I guess a rich","entrepreneur like you can afford the fee","for opening a second bank account");
|
||||
stage = 11;
|
||||
break;
|
||||
case 11:
|
||||
player(FacialExpression.LAUGH,"Well of course I can, a man of my","status could afford a measly bank fee");
|
||||
stage = 12;
|
||||
break;
|
||||
case 12:
|
||||
interpreter.sendDialogues(id,FacialExpression.FRIENDLY,"Okay then, that'll be a one time","fee of five million gold coins, we just need","your payment and for you to sign here");
|
||||
stage = 13;
|
||||
break;
|
||||
case 13:
|
||||
player(FacialExpression.ANGRY,"FIVE MILLION!?!");
|
||||
stage = 14;
|
||||
break;
|
||||
case 14:
|
||||
interpreter.sendDialogues(id,FacialExpression.FRIENDLY,"Yes, Five million. These banks are very","to upkeep and maintain, but that is the final price","can't someone with your stature and wealth","afford such a trivial fee?");
|
||||
stage = 15;
|
||||
break;
|
||||
case 15:
|
||||
interpreter.sendOptions("Put your money where your mouth is?","Yes","No");
|
||||
stage = 16;
|
||||
break;
|
||||
case 16:
|
||||
if(buttonId == 1 && player.getInventory().contains(995,5000000)){
|
||||
player(FacialExpression.ANGRY_WITH_SMILE,"Haha yes, just a trivial fee haha.","just a drop in the bucket...");
|
||||
stage = 21;
|
||||
}
|
||||
if(buttonId == 2 || !player.getInventory().contains(995,5000000)){
|
||||
player(FacialExpression.AFRAID,"Well of course I can, let me just get it out of... my bank","uhhhhhh... haha...");
|
||||
stage = 17;
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
interpreter.sendDialogues(id,FacialExpression.HALF_ROLLING_EYES,"You know I can see your bank, right?");
|
||||
stage = 18;
|
||||
break;
|
||||
case 18:
|
||||
player("Yeah... I'll uhh, I'll be back later");
|
||||
stage = 100;
|
||||
break;
|
||||
case 21:
|
||||
interpreter.sendDialogues(id,FacialExpression.AMAZED,"Wow I've never even SEEN thi- I mean *ahem*","give me one minute while I process this.");
|
||||
stage = 22;
|
||||
break;
|
||||
case 22:
|
||||
player.getInventory().remove(new Item(995,5000000));
|
||||
player.getGameAttributes().setAttribute("/save:UnlockedSecondaryBank",true);
|
||||
interpreter.sendDialogues(id,FacialExpression.FRIENDLY,"You're all set! Whenever you want to switch to","your second bank account just ask","a teller and we'll swap it over for","you");
|
||||
stage = 100;
|
||||
break;
|
||||
case 100:
|
||||
end();
|
||||
break;
|
||||
@@ -243,7 +317,7 @@ public final class BankingPlugin extends OptionHandler {
|
||||
break;
|
||||
case 10:
|
||||
switch (interfaceId) {
|
||||
case 232:
|
||||
case 234:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -253,6 +327,10 @@ public final class BankingPlugin extends OptionHandler {
|
||||
end();
|
||||
break;
|
||||
case 4:
|
||||
player("I'd like to switch to my " + (player.useSecondaryBank ? "primary": "secondary") + " bank account");
|
||||
stage = 6;
|
||||
break;
|
||||
case 5:
|
||||
player("What is this place?");
|
||||
stage = 1;
|
||||
break;
|
||||
@@ -260,6 +338,27 @@ public final class BankingPlugin extends OptionHandler {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 20:
|
||||
switch (interfaceId) {
|
||||
case 234:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
player.getBankPinManager().openType(buttonId);
|
||||
checkAchievements(player);
|
||||
end();
|
||||
break;
|
||||
case 4:
|
||||
player("Can I open a second bank account?");
|
||||
stage = 7;
|
||||
break;
|
||||
case 5:
|
||||
player("What is this place?");
|
||||
stage = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -116,12 +116,9 @@ public enum BoltEffect {
|
||||
public void impact(BattleState state) {
|
||||
int victimPoints = (int) (state.getVictim().getSkills().getLifepoints() * 0.20);
|
||||
int playerPoints = (int) (state.getAttacker().getSkills().getLifepoints() * 0.10);
|
||||
if (victimPoints >= 35) {
|
||||
victimPoints = 35;
|
||||
}
|
||||
int total = state.getEstimatedHit() + victimPoints;
|
||||
if (total >= 35) {
|
||||
total = 35;
|
||||
if (total >= 100 && state.getVictim().getId() == 8133) {
|
||||
total = 100;
|
||||
}
|
||||
state.setEstimatedHit(total);
|
||||
state.getAttacker().getImpactHandler().manualHit(state.getVictim(), playerPoints, HitsplatType.NORMAL);
|
||||
|
||||
+3
-2
@@ -5,6 +5,8 @@ import core.game.node.entity.skill.Skills;
|
||||
import core.game.node.entity.Entity;
|
||||
import core.game.node.entity.combat.BattleState;
|
||||
import core.game.node.entity.combat.CombatStyle;
|
||||
import core.game.node.entity.state.EntityState;
|
||||
import core.game.node.entity.state.impl.HealOverTimePulse;
|
||||
import rs09.game.node.entity.combat.handlers.MeleeSwingHandler;
|
||||
import core.game.node.entity.impl.Animator.Priority;
|
||||
import core.game.node.entity.player.Player;
|
||||
@@ -66,12 +68,11 @@ public final class ExcaliburSpecialHandler extends MeleeSwingHandler implements
|
||||
p.getSkills().updateLevel(Skills.DEFENCE, 8, p.getSkills().getStaticLevel(Skills.DEFENCE) + 8);
|
||||
break;
|
||||
case 14632: // enhanced excalibur
|
||||
p.getStateManager().set(EntityState.HEALOVERTIME,p,(int)15,(int)20,(int)5);
|
||||
p.getSkills().updateLevel(Skills.DEFENCE,
|
||||
(int)(p.getSkills().getStaticLevel(Skills.DEFENCE)*0.15),
|
||||
(int)(p.getSkills().getStaticLevel(Skills.DEFENCE)*1.15));
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package core.game.node.entity.player;
|
||||
|
||||
import core.game.component.Component;
|
||||
import core.game.container.Container;
|
||||
import core.game.container.ContainerType;
|
||||
import core.game.container.impl.BankContainer;
|
||||
import core.game.container.impl.EquipmentContainer;
|
||||
import core.game.container.impl.InventoryListener;
|
||||
@@ -84,6 +85,7 @@ import rs09.game.node.entity.skill.runecrafting.PouchManager;
|
||||
import rs09.game.node.entity.state.newsys.State;
|
||||
import rs09.game.node.entity.state.newsys.StateRepository;
|
||||
import rs09.game.world.World;
|
||||
import rs09.game.world.repository.DisconnectionQueue;
|
||||
import rs09.game.world.repository.Repository;
|
||||
import rs09.game.world.update.MapChunkRenderer;
|
||||
import rs09.game.world.update.NPCRenderer;
|
||||
@@ -145,6 +147,31 @@ public class Player extends Entity {
|
||||
*/
|
||||
private final BankContainer bank = new BankContainer(this);
|
||||
|
||||
/**
|
||||
* The secondary bank container.
|
||||
*/
|
||||
private final BankContainer bankSecondary = new BankContainer(this);
|
||||
|
||||
/**
|
||||
* Is secondary bank in use or not
|
||||
*/
|
||||
public boolean useSecondaryBank = false;
|
||||
|
||||
/**
|
||||
* The Blast Furnace Coal Container.
|
||||
*/
|
||||
public final Container blastCoal = new Container(225, ContainerType.NEVER_STACK);
|
||||
|
||||
/**
|
||||
* The Blast Furnace Ore Container.
|
||||
*/
|
||||
public final Container blastOre = new Container(28, ContainerType.NEVER_STACK);
|
||||
|
||||
/**
|
||||
* The Blast Furnace Bars Container.
|
||||
*/
|
||||
public final Container blastBars = new Container(28, ContainerType.NEVER_STACK);
|
||||
|
||||
/**
|
||||
* The packet dispatcher.
|
||||
*/
|
||||
@@ -1008,13 +1035,29 @@ public class Player extends Entity {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the bank.
|
||||
* @return The bank.
|
||||
* Gets the current active bank.
|
||||
* @return Current active bank.
|
||||
*/
|
||||
public BankContainer getBank() {
|
||||
return useSecondaryBank ? bankSecondary : bank;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the primary bank.
|
||||
* @return Primary bank
|
||||
*/
|
||||
public BankContainer getBankPrimary() {
|
||||
return bank;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Secondary bank.
|
||||
* @return Secondary bank
|
||||
*/
|
||||
public BankContainer getBankSecondary() {
|
||||
return bankSecondary;
|
||||
}
|
||||
|
||||
public BankContainer getDropLog() {return dropLog;}
|
||||
|
||||
/**
|
||||
|
||||
-96
@@ -1,96 +0,0 @@
|
||||
package core.game.node.entity.player.link.diary;
|
||||
|
||||
import core.game.node.entity.Entity;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.world.map.Location;
|
||||
import core.game.world.map.zone.MapZone;
|
||||
import core.game.world.map.zone.ZoneBorders;
|
||||
import core.game.world.map.zone.ZoneBuilder;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
import core.tools.Vector3d;
|
||||
|
||||
@Initializable
|
||||
public class MysteriousStatueZone extends MapZone implements Plugin<Object> {
|
||||
private final static Vector3d origin = new Vector3d(2740.5, 3490.5, 0);
|
||||
private final static Vector3d n = new Vector3d(0, 0, 1);
|
||||
|
||||
public MysteriousStatueZone() {
|
||||
super("mysterious-statue", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enter(Entity e) {
|
||||
if (e instanceof Player) {
|
||||
//System.out.println("enter");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean leave(Entity e, boolean logout) {
|
||||
if (e instanceof Player) {
|
||||
//System.out.println("leave");
|
||||
e.asPlayer().removeAttribute("diary:seers:statue-walk-start");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void locationUpdate(Entity e, Location last) {
|
||||
if (e instanceof Player) {
|
||||
Player player = e.asPlayer();
|
||||
//System.out.println("update - " + player.getLocation().toString());
|
||||
if (!player.getWalkingQueue().isRunning() && !player.getSettings().isRunToggled()) {
|
||||
if (player.getAttribute("diary:seers:statue-walk-start") != null) {
|
||||
Vector3d start = player.getAttribute("diary:seers:statue-walk-start");
|
||||
Vector3d a = player.getAttribute("diary:seers:statue-walk-a");
|
||||
Vector3d b = new Vector3d(player.getLocation()).sub(origin);
|
||||
|
||||
double angle_a_b = Vector3d.signedAngle(a, b, n) * 360. / 2 / 3.14159265355;
|
||||
|
||||
/* player.getWalkingQueue().isMoving() doesn't work right, or at least does not do what name implies it should
|
||||
if (!player.getWalkingQueue().isMoving()) {
|
||||
System.out.println("removing, not moving");
|
||||
player.removeAttribute("diary:seers:statue-walk-start");
|
||||
}*/
|
||||
if (angle_a_b >= 0) {
|
||||
//System.out.println("removing, not going clockwise");
|
||||
player.removeAttribute("diary:seers:statue-walk-start");
|
||||
}
|
||||
if (b.epsilonEquals(start, .001)) {
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.SEERS_VILLAGE, 0, 1);
|
||||
//System.out.println("removing, finished task");
|
||||
player.removeAttribute("diary:seers:statue-walk-start");
|
||||
}
|
||||
|
||||
player.setAttribute("diary:seers:statue-walk-a", b);
|
||||
} else {
|
||||
//System.out.println("started");
|
||||
Vector3d start = new Vector3d(player.getLocation()).sub(origin);
|
||||
player.setAttribute("diary:seers:statue-walk-start", start);
|
||||
player.setAttribute("diary:seers:statue-walk-a", start);
|
||||
}
|
||||
} else {
|
||||
//System.out.println("removing, running or outside");
|
||||
player.removeAttribute("diary:seers:statue-walk-start");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure() {
|
||||
register(new ZoneBorders(2739, 3489, 2742, 3492, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||
ZoneBuilder.configure(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object fireEvent(String identifier, Object... args) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,12 @@ public enum EntityState {
|
||||
/**
|
||||
* The entity has decreased weapon speeds.
|
||||
*/
|
||||
MIASMIC(new MiasmicStatePulse(null, 0));
|
||||
MIASMIC(new MiasmicStatePulse(null, 0)),
|
||||
|
||||
/**
|
||||
* The entity is healing over time
|
||||
*/
|
||||
HEALOVERTIME(new HealOverTimePulse(null,0,0,0,0));
|
||||
|
||||
/**
|
||||
* The state pulse used for this state.
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package core.game.node.entity.state.impl;
|
||||
|
||||
import core.game.node.entity.Entity;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.state.StatePulse;
|
||||
import core.game.world.update.flag.context.Graphics;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/**
|
||||
* Method for healing a player a certain amount of HP
|
||||
* every X amount of ticks for a total of X amount of heals
|
||||
* over X amount of ticks.
|
||||
*
|
||||
* @author phil lips
|
||||
*/
|
||||
|
||||
public class HealOverTimePulse extends StatePulse {
|
||||
|
||||
/**The total amount of HP to heal*/
|
||||
|
||||
private int totalToHeal;
|
||||
|
||||
/**How many ticks to spread the heals over*/
|
||||
|
||||
private int ticksTotal;
|
||||
|
||||
/**How many times to heal the player during those ticks*/
|
||||
|
||||
private int timesToHeal;
|
||||
|
||||
private int currentTick;
|
||||
|
||||
/**
|
||||
* The entity.
|
||||
*/
|
||||
protected final Entity entity;
|
||||
|
||||
/**Constructs a new HealOverTimePulse object
|
||||
* @param entity the entity to heal over time
|
||||
* @param ticks the total time to spread the heal over
|
||||
* @param totalHeal the total amount to heal for
|
||||
* @param healInc how many times the total amount to heal is divided to*/
|
||||
|
||||
public HealOverTimePulse(Entity entity, int ticks, int totalHeal, int healInc, int currentTick){
|
||||
super(entity,0);
|
||||
this.entity = entity;
|
||||
this.ticksTotal = ticks;
|
||||
this.totalToHeal = totalHeal;
|
||||
this.timesToHeal = healInc;
|
||||
this.currentTick = currentTick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatePulse create(Entity entity, Object... args) {
|
||||
return new HealOverTimePulse(entity, (Integer) args[1],(Integer) args[2],(Integer) args[3],1);
|
||||
}
|
||||
|
||||
/** Checks if it can heal the player every pulse
|
||||
* the mod is funny math haha :)
|
||||
*/
|
||||
@Override
|
||||
public boolean pulse() {
|
||||
if(currentTick != 0){
|
||||
if(currentTick % (ticksTotal / timesToHeal) == 0){
|
||||
entity.getSkills().heal(totalToHeal / timesToHeal);
|
||||
}
|
||||
}
|
||||
currentTick += 1;
|
||||
return currentTick > ticksTotal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSaveRequired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(ByteBuffer buffer) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatePulse parse(Entity entity, ByteBuffer buffer) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user