Merges Injector

Welcome to the new world boys.
This commit is contained in:
zeruth
2019-06-06 20:47:41 -04:00
parent 79ed69ccdf
commit 882be3cb71
3613 changed files with 193663 additions and 158070 deletions
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.runeswag</groupId>
<artifactId>runeswag-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>api</artifactId>
<name>RuneSwag API</name>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
+241
View File
@@ -0,0 +1,241 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.coords.LocalPoint;
import api.coords.WorldArea;
import api.coords.WorldPoint;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.image.BufferedImage;
import javax.annotation.Nullable;
/**
* Represents a RuneScape actor/entity.
*/
public interface Actor extends Renderable
{
/**
* Gets the combat level of the actor.
*
* @return the combat level
*/
int getCombatLevel();
/**
* Gets the name of the actor.
*
* @return the name
*/
String getName();
/**
* Gets the actor being interacted with.
* <p>
* Examples of interaction include:
* <ul>
* <li>A monster focusing an Actor to attack</li>
* <li>Targetting a player to trade</li>
* <li>Following a player</li>
* </ul>
*
* @return the actor, null if no interaction is occurring
*/
Actor getInteracting();
/**
* Gets the health ratio of the actor.
* <p>
* The ratio is the number of green bars in the overhead
* HP display.
*
* @return the health ratio
*/
int getHealthRatio();
/**
* Gets the health of the actor.
*
* @return the health
*/
int getHealth();
/**
* Gets the server-side location of the actor.
* <p>
* This value is typically ahead of where the client renders and is not
* affected by things such as animations.
*
* @return the server location
*/
WorldPoint getWorldLocation();
/**
* Gets the client-side location of the actor.
*
* @return the client location
*/
LocalPoint getLocalLocation();
void setIdlePoseAnimation(int animation);
void setPoseAnimation(int animation);
/**
* Gets the orientation of the actor.
*
* @return the orientation
* @see api.coords.Angle
*/
int getOrientation();
/**
* Gets the current animation the actor is performing.
*
* @return the animation ID
* @see AnimationID
*/
int getAnimation();
/**
* Sets an animation for the actor to perform.
*
* @param animation the animation ID
* @see AnimationID
*/
void setAnimation(int animation);
/**
* Sets the frame of the animation the actor is performing.
*
* @param actionFrame the animation frame
*/
void setActionFrame(int actionFrame);
/**
* Gets the graphic that is currently on the player.
*
* @return the graphic of the actor
* @see GraphicID
*/
int getSpotAnimation();
void setSpotAnimation(int graphic);
void setSpotAnimationFrame(int spotAnimFrame);
/**
* Gets the canvas area of the current tile the actor is standing on.
*
* @return the current tile canvas area
*/
Polygon getCanvasTilePoly();
/**
* Gets the point at which text should be drawn, relative to the
* current location with the given z-axis offset.
*
* @param graphics engine graphics
* @param text the text to draw
* @param zOffset the z-axis offset
* @return the text drawing location
*/
@Nullable
Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset);
/**
* Gets the point at which an image should be drawn, relative to the
* current location with the given z-axis offset.
*
* @param image the image to draw
* @param zOffset the z-axis offset
* @return the image drawing location
*/
Point getCanvasImageLocation(BufferedImage image, int zOffset);
/**
* Gets the point at which a sprite should be drawn, relative to the
* current location with the given z-axis offset.
*
* @param sprite the sprite to draw
* @param zOffset the z-axis offset
* @return the sprite drawing location
*/
Point getCanvasSpriteLocation(Sprite sprite, int zOffset);
/**
* Gets a point on the canvas of where this actors mini-map indicator
* should appear.
*
* @return mini-map location on canvas
*/
Point getMinimapLocation();
/**
* Gets the logical height of the actors model.
* <p>
* This z-axis offset is roughly where the health bar of the actor
* is drawn.
*
* @return the logical height
*/
int getLogicalHeight();
/**
* Gets the convex hull of the actors model.
*
* @return the convex hull
* @see api.model.Jarvis
*/
Polygon getConvexHull();
/**
* Gets the world area that the actor occupies.
*
* @return the world area
*/
WorldArea getWorldArea();
/**
* Gets the overhead text that is displayed above the actor
*
* @return the overhead text
*/
String getOverheadText();
/**
* Sets the overhead text that is displayed above the actor
*
* @param overheadText the overhead text
*/
void setOverheadText(String overheadText);
/**
* Used by the "Tick Counter Plugin
*/
int getActionFrame();
int getActionFrameCycle();
}
+254
View File
@@ -0,0 +1,254 @@
/*
* Copyright (c) 2016-2017, Abel Briggs
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Utility class used for mapping animation IDs.
* <p>
* Note: This class is not complete and may not contain a specific animation
* required.
*/
public final class AnimationID
{
public static final int IDLE = -1;
public static final int HERBLORE_PESTLE_AND_MORTAR = 364;
public static final int WOODCUTTING_BRONZE = 879;
public static final int WOODCUTTING_IRON = 877;
public static final int WOODCUTTING_STEEL = 875;
public static final int WOODCUTTING_BLACK = 873;
public static final int WOODCUTTING_MITHRIL = 871;
public static final int WOODCUTTING_ADAMANT = 869;
public static final int WOODCUTTING_RUNE = 867;
public static final int WOODCUTTING_DRAGON = 2846;
public static final int WOODCUTTING_INFERNAL = 2117;
public static final int WOODCUTTING_3A_AXE = 7264;
public static final int CONSUMING = 829; // consuming consumables
public static final int FIREMAKING = 733;
public static final int DEATH = 836;
public static final int COOKING_FIRE = 897;
public static final int COOKING_RANGE = 896;
public static final int COOKING_WINE = 7529;
public static final int FLETCHING_BOW_CUTTING = 1248;
public static final int HUNTER_LAY_BOXTRAP_BIRDSNARE = 5208; //same for laying bird snares and box traps
public static final int HUNTER_LAY_DEADFALLTRAP = 5212; //setting up deadfall trap
public static final int HUNTER_LAY_NETTRAP = 5215; //setting up net trap
public static final int HUNTER_LAY_MANIACAL_MONKEY_BOULDER_TRAP = 7259; // setting up maniacal monkey boulder trap
public static final int HUNTER_CHECK_BIRD_SNARE = 5207;
public static final int HUNTER_CHECK_BOX_TRAP = 5212;
public static final int HERBLORE_MAKE_TAR = 5249;
public static final int FLETCHING_STRING_NORMAL_SHORTBOW = 6678;
public static final int FLETCHING_STRING_NORMAL_LONGBOW = 6684;
public static final int FLETCHING_STRING_OAK_SHORTBOW = 6679;
public static final int FLETCHING_STRING_OAK_LONGBOW = 6685;
public static final int FLETCHING_STRING_WILLOW_SHORTBOW = 6680;
public static final int FLETCHING_STRING_WILLOW_LONGBOW = 6686;
public static final int FLETCHING_STRING_MAPLE_SHORTBOW = 6681;
public static final int FLETCHING_STRING_MAPLE_LONGBOW = 6687;
public static final int FLETCHING_STRING_YEW_SHORTBOW = 6682;
public static final int FLETCHING_STRING_YEW_LONGBOW = 6688;
public static final int FLETCHING_STRING_MAGIC_SHORTBOW = 6683;
public static final int FLETCHING_STRING_MAGIC_LONGBOW = 6689;
public static final int GEM_CUTTING_OPAL = 890;
public static final int GEM_CUTTING_JADE = 891;
public static final int GEM_CUTTING_REDTOPAZ = 892;
public static final int GEM_CUTTING_SAPPHIRE = 888;
public static final int GEM_CUTTING_EMERALD = 889;
public static final int GEM_CUTTING_RUBY = 887;
public static final int GEM_CUTTING_DIAMOND = 886;
public static final int GEM_CUTTING_AMETHYST = 6295;
public static final int CRAFTING_LEATHER = 1249;
public static final int CRAFTING_GLASSBLOWING = 884;
public static final int CRAFTING_SPINNING = 894;
public static final int CRAFTING_POTTERS_WHEEL = 883;
public static final int CRAFTING_POTTERY_OVEN = 24975;
public static final int SMITHING_SMELTING = 899;
public static final int SMITHING_CANNONBALL = 827; //cball smithing uses this and SMITHING_SMELTING
public static final int SMITHING_ANVIL = 898;
public static final int FISHING_BIG_NET = 620;
public static final int FISHING_NET = 621;
public static final int FISHING_POLE_CAST = 623; // pole is in the water
public static final int FISHING_CAGE = 619;
public static final int FISHING_HARPOON = 618;
public static final int FISHING_BARBTAIL_HARPOON = 5108;
public static final int FISHING_DRAGON_HARPOON = 7401;
public static final int FISHING_INFERNAL_HARPOON = 7402;
public static final int FISHING_OILY_ROD = 622;
public static final int FISHING_KARAMBWAN = 1193;
public static final int FISHING_CRUSHING_INFERNAL_EELS = 7553;
public static final int FISHING_CUTTING_SACRED_EELS = 7151;
public static final int FISHING_BAREHAND = 6709;
public static final int MINING_BRONZE_PICKAXE = 625;
public static final int MINING_IRON_PICKAXE = 626;
public static final int MINING_STEEL_PICKAXE = 627;
public static final int MINING_BLACK_PICKAXE = 3873;
public static final int MINING_MITHRIL_PICKAXE = 629;
public static final int MINING_ADAMANT_PICKAXE = 628;
public static final int MINING_RUNE_PICKAXE = 624;
public static final int MINING_DRAGON_PICKAXE = 7139;
public static final int MINING_DRAGON_PICKAXE_ORN = 642;
public static final int MINING_INFERNAL_PICKAXE = 4482;
public static final int MINING_3A_PICKAXE = 7283;
public static final int MINING_MOTHERLODE_BRONZE = 6753;
public static final int MINING_MOTHERLODE_IRON = 6754;
public static final int MINING_MOTHERLODE_STEEL = 6755;
public static final int MINING_MOTHERLODE_BLACK = 3866;
public static final int MINING_MOTHERLODE_MITHRIL = 6757;
public static final int MINING_MOTHERLODE_ADAMANT = 6756;
public static final int MINING_MOTHERLODE_RUNE = 6752;
public static final int MINING_MOTHERLODE_DRAGON = 6758;
public static final int MINING_MOTHERLODE_DRAGON_ORN = 335;
public static final int MINING_MOTHERLODE_INFERNAL = 4481;
public static final int MINING_MOTHERLODE_3A = 7282;
public static final int DENSE_ESSENCE_CHIPPING = 7201;
public static final int DENSE_ESSENCE_CHISELING = 7202;
public static final int HERBLORE_POTIONMAKING = 363; //used for both herb and secondary
public static final int MAGIC_CHARGING_ORBS = 726;
public static final int MAGIC_MAKE_TABLET = 4068;
public static final int MAGIC_ENCHANTING_JEWELRY = 931;
public static final int MAGIC_ENCHANTING_AMULET_1 = 719; // sapphire, opal, diamond
public static final int MAGIC_ENCHANTING_AMULET_2 = 720; // emerald, jade, dragonstone
public static final int MAGIC_ENCHANTING_AMULET_3 = 721; // ruby, topaz, onyx, zenyte
public static final int BURYING_BONES = 827;
public static final int USING_GILDED_ALTAR = 3705;
public static final int LOOKING_INTO = 832;
public static final int DIG = 830;
public static final int DEMONIC_GORILLA_MAGIC_ATTACK = 7225;
public static final int DEMONIC_GORILLA_MELEE_ATTACK = 7226;
public static final int DEMONIC_GORILLA_RANGED_ATTACK = 7227;
public static final int DEMONIC_GORILLA_AOE_ATTACK = 7228;
public static final int DEMONIC_GORILLA_PRAYER_SWITCH = 7228;
public static final int DEMONIC_GORILLA_DEFEND = 7224;
public static final int BOOK_HOME_TELEPORT_1 = 4847;
public static final int BOOK_HOME_TELEPORT_2 = 4850;
public static final int BOOK_HOME_TELEPORT_3 = 4853;
public static final int BOOK_HOME_TELEPORT_4 = 4855;
public static final int BOOK_HOME_TELEPORT_5 = 4857;
public static final int COW_HOME_TELEPORT_1 = 1696;
public static final int COW_HOME_TELEPORT_2 = 1697;
public static final int COW_HOME_TELEPORT_3 = 1698;
public static final int COW_HOME_TELEPORT_4 = 1699;
public static final int COW_HOME_TELEPORT_5 = 1700;
public static final int COW_HOME_TELEPORT_6 = 1701;
public static final int CONSTRUCTION = 3676;
public static final int SAND_COLLECTION = 895;
public static final int PISCARILIUS_CRANE_REPAIR = 7199;
public static final int HOME_MAKE_TABLET = 4067;
public static final int THIEVING_STALL = 832;
public static final int PICKPOCKET_SUCCESS = 881;
//block animations for players and perhaps npcs as well?
public static final int BLOCK_DEFENDER = 4177;
public static final int BLOCK_NO_SHIELD = 420;
public static final int BLOCK_SHIELD = 1156;
public static final int BLOCK_SWORD = 388;
public static final int BLOCK_UNARMED = 424; // Same Animation as failed pickpocked
// NPC animations
public static final int TZTOK_JAD_MAGIC_ATTACK = 2656;
public static final int TZTOK_JAD_RANGE_ATTACK = 2652;
public static final int HELLHOUND_DEFENCE = 6566;
public static final int VORKATH_WAKE_UP = 7950;
public static final int VORKATH_DEATH = 7949;
public static final int VORKATH_SLASH_ATTACK = 7951;
public static final int VORKATH_ATTACK = 7952;
public static final int VORKATH_FIRE_BOMB_ATTACK = 7960;
public static final int VORKATH_ACID_ATTACK = 7957;
public static final int BLACKJACK_KO = 838;
public static final int VETION_EARTHQUAKE = 5507;
public static final int ZULRAH_DEATH = 5804;
// Farming
public static final int FARMING_HARVEST_FRUIT_TREE = 2280;
public static final int FARMING_HARVEST_BUSH = 2281;
public static final int FARMING_HARVEST_HERB = 2282;
public static final int FARMING_USE_COMPOST = 2283;
public static final int FARMING_CURE_WITH_POTION = 2288;
public static final int FARMING_PLANT_SEED = 2291;
public static final int FARMING_HARVEST_FLOWER = 2292;
public static final int FARMING_MIX_ULTRACOMPOST = 7699;
// Lunar spellbook
public static final int ENERGY_TRANSFER_VENGEANCE_OTHER = 4411;
public static final int MAGIC_LUNAR_SHARED = 4413; // Utilized by Fertile Soil, Boost/Stat Potion Share, NPC Contact, Bake Pie
public static final int MAGIC_LUNAR_CURE_PLANT = 4432;
public static final int MAGIC_LUNAR_GEOMANCY = 7118;
public static final int MAGIC_LUNAR_PLANK_MAKE = 6298;
public static final int MAGIC_LUNAR_STRING_JEWELRY = 4412;
// Arceuus spellbook
public static final int MAGIC_ARCEUUS_RESURRECT_CROPS = 7118;
// Battlestaff Crafting
public static final int CRAFTING_BATTLESTAVES = 7531;
// Death Animations
public static final int CAVE_KRAKEN_DEATH = 3993;
public static final int WIZARD_DEATH = 2553;
public static final int GARGOYLE_DEATH = 1520;
public static final int MARBLE_GARGOYLE_DEATH = 7813;
public static final int LIZARD_DEATH = 2778;
public static final int ROCKSLUG_DEATH = 1568;
public static final int ZYGOMITE_DEATH = 3327;
public static final int IMP_DEATH = 172;
// POH Animations
public static final int INCENSE_BURNER = 3687;
public static final int LOW_LEVEL_MAGIC_ATTACK = 1162;
public static final int HIGH_LEVEL_MAGIC_ATTACK = 1167;
public static final int BLOWPIPE_ATTACK = 5061;
// Tekton
public static final int TEKTON_ANVIL = 7475;
public static final int TEKTON_AUTO1 = 7482;
public static final int TEKTON_AUTO2 = 7483;
public static final int TEKTON_AUTO3 = 7484;
public static final int TEKTON_FAST_AUTO1 = 7478;
public static final int TEKTON_FAST_AUTO2 = 7488;
public static final int TEKTON_ENRAGE_AUTO1 = 7492;
public static final int TEKTON_ENRAGE_AUTO2 = 7493;
public static final int TEKTON_ENRAGE_AUTO3 = 7494;
// Hydra
public static final int HYDRA_POISON_1 = 8234;
public static final int HYDRA_RANGED_1 = 8235;
public static final int HYDRA_MAGIC_1 = 8236;
public static final int HYDRA_1_1 = 8237;
public static final int HYDRA_1_2 = 8238;
public static final int HYDRA_LIGHTNING = 8241;
public static final int HYDRA_RANGED_2 = 8242;
public static final int HYDRA_MAGIC_2 = 8243;
public static final int HYDRA_2_1 = 8244;
public static final int HYDRA_2_2 = 8245;
public static final int HYDRA_FIRE = 8248;
public static final int HYDRA_RANGED_3 = 8249;
public static final int HYDRA_MAGIC_3 = 8250;
public static final int HYDRA_3_1 = 8251;
public static final int HYDRA_3_2 = 8252;
public static final int HYDRA_MAGIC_4 = 8254;
public static final int HYDRA_POISON_4 = 8254;
public static final int HYDRA_RANGED_4 = 8255;
public static final int HYDRA_4_1 = 8257;
public static final int HYDRA_4_2 = 8258;
}
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents an engine graphic buffer.
*/
public interface BufferProvider
{
int[] getPixels();
int getWidth();
int getHeight();
}
+54
View File
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2017. l2-
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents the buffer containing all messages in the chatbox.
*/
public interface ChatLineBuffer
{
/**
* Gets an array of message nodes currently in the chatbox.
*
* @return messages in the chatbox
*/
MessageNode[] getLines();
/**
* Gets the length of the {@link #getLines()} array.
*
* @return the length
*/
int getLength();
/**
* Removes a message node
*
* @param node the {@link MessageNode} to remove
*/
void removeMessageNode(MessageNode node);
}
+179
View File
@@ -0,0 +1,179 @@
/*
* Copyright (c) 2017, Seth <Sethtroll3@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Enumeration of message types that can be received in the chat.
*/
@AllArgsConstructor
@Getter
public enum ChatMessageType
{
/**
* A normal game message.
*/
GAMEMESSAGE(0),
/**
* A message in the public chat from a moderator
*/
MODCHAT(1),
/**
* A message in the public chat.
*/
PUBLICCHAT(2),
/**
* A private message from another player.
*/
PRIVATECHAT(3),
/**
* A message that the game engine sends.
*/
ENGINE(4),
/**
* A message received when a friend logs in or out.
*/
LOGINLOGOUTNOTIFICATION(5),
/**
* A private message sent to another player.
*/
PRIVATECHATOUT(6),
/**
* A private message received from a moderator.
*/
MODPRIVATECHAT(7),
/**
* A message received in clan chat.
*/
FRIENDSCHAT(9),
/**
* A message received with information about the current clan chat.
*/
FRIENDSCHATNOTIFICATION(11),
/**
* A trade request being sent.
*/
TRADE_SENT(12),
/**
* A game broadcast.
*/
BROADCAST(14),
/**
* An abuse report submitted.
*/
SNAPSHOTFEEDBACK(26),
/**
* Examine item description.
*/
ITEM_EXAMINE(27),
/**
* Examine NPC description.
*/
NPC_EXAMINE(28),
/**
* Examine object description.
*/
OBJECT_EXAMINE(29),
/**
* Adding player to friend list.
*/
FRIENDNOTIFICATION(30),
/**
* Adding player to ignore list.
*/
IGNORENOTIFICATION(31),
/**
* An autotyper message from a player.
*/
AUTOTYPER(90),
/**
* An autotyper message from a mod.
*/
MODAUTOTYPER(91),
/**
* A game message (ie. when a setting is changed).
*/
CONSOLE(99),
/**
* A message received when somebody sends a trade offer.
*/
TRADEREQ(101),
/**
* A message received when completing a trade or a duel
*/
TRADE(102),
/**
* A message received when somebody sends a duel offer.
*/
CHALREQ_TRADE(103),
/**
* A message received when someone sends a clan challenge offer.
*/
CHALREQ_FRIENDSCHAT(104),
/**
* A message that was filtered.
*/
SPAM(105),
/**
* A message that is relating to the player.
*/
PLAYERRELATED(106),
/**
* A message that times out after 10 seconds.
*/
TENSECTIMEOUT(107),
/**
* An unknown message type.
*/
UNKNOWN(-1);
private final int type;
private static final Map<Integer, ChatMessageType> CHAT_MESSAGE_TYPES = new HashMap<>();
static
{
for (ChatMessageType chatMessageType : values())
{
CHAT_MESSAGE_TYPES.put(chatMessageType.type, chatMessageType);
}
}
/**
* Utility method that maps the type value to its respective
* {@link ChatMessageType} value.
*
* @param type the raw type
* @return appropriate message type, or {@link #UNKNOWN}
*/
public static ChatMessageType of(int type)
{
return CHAT_MESSAGE_TYPES.getOrDefault(type, UNKNOWN);
}
}
+33
View File
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents a player in the chat.
*/
public interface ChatPlayer extends Nameable
{
int getWorld();
}
+52
View File
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents a clan member.
*/
public interface ClanMember extends ChatPlayer
{
/**
* Gets the username of the member.
*
* @return the username
*/
String getUsername();
/**
* Gets the world the member is in.
*
* @return the world
*/
int getWorld();
/**
* Gets the rank of the clan member.
*
* @return the rank
*/
ClanMemberRank getRank();
}
+106
View File
@@ -0,0 +1,106 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* An enumeration of ranks of clan members.
*/
@AllArgsConstructor
@Getter
public enum ClanMemberRank
{
/**
* Not in a clan.
*/
UNRANKED(-1),
/**
* Friend rank.
*/
FRIEND(0),
/**
* Recruit rank.
*/
RECRUIT(1),
/**
* Corporal rank.
*/
CORPORAL(2),
/**
* Sergeant rank.
*/
SERGEANT(3),
/**
* Lieutenant rank.
*/
LIEUTENANT(4),
/**
* Captain rank.
*/
CAPTAIN(5),
/**
* General rank.
*/
GENERAL(6),
/**
* Channel owner rank.
*/
OWNER(7),
/**
* JMod rank.
*/
JMOD(127);
private static final Map<Integer, ClanMemberRank> RANKS = new HashMap<>();
static
{
for (final ClanMemberRank clanMemberRank : ClanMemberRank.values())
{
RANKS.put(clanMemberRank.value, clanMemberRank);
}
}
/**
* Utility method that maps the rank value to its respective
* {@link ClanMemberRank} value.
*
* @param rank the rank value
* @return rank type
*/
public static ClanMemberRank valueOf(int rank)
{
return RANKS.get(rank);
}
/**
* The value of the clan rank.
*/
private final int value;
}
File diff suppressed because it is too large Load Diff
+46
View File
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2018, Woox <https://github.com/wooxsolo>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents tile collision data for the scene
*/
public interface CollisionData
{
/**
* Gets a 2D array of tile collision flags.
* <p>
* The array covers all tiles in the scene (104x104), and the index into
* the array is of format [x][y] where x and y are the tiles scene
* coordinates, respectively.
* <p>
* Collision flags are checked using the bitwise and (&amp;) operator. Flag
* values can be obtained and used with the {@link CollisionDataFlag} class.
*
* @return all collision flags for the tiles in the scene
* @see api.config.Constants#SCENE_SIZE
*/
int[][] getFlags();
}
@@ -0,0 +1,63 @@
/*
* Copyright (c) 2018, Woox <https://github.com/wooxsolo>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* A utility class containing collision data flags for tiles.
*/
public final class CollisionDataFlag
{
/**
* Directional movement blocking flags.
*/
public static final int BLOCK_MOVEMENT_NORTH_WEST = 0x1;
public static final int BLOCK_MOVEMENT_NORTH = 0x2;
public static final int BLOCK_MOVEMENT_NORTH_EAST = 0x4;
public static final int BLOCK_MOVEMENT_EAST = 0x8;
public static final int BLOCK_MOVEMENT_SOUTH_EAST = 0x10;
public static final int BLOCK_MOVEMENT_SOUTH = 0x20;
public static final int BLOCK_MOVEMENT_SOUTH_WEST = 0x40;
public static final int BLOCK_MOVEMENT_WEST = 0x80;
/**
* Movement blocking type flags.
*/
public static final int BLOCK_MOVEMENT_OBJECT = 0x100;
public static final int BLOCK_MOVEMENT_FLOOR_DECORATION = 0x40000;
public static final int BLOCK_MOVEMENT_FLOOR = 0x200000; // Eg. water
public static final int BLOCK_MOVEMENT_FULL =
BLOCK_MOVEMENT_OBJECT |
BLOCK_MOVEMENT_FLOOR_DECORATION |
BLOCK_MOVEMENT_FLOOR;
/**
* Directional line of sight blocking flags.
*/
public static final int BLOCK_LINE_OF_SIGHT_NORTH = BLOCK_MOVEMENT_NORTH << 9; // 0x400
public static final int BLOCK_LINE_OF_SIGHT_EAST = BLOCK_MOVEMENT_EAST << 9; // 0x1000
public static final int BLOCK_LINE_OF_SIGHT_SOUTH = BLOCK_MOVEMENT_SOUTH << 9; // 0x4000
public static final int BLOCK_LINE_OF_SIGHT_WEST = BLOCK_MOVEMENT_WEST << 9; // 0x10000
public static final int BLOCK_LINE_OF_SIGHT_FULL = 0x20000;
}
+105
View File
@@ -0,0 +1,105 @@
/*
* Copyright (c) 2018, Lotto <https://github.com/devLotto>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import java.awt.Dimension;
/**
* A utility class containing constant values.
*/
public class Constants
{
/**
* The original width of the game when running in fixed mode.
*/
public static final int GAME_FIXED_WIDTH = 765;
/**
* The original height of the game when running in fixed mode.
*/
public static final int GAME_FIXED_HEIGHT = 503;
/**
* Dimension representation of the width and height of the game in fixed mode.
*/
public static final Dimension GAME_FIXED_SIZE = new Dimension(GAME_FIXED_WIDTH, GAME_FIXED_HEIGHT);
/**
* The aspect ratio of the game when running in fixed mode.
*/
public static final double GAME_FIXED_ASPECT_RATIO = (double) GAME_FIXED_WIDTH / (double) GAME_FIXED_HEIGHT;
/**
* The default camera zoom value.
*/
public static final int CLIENT_DEFAULT_ZOOM = 512;
/**
* The width and length of a chunk (8x8 tiles).
*/
public static final int CHUNK_SIZE = 8;
/**
* The width and length of a map region (64x64 tiles).
*/
public static final int REGION_SIZE = 64;
/**
* The width and length of the scene (13 chunks x 8 tiles).
*/
public static final int SCENE_SIZE = 104;
/**
* The max allowed plane by the game.
* <p>
* This value is exclusive. The plane is set by 2 bits which restricts
* the plane value to 0-3.
*/
public static final int MAX_Z = 4;
public static final int TILE_FLAG_BRIDGE = 2;
/**
* The number of milliseconds in a client tick.
* <p>
* This is the length of a single frame when the client is running at
* the maximum framerate of 50 fps.
*/
public static final int CLIENT_TICK_LENGTH = 20;
/**
* The number of milliseconds in a server game tick.
* <p>
* This is the length of a single game cycle under ideal conditions.
* All game-play actions operate within multiples of this duration.
*/
public static final int GAME_TICK_LENGTH = 600;
/**
* Used when getting High Alchemy value - multiplied by general store price.
*/
public static final float HIGH_ALCHEMY_CONSTANT = 0.6f;
}
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import java.awt.Polygon;
/**
* Represents a decorative object, such as an object on a wall.
*/
public interface DecorativeObject extends TileObject
{
/**
* Gets the convex hull of the objects model.
*
* @return the convex hull
* @see api.model.Jarvis
*/
Polygon getConvexHull();
Polygon getConvexHull2();
Renderable getRenderable();
Renderable getRenderable2();
}
+38
View File
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2019, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public interface EnumDefinition
{
int[] getKeys();
int[] getIntVals();
String[] getStringVals();
int getIntValue(int key);
String getStringValue(int key);
}
+49
View File
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2019, Shaun Dreclin <https://github.com/ShaunDreclin>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Utility class used for mapping enum IDs.
* <p>
* Note: This class is not complete and may be missing mapped IDs.
*/
public final class EnumID
{
public static final int MUSIC_TRACK_NAMES = 812;
public static final int MUSIC_TRACK_IDS = 819;
/**
* Translates spellbook varbit into enum ID
*/
public static final int SPELLBOOKS = 1981;
/**
* key: index in spellbook, value: NullItemID corresponding to spell
*/
public static final int STANDARD_SPELLBOOK = 1982;
public static final int ANCIENT_SPELLBOOK = 1983;
public static final int LUNAR_SPELLBOOK = 1984;
public static final int ARCEUUS_SPELLBOOK = 1985;
}
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* An enumeration of equipment slots in the inventory {@link ItemContainer}.
* <p>
* These values are intended for use with the local players equipment
* {@link ItemContainer} corresponding. For obtaining information about equipment
* in the {@link PlayerAppearance}, use {@link api.kit.KitType}.
*
* @see Client#getItemContainer(InventoryID)
* @see InventoryID#EQUIPMENT
*/
public enum EquipmentInventorySlot
{
HEAD(0),
CAPE(1),
AMULET(2),
WEAPON(3),
BODY(4),
SHIELD(5),
LEGS(7),
GLOVES(9),
BOOTS(10),
RING(12),
AMMO(13);
private final int slotIdx;
EquipmentInventorySlot(int slotIdx)
{
this.slotIdx = slotIdx;
}
/**
* Gets the index into the item array obtained from
* {@link ItemContainer#getItems()}.
*
* @return the raw index
*/
public int getSlotIdx()
{
return slotIdx;
}
}
+277
View File
@@ -0,0 +1,277 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* A utility class used for calculating experience related values.
* <p>
* Skill levels calculated and handled by this class are within (inclusive)
* the range 1-126 rather than 1-99 to account for virtual levels obtained
* when reaching the 200M experience limit.
*/
public class Experience
{
/**
* Maximum effective skill level at 13,034,431 experience.
*/
public static final int MAX_REAL_LEVEL = 99;
/**
* The maximum virtual skill level for any skill (200M experience).
*/
public static final int MAX_VIRT_LEVEL = 126;
public static final int MAX_SKILL_XP = 200_000_000;
/**
* The maximum possible combat level.
*/
public static final int MAX_COMBAT_LEVEL = 126;
/**
* The total experience required for each skill level.
*/
private static final int[] XP_FOR_LEVEL = new int[MAX_VIRT_LEVEL];
static
{
int xp = 0;
for (int level = 1; level <= MAX_VIRT_LEVEL; ++level)
{
XP_FOR_LEVEL[level - 1] = xp / 4;
int difference = (int) ((double) level + 300.0 * Math.pow(2.0, (double) level / 7.0));
xp += difference;
}
}
/**
* Gets the total experience required to obtain the passed skill
* level.
*
* @param level the skill level
* @return the required experience for the level
* @throws IllegalArgumentException if skill level is invalid
*/
public static int getXpForLevel(int level)
{
if (level < 1 || level > MAX_VIRT_LEVEL)
{
throw new IllegalArgumentException(level + " is not a valid level");
}
// XP_FOR_LEVEL[0] is XP for level 1
return XP_FOR_LEVEL[level - 1];
}
/**
* Gets the skill level for the passed total experience.
*
* @param xp the passed experience (non-negative)
* @return the skill level
*/
public static int getLevelForXp(int xp)
{
if (xp < 0)
{
throw new IllegalArgumentException("XP (" + xp + ") must not be negative");
}
int low = 0;
int high = XP_FOR_LEVEL.length - 1;
while (low <= high)
{
int mid = low + (high - low) / 2;
int xpForLevel = XP_FOR_LEVEL[mid];
if (xp < xpForLevel)
{
high = mid - 1;
}
else if (xp > xpForLevel)
{
low = mid + 1;
}
else
{
return mid + 1;
}
}
return high + 1;
}
private static double getMeleeRangeOrMagicCombatLevelContribution(int attackLevel, int strengthLevel, int magicLevel, int rangeLevel)
{
double melee = 0.325 * (attackLevel + strengthLevel);
double range = 0.325 * (Math.floor(rangeLevel / 2) + rangeLevel);
double magic = 0.325 * (Math.floor(magicLevel / 2) + magicLevel);
return Math.max(melee, Math.max(range, magic));
}
/**
* Calculates a non-virtual high-precision combat level without integer
* rounding.
* <p>
* Combat levels range between 1.15 and ~126.1.
*
* @param attackLevel the attack level
* @param strengthLevel the strength level
* @param defenceLevel the defence level
* @param hitpointsLevel the hitpoints level
* @param magicLevel the magic level
* @param rangeLevel the range level
* @param prayerLevel the prayer level
* @return the non-virtual combat level
*/
public static double getCombatLevelPrecise(int attackLevel, int strengthLevel,
int defenceLevel, int hitpointsLevel, int magicLevel,
int rangeLevel, int prayerLevel)
{
double base = 0.25 * (defenceLevel + hitpointsLevel + Math.floor(prayerLevel / 2));
double typeContribution = getMeleeRangeOrMagicCombatLevelContribution(attackLevel, strengthLevel, magicLevel, rangeLevel);
return base + typeContribution;
}
/**
* Calculates a regular combat level.
*
* @param attackLevel the attack level
* @param strengthLevel the strength level
* @param defenceLevel the defence level
* @param hitpointsLevel the hitpoints level
* @param magicLevel the magic level
* @param rangeLevel the range level
* @param prayerLevel the prayer level
* @return the combat level, rounded down
*/
public static int getCombatLevel(int attackLevel, int strengthLevel,
int defenceLevel, int hitpointsLevel, int magicLevel,
int rangeLevel, int prayerLevel)
{
return (int) getCombatLevelPrecise(attackLevel, strengthLevel, defenceLevel, hitpointsLevel, magicLevel, rangeLevel, prayerLevel);
}
/**
* Calculate number of attack/strength levels required to increase combat level.
*
* @param attackLevel the attack level
* @param strengthLevel the strength level
* @param defenceLevel the defence level
* @param hitpointsLevel the hitpoints level
* @param magicLevel the magic level
* @param rangeLevel the range level
* @param prayerLevel the prayer level
* @return the number of levels required
*/
public static int getNextCombatLevelMelee(int attackLevel, int strengthLevel, int defenceLevel, int hitpointsLevel,
int magicLevel, int rangeLevel, int prayerLevel)
{
int nextCombatLevel = Experience.getCombatLevel(attackLevel, strengthLevel, defenceLevel, hitpointsLevel, magicLevel, rangeLevel, prayerLevel) + 1;
return (int) Math.ceil(-10. / 13 * (defenceLevel + hitpointsLevel + Math.floor(prayerLevel / 2) - 4 * nextCombatLevel)) - strengthLevel - attackLevel;
}
/**
* Calculate number of hitpoints/defence levels required to increase combat level.
*
* @param attackLevel the attack level
* @param strengthLevel the strength level
* @param defenceLevel the defence level
* @param hitpointsLevel the hitpoints level
* @param magicLevel the magic level
* @param rangeLevel the range level
* @param prayerLevel the prayer level
* @return the number of levels required
*/
public static int getNextCombatLevelHpDef(int attackLevel, int strengthLevel, int defenceLevel, int hitpointsLevel,
int magicLevel, int rangeLevel, int prayerLevel)
{
int nextCombatLevel = Experience.getCombatLevel(attackLevel, strengthLevel, defenceLevel, hitpointsLevel, magicLevel, rangeLevel, prayerLevel) + 1;
double typeContribution = Experience.getMeleeRangeOrMagicCombatLevelContribution(attackLevel, strengthLevel, magicLevel, rangeLevel);
return (int) Math.ceil(4 * nextCombatLevel - Math.floor(prayerLevel / 2) - 4 * typeContribution) - hitpointsLevel - defenceLevel;
}
/**
* Calculate number of magic levels required to increase combat level.
*
* @param attackLevel the attack level
* @param strengthLevel the strength level
* @param defenceLevel the defence level
* @param hitpointsLevel the hitpoints level
* @param magicLevel the magic level
* @param rangeLevel the range level
* @param prayerLevel the prayer level
* @return the number of levels required
*/
public static int getNextCombatLevelMagic(int attackLevel, int strengthLevel, int defenceLevel, int hitpointsLevel,
int magicLevel, int rangeLevel, int prayerLevel)
{
int nextCombatLevel = Experience.getCombatLevel(attackLevel, strengthLevel, defenceLevel, hitpointsLevel, magicLevel, rangeLevel, prayerLevel) + 1;
return (int) Math.ceil(2. / 3 * Math.ceil(-10. / 13 * (hitpointsLevel + defenceLevel - 4 * nextCombatLevel + Math.floor(prayerLevel / 2)))) - magicLevel;
}
/**
* Calculate number of ranged levels required to increase combat level.
*
* @param attackLevel the attack level
* @param strengthLevel the strength level
* @param defenceLevel the defence level
* @param hitpointsLevel the hitpoints level
* @param magicLevel the magic level
* @param rangeLevel the range level
* @param prayerLevel the prayer level
* @return the number of levels required
*/
public static int getNextCombatLevelRange(int attackLevel, int strengthLevel, int defenceLevel, int hitpointsLevel,
int magicLevel, int rangeLevel, int prayerLevel)
{
int nextCombatLevel = Experience.getCombatLevel(attackLevel, strengthLevel, defenceLevel, hitpointsLevel, magicLevel, rangeLevel, prayerLevel) + 1;
return (int) Math.ceil(2. / 3 * Math.ceil(-10. / 13 * (hitpointsLevel + defenceLevel - 4 * nextCombatLevel + Math.floor(prayerLevel / 2)))) - rangeLevel;
}
/**
* Calculate number of prayer levels required to increase combat level.
*
* @param attackLevel the attack level
* @param strengthLevel the strength level
* @param defenceLevel the defence level
* @param hitpointsLevel the hitpoints level
* @param magicLevel the magic level
* @param rangeLevel the range level
* @param prayerLevel the prayer level
* @return the number of levels required
*/
public static int getNextCombatLevelPrayer(int attackLevel, int strengthLevel, int defenceLevel, int hitpointsLevel,
int magicLevel, int rangeLevel, int prayerLevel)
{
int nextCombatLevel = Experience.getCombatLevel(attackLevel, strengthLevel, defenceLevel, hitpointsLevel, magicLevel, rangeLevel, prayerLevel) + 1;
double typeContribution = Experience.getMeleeRangeOrMagicCombatLevelContribution(attackLevel, strengthLevel, magicLevel, rangeLevel);
return 2 * (int) Math.ceil(-hitpointsLevel - defenceLevel + 4 * nextCombatLevel - 4 * typeContribution) - prayerLevel;
}
}
+45
View File
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2019 William <https://github.com/monsterxsync>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* An enumeration of Kourend house favour the player can earn.
*/
@RequiredArgsConstructor
@Getter
public enum Favour
{
ARCEUUS("Arceuus", Varbits.KOUREND_FAVOR_ARCEUUS),
HOSIDIUS("Hosidius", Varbits.KOUREND_FAVOR_HOSIDIUS),
LOVAKENGJ("Lovakengj", Varbits.KOUREND_FAVOR_LOVAKENGJ),
PISCARILIUS("Piscarilius", Varbits.KOUREND_FAVOR_PISCARILIUS),
SHAYZIEN("Shayzien", Varbits.KOUREND_FAVOR_SHAYZIEN);
private final String name;
private final Varbits varbit;
}
+57
View File
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2018 Abex
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* IDs of fonts in the cache
*/
public final class FontID
{
public static final int PLAIN_11 = 494;
public static final int PLAIN_12 = 495;
public static final int BOLD_12 = 496;
public static final int QUILL_8 = 497;
public static final int QUILL_MEDIUM = 645;
public static final int QUILL_CAPS_LARGE = 646;
public static final int FAIRY_SMALL = 647;
public static final int FAIRY_LARGE = 648;
public static final int BARBARIAN = 764;
public static final int SUROK = 819;
public static final int VERDANA_11 = 1442;
public static final int VERDANA_11_BOLD = 1443;
public static final int TAHOMA_11 = 1444;
public static final int VERDANA_13 = 1445;
public static final int VERDANA_13_BOLD = 1446;
public static final int VERDANA_15 = 1447;
}
+35
View File
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2018 Abex
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* A bitmap Font in Jagex's format
*/
public interface FontTypeFace
{
int getTextWidth(String text);
int getBaseline();
}
+45
View File
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents a player in the friends list.
*/
public interface Friend extends ChatPlayer
{
/**
* The name of the player.
*
* @return the name
*/
String getName();
/**
* The previous name the player had.
*
* @return the previous name
*/
String getPrevName();
}
+32
View File
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents the friend and ignore list manager.
*/
public interface FriendManager
{
}
+72
View File
@@ -0,0 +1,72 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.coords.Angle;
import java.awt.Polygon;
/**
* Represents a game object.
* <p>
* Most object in the RuneScape world are considered as game objects. Things
* such as trees, anvils, boxes, etc are all game objects.
*/
public interface GameObject extends TileObject
{
/**
* Gets the minimum x and y scene coordinate pair for this game object.
*
* @return the minimum scene coordinate
*/
Point getSceneMinLocation();
/**
* Gets the maximum x and y scene coordinate pair for this game object.
* <p>
* This value differs from {@link #getSceneMinLocation()} when the size
* of the object is more than 1 tile.
*
* @return the maximum scene coordinate
*/
Point getSceneMaxLocation();
/**
* Gets the convex hull of the actors model.
*
* @return the convex hull
* @see api.model.Jarvis
*/
Polygon getConvexHull();
/**
* Gets the orientation of the object.
*
* @return the orientation
*/
Angle getOrientation();
Renderable getRenderable();
}
+59
View File
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2018 Abex
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.hooks.DrawCallbacks;
import java.awt.Canvas;
/**
* Represents the client game engine.
*/
public interface GameShell
{
/**
* Gets the canvas that contains everything.
*
* @return the game canvas
*/
Canvas getCanvas();
/**
* Gets the client main thread.
*
* @return the main thread
*/
Thread getClientThread();
/**
* Checks whether this code is executing on the client main thread.
*
* @return true if on the main thread, false otherwise
*/
boolean isClientThread();
DrawCallbacks getDrawCallbacks();
void resizeCanvas();
}
+93
View File
@@ -0,0 +1,93 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* An enumeration of game states the client is in.
*/
public enum GameState
{
/**
* Unknown game state.
*/
UNKNOWN(-1),
/**
* The client is starting.
*/
STARTING(0),
/**
* The client is at the login screen.
*/
LOGIN_SCREEN(10),
/**
* There is a player logging in.
*/
LOGGING_IN(20),
/**
* The game is being loaded.
*/
LOADING(25),
/**
* The user has successfully logged in.
*/
LOGGED_IN(30),
/**
* Connection to the server was lost.
*/
CONNECTION_LOST(40),
/**
* A world hop is taking place.
*/
HOPPING(45);
/**
* The raw state value.
*/
private final int state;
GameState(int state)
{
this.state = state;
}
/**
* Utility method that maps the rank value to its respective
* {@link GameState} value.
*
* @param state the raw state value
* @return the gamestate
*/
public static GameState of(int state)
{
for (GameState gs : GameState.values())
{
if (gs.state == state)
{
return gs;
}
}
return UNKNOWN;
}
}
@@ -0,0 +1,50 @@
package api;
/**
* Represents an offer in a grand exchange slot.
*/
public interface GrandExchangeOffer
{
/**
* Gets the quantity of bought or sold items.
*
* @return the quantity bought or sold
*/
int getQuantitySold();
/**
* Gets the ID of the item being bought or sold.
*
* @return item ID
* @see ItemID
*/
int getItemId();
/**
* Gets the total quantity being bought or sold.
*
* @return the total quantity
*/
int getTotalQuantity();
/**
* Gets the offer or sell price per item.
*
* @return the offer price
*/
int getPrice();
/**
* Gets the total amount of money spent so far.
*
* @return the amount spent
*/
int getSpent();
/**
* Gets the current state of the offer.
*
* @return the offers state
*/
GrandExchangeOfferState getState();
}
@@ -0,0 +1,36 @@
package api;
/**
* Describes the state of a Grand Exchange offer.
*/
public enum GrandExchangeOfferState
{
/**
* An empty slot.
*/
EMPTY,
/**
* A cancelled buy offer.
*/
CANCELLED_BUY,
/**
* A cancelled sell offer.
*/
CANCELLED_SELL,
/**
* A buy offer that is currently in progress.
*/
BUYING,
/**
* A buy offer that has completed.
*/
BOUGHT,
/**
* A sell offer that is currently in progress.
*/
SELLING,
/**
* A sell offer that has completed.
*/
SOLD;
}
+55
View File
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* Copyright (c) 2019, Ganom <https://github.com/Ganom>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public class GraphicID
{
public static final int SPLASH = 85;
public static final int GREY_BUBBLE_TELEPORT = 86;
public static final int TELEPORT = 111;
public static final int ENTANGLE = 179;
public static final int SNARE = 180;
public static final int BIND = 181;
public static final int ICE_RUSH = 361;
public static final int ICE_BURST = 363;
public static final int ICE_BLITZ = 367;
public static final int ICE_BARRAGE = 369;
public static final int VENGEANCE_OTHER = 725;
public static final int VENGEANCE = 726;
public static final int NPC_CONTACT = 728;
public static final int POT_SHARE = 733;
public static final int BAKE_PIE = 746;
public static final int BOOK_HOME_TELEPORT_1 = 800;
public static final int BOOK_HOME_TELEPORT_2 = 802;
public static final int BOOK_HOME_TELEPORT_3 = 803;
public static final int BOOK_HOME_TELEPORT_4 = 804;
public static final int STAFF_OF_THE_DEAD = 1228;
public static final int IMBUED_HEART = 1316;
public static final int FLYING_FISH = 1387;
public static final int OLM_BURN = 1351;
public static final int OLM_TELEPORT = 1359;
public static final int XERIC_TELEPORT = 1612;
}
+58
View File
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2018, Woox <https://github.com/wooxsolo>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.coords.LocalPoint;
/**
* Represents a graphics object.
*/
public interface GraphicsObject extends Renderable
{
/**
* The graphics object ID.
*
* @return the ID
*/
int getId();
/**
* The location of the object.
*
* @return the location
*/
LocalPoint getLocation();
int getStartCycle();
int getLevel();
/**
* Gets the height of the graphic.
*
* @return the height
*/
int getHeight();
}
+33
View File
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents an object on the ground of a tile.
*/
public interface GroundObject extends TileObject
{
Renderable getRenderable();
}
+25
View File
@@ -0,0 +1,25 @@
package api;
import java.util.Collection;
/**
* A data structure that uses a hash function to compute an index into an
* array of buckets from which node objects can be quickly obtained.
*/
public interface HashTable<T extends Node>
{
/**
* Gets a node by its hash value.
*
* @param value the node value
* @return the associated node
*/
T get(long value);
/**
* Gets a collection of all nodes stored in this table.
*
* @return the nodes stored
*/
Collection<T> getNodes();
}
+60
View File
@@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* An enumeration of prayer icons above the head.
*/
public enum HeadIcon
{
/**
* Protect from melee.
*/
MELEE,
/**
* Protect from ranged.
*/
RANGED,
/**
* Protect from magic.
*/
MAGIC,
/**
* Retribution prayer.
*/
RETRIBUTION,
/**
* Smite prayer.
*/
SMITE,
/**
* Redemption prayer.
*/
REDEMPTION,
/**
* Protect from range and mage (ie. used by Kalphite Queen).
*/
RANGE_MAGE
}
+34
View File
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2019, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public interface HealthBar
{
Sprite getHealthBarFrontSprite();
Sprite getHealthBarBackSprite();
void setPadding(int padding);
}
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2019, Lotto <https://github.com/devLotto>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.Data;
@Data
public class HealthBarOverride
{
public final Sprite frontSprite;
public final Sprite backSprite;
public final Sprite frontSpriteLarge;
public final Sprite backSpriteLarge;
}
+58
View File
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* An enumeration of hint arrow types.
*/
@AllArgsConstructor
public enum HintArrowType
{
/**
* No hint arrow present.
*/
NONE(0),
/**
* Hint arrow is pointing to a player.
*/
PLAYER(10),
/**
* Hint arrow is pointing to an NPC.
*/
NPC(1),
/**
* Hint arrow is pointing at a position in the world.
*/
WORLD_POSITION(2);
/**
* The raw type value.
*/
@Getter
private final int value;
}
+110
View File
@@ -0,0 +1,110 @@
/*
* Copyright (c) 2018, Woox <https://github.com/wooxsolo>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.Getter;
/**
* A hitsplat that has been applied to an {@link Actor}.
*/
public class Hitsplat
{
/**
* An enumeration of hitsplat types.
*/
public enum HitsplatType
{
/**
* Blocking damage (blue).
*/
BLOCK,
/**
* Taking damage (red).
*/
DAMAGE,
/**
* Damage from poison (green).
*/
POISON,
/**
* Damage from venom (teal).
*/
VENOM,
/**
* Damage from disease (orange).
*/
DISEASE,
/**
* Healing (purple).
*/
HEAL;
/**
* Utility method that maps the type value to its respective
* {@link Hitsplat} value.
*
* @param type the type value
* @return hitsplat type
*/
public static HitsplatType fromInteger(int type)
{
switch (type)
{
case 0: return BLOCK;
case 1: return DAMAGE;
case 2: return POISON;
case 4: return DISEASE;
case 5: return VENOM;
case 6: return HEAL;
}
return null;
}
}
/**
* The type of hitsplat.
*/
@Getter
private HitsplatType hitsplatType;
/**
* The value displayed by the hitsplat.
*/
@Getter
private int amount;
/**
* When the hitsplat will disappear.
*/
@Getter
private int disappearsOnGameCycle;
public Hitsplat(HitsplatType hitsplatType, int amount, int disappearsOnGameCycle)
{
this.hitsplatType = hitsplatType;
this.amount = amount;
this.disappearsOnGameCycle = disappearsOnGameCycle;
}
}
+58
View File
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2018, Hydrox6 <ikada@protonmail.ch>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* Enum of all official icons that Jagex uses in chat.
*/
@RequiredArgsConstructor
@Getter
public enum IconID
{
PLAYER_MODERATOR(0),
JAGEX_MODERATOR(1),
IRONMAN(2),
ULTIMATE_IRONMAN(3),
DMM_SKULL_5_KEYS(4),
DMM_SKULL_4_KEYS(5),
DMM_SKULL_3_KEYS(6),
DMM_SKULL_2_KEYS(7),
DMM_SKULL_1_KEYS(8),
SKULL(9),
HARDCORE_IRONMAN(10),
NO_ENTRY(11),
CHAIN_LINK(12);
private final int index;
@Override
public String toString()
{
return "<img=" + String.valueOf(this.index) + ">";
}
}
+45
View File
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* An entry on the ignore list.
*/
public interface Ignore extends Nameable
{
/**
* The name of the player.
*
* @return the name
*/
String getName();
/**
* The previous name the player had.
*
* @return the previous name
*/
String getPrevName();
}
+12
View File
@@ -0,0 +1,12 @@
package api;
/**
* Represents an index in the cache
*/
public interface IndexDataBase
{
/**
* Returns true if any cache overlay in this index is outdated due to hash mismatch
*/
boolean isOverlayOutdated();
}
+143
View File
@@ -0,0 +1,143 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents an indexed sprite.
*/
public interface IndexedSprite
{
/**
* Gets the pixels contained by the sprite.
*
* @return the sprite pixels
*/
byte[] getPixels();
/**
* Sets the pixels contained by the sprite.
*
* @param pixels the new sprite pixels
*/
void setPixels(byte[] pixels);
/**
* Gets the color palette for the sprites pixels.
*
* @return the color palette
*/
int[] getPalette();
/**
* Sets the color palette for the sprites pixels.
*
* @param palette the new color palette
*/
void setPalette(int[] palette);
/**
* Gets the offset of the sprite along the x-axis.
*
* @return the x-axis offset
*/
int getOffsetX();
/**
* Sets the offset of the sprite along the x-axis.
*
* @param offsetX new x-axis offset
*/
void setOffsetX(int offsetX);
/**
* Gets the offset of the sprite along the y-axis.
*
* @return the y-axis offset
*/
int getOffsetY();
/**
* Sets the offset of the sprite along the y-axis.
*
* @param offsetY new y-axis offset
*/
void setOffsetY(int offsetY);
/**
* Gets the width of the sprite.
*
* @return the width
*/
int getWidth();
/**
* Sets the width of the sprite.
*
* @param width the new width
*/
void setWidth(int width);
/**
* Gets the original width of the sprite.
*
* @return the width
*/
int getOriginalWidth();
/**
* Sets the original width of the sprite.
*
* @param originalWidth the width
*/
void setOriginalWidth(int originalWidth);
/**
* Gets the height of the sprite.
*
* @return the height
*/
int getHeight();
/**
* Sets the height of the sprite.
*
* @param height the height
*/
void setHeight(int height);
/**
* Gets the original height of the sprite.
*
* @return the height
*/
int getOriginalHeight();
/**
* Sets the original height of the sprite.
*
* @param originalHeight the height
*/
void setOriginalHeight(int originalHeight);
}
@@ -0,0 +1,111 @@
/*
* Copyright (c) 2018, Kamiel
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* An enumeration of possible instance templates and the area they occupy.
*/
@AllArgsConstructor
public enum InstanceTemplates
{
RAIDS_LOBBY(3264, 5184, 0, 96, 32),
RAIDS_START(3264, 5696, 0, 96, 32),
RAIDS_END(3264, 5152, 0, 64, 32),
RAIDS_SCAVENGERS(3264, 5216, 0, 96, 32),
RAIDS_SHAMANS(3264, 5248, 0, 96, 32),
RAIDS_VASA(3264, 5280, 0, 96, 32),
RAIDS_VANGUARDS(3264, 5312, 0, 96, 32),
RAIDS_ICE_DEMON(3264, 5344, 0, 96, 32),
RAIDS_THIEVING(3264, 5376, 0, 96, 32),
RAIDS_FARMING(3264, 5440, 0, 96, 32),
RAIDS_SCAVENGERS2(3264, 5216, 1, 96, 32),
RAIDS_MUTTADILES(3264, 5312, 1, 96, 32),
RAIDS_MYSTICS(3264, 5248, 1, 96, 32),
RAIDS_TEKTON(3264, 5280, 1, 96, 32),
RAIDS_TIGHTROPE(3264, 5344, 1, 96, 32),
RAIDS_FARMING2(3264, 5440, 1, 96, 32),
RAIDS_GUARDIANS(3264, 5248, 2, 96, 32),
RAIDS_VESPULA(3264, 5280, 2, 96, 32),
RAIDS_CRABS(3264, 5344, 2, 96, 32);
/**
* The base x-axis coordinate of the instance area.
*/
@Getter
private final int baseX;
/**
* The base y-axis coordinate of the instance area.
*/
@Getter
private final int baseY;
/**
* The plane the instance is on.
*/
@Getter
private final int plane;
/**
* The width of the instance area.
*/
@Getter
private final int width;
/**
* The height of the instance area.
*/
@Getter
private final int height;
/**
* Matches chunk data of an instance to the instance it belongs.
*
* @param chunkData the chunk data
* @return the instance the chunk is in
*/
public static InstanceTemplates findMatch(int chunkData)
{
int rotation = chunkData >> 1 & 0x3; //unused, but shows us the rotation of the chunk
int y = (chunkData >> 3 & 0x7FF) * 8;
int x = (chunkData >> 14 & 0x3FF) * 8;
int plane = chunkData >> 24 & 0x3;
for (InstanceTemplates template : InstanceTemplates.values())
{
if (plane == template.getPlane()
&& x >= template.getBaseX() && x < template.getBaseX() + template.getWidth()
&& y >= template.getBaseY() && y < template.getBaseY() + template.getHeight())
{
return template;
}
}
return null;
}
}
+45
View File
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents an integer typically in a {@link HashTable}.
*/
public interface IntegerNode extends Node
{
/**
* Gets the value of the node.
*
* @return the int value
*/
int getValue();
/**
* Sets the value of the node.
*
* @param value the new int value
*/
void setValue(int value);
}
+85
View File
@@ -0,0 +1,85 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* An enumeration of possible inventory types.
*/
public enum InventoryID
{
/**
* Standard player inventory.
*/
INVENTORY(93),
/**
* Equipment inventory.
*/
EQUIPMENT(94),
/**
* Bank inventory.
*/
BANK(95),
/**
* A puzzle box inventory.
*/
PUZZLE_BOX(140),
/**
* Barrows reward chest inventory.
*/
BARROWS_REWARD(141),
/**
* Monkey madness puzzle box inventory.
*/
MONKEY_MADNESS_PUZZLE_BOX(221),
/**
* Looting Bag inventory
*/
LOOTING_BAG(516),
/**
* Chambers of Xeric chest inventory.
*/
CHAMBERS_OF_XERIC_CHEST(581),
/**
* Theater of Blood reward chest inventory (Raids 2)
*/
THEATRE_OF_BLOOD_CHEST(612);
private final int id;
InventoryID(int id)
{
this.id = id;
}
/**
* Gets the raw inventory type ID.
*
* @return inventory type
*/
public int getId()
{
return id;
}
}
+46
View File
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents an item inside an {@link ItemContainer}.
*/
public interface Item extends Renderable
{
/**
* Gets the items ID.
*
* @return the ID of the item
* @see ItemID
*/
int getId();
/**
* Gets the items quantity.
*
* @return the items quantity
*/
int getQuantity();
}
+38
View File
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2016-2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents an inventory that contains items.
*/
public interface ItemContainer extends Node
{
/**
* Gets an array of all items in the container.
*
* @return the items held
*/
Item[] getItems();
}
+115
View File
@@ -0,0 +1,115 @@
package api;
/**
* Represents the template of a specific item type.
*/
public interface ItemDefinition
{
/**
* Gets the items name.
*
* @return the name of the item
*/
String getName();
/**
* Gets the items ID.
*
* @return the items ID
* @see ItemID
*/
int getId();
/**
* Gets a value specifying whether the item is noted.
*
* @return 799 if noted, -1 otherwise
*/
int getNote();
/**
* Gets the item ID of the noted or unnoted variant of this item.
* <p>
* Calling this method on a noted item will result in the ID of itself
* in unnoted form, and on an unnoted item its noted variant.
*
* @return the noted or unnoted variant of this item
*/
int getLinkedNoteId();
/**
* Gets the item ID of the normal or placeholder variant of this item.
* <p>
* Calling this method on a normal item will result in the ID of itself
* in placeholder form, and on a placeholder item its normal variant.
*
* @return the normal or placeholder variant of this item
*/
int getPlaceholderId();
/**
* Gets a value specifying whether the item is a placeholder.
*
* @return 14401 if placeholder, -1 otherwise
*/
int getPlaceholderTemplateId();
/**
* Gets the store price of the item.
* <p>
* Although not all items can be found in a store, they have a store price
* which can be used to calculate high and low alchemy values. Multiplying
* the price by {@code 0.6} and {@code 0.4} gives these high and low
* alchemy values, respectively.
*
* @return the general store value of the item
*/
int getPrice();
/**
* Checks whether the item is members only.
*
* @return true if members only, false otherwise.
*/
boolean isMembers();
/**
* Checks whether the item is able to stack in a players inventory.
*
* @return true if stackable, false otherwise
*/
boolean isStackable();
/**
* Returns whether or not the item can be sold on the grand exchange.
*/
boolean isTradeable();
/**
* Gets an array of possible right-click menu actions the item
* has in a player inventory.
*
* @return the inventory menu actions
*/
String[] getInventoryActions();
/**
* Gets the menu action index of the shift-click action.
*
* @return the index of the shift-click action
*/
int getShiftClickActionIndex();
/**
* Sets the menu action index of the shift-click action.
*
* @param shiftclickActionIndex the new index of the shift-click action
*/
void setShiftClickActionIndex(int shiftclickActionIndex);
/**
* Resets the menu action index of the shift-click action to its
* default value.
*/
void resetShiftClickActionIndex();
}
File diff suppressed because it is too large Load Diff
+59
View File
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents a pile of items held by a tile.
*/
public interface ItemLayer extends TileObject
{
/**
* Gets the height of the layer.
*
* @return the height
*/
int getHeight();
/**
* Gets the item at the bottom of the pile.
*
* @return the bottom item
*/
Renderable getBottom();
/**
* Gets the item at the middle of the pile.
*
* @return the middle item
*/
Renderable getMiddle();
/**
* Gets the item at the top of the pile.
*
* @return the top item
*/
Renderable getTop();
}
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public interface IterableHashTable extends Iterable
{
Node get(long hash);
}
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2018 Charlie Waters
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Detects when the window is focused or unfocused.
*/
public interface KeyFocusListener
{
}
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import java.awt.Image;
/**
* Represents the clients primary image buffer.
*/
public interface MainBufferProvider
{
/**
* Gets the image currently loaded in the buffer.
*
* @return the loaded image
*/
Image getImage(); //TODO
}
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents an area in the world.
*/
public interface MapElementConfig
{
/**
* Gets the sprite icon to display on the world map.
*
* @param unused unused value
* @return the sprite icon to display on the world map
*/
Sprite getMapIcon(boolean unused);
}
+308
View File
@@ -0,0 +1,308 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import java.util.HashMap;
import java.util.Map;
/**
* An enumeration of right-click menu actions.
*/
public enum MenuAction
{
/**
* Menu action for using an item in your inventory on a tile object (GameObject or GroundObject).
*/
ITEM_USE_ON_GAME_OBJECT(1),
/**
* Menu action for casting a spell on a tile object (GameObject or GroundObject).
*/
SPELL_CAST_ON_GAME_OBJECT(2),
/**
* First menu action for a game object.
*/
GAME_OBJECT_FIRST_OPTION(3),
/**
* Second menu action for a game object.
*/
GAME_OBJECT_SECOND_OPTION(4),
/**
* Third menu action for a game object.
*/
GAME_OBJECT_THIRD_OPTION(5),
/**
* Fourth menu action for a game object.
*/
GAME_OBJECT_FOURTH_OPTION(6),
/**
* Fifth menu action for a game object.
*/
GAME_OBJECT_FIFTH_OPTION(1001),
/**
* Menu action for using an item in your inventory on an NPC.
*/
ITEM_USE_ON_NPC(7),
/**
* Menu action for casting a spell on an NPC.
*/
SPELL_CAST_ON_NPC(8),
/**
* First menu action for an NPC.
*/
NPC_FIRST_OPTION(9),
/**
* Second menu action for an NPC.
*/
NPC_SECOND_OPTION(10),
/**
* Third menu action for an NPC.
*/
NPC_THIRD_OPTION(11),
/**
* Fourth menu action for an NPC.
*/
NPC_FOURTH_OPTION(12),
/**
* Fifth menu action for an NPC.
*/
NPC_FIFTH_OPTION(13),
/**
* Menu action for using an item on a player.
*/
ITEM_USE_ON_PLAYER(14),
/**
* Menu action for casting a spell on a player.
*/
SPELL_CAST_ON_PLAYER(15),
/**
* Menu action for using an item on an item on the ground.
*/
ITEM_USE_ON_GROUND_ITEM(16),
/**
* Menu action for casting a spell on an item on the ground.
*/
SPELL_CAST_ON_GROUND_ITEM(17),
/**
* First menu action for an item on the ground.
*/
GROUND_ITEM_FIRST_OPTION(18),
/**
* Second menu action for an item on the ground.
*/
GROUND_ITEM_SECOND_OPTION(19),
/**
* Third menu action for an item on the ground.
*/
GROUND_ITEM_THIRD_OPTION(20),
/**
* Fourth menu action for an item on the ground.
*/
GROUND_ITEM_FOURTH_OPTION(21),
/**
* Fifth menu action for an item on the ground.
*/
GROUND_ITEM_FIFTH_OPTION(22),
/**
* Menu action for walking.
*/
WALK(23),
/**
* Interaction with widget (type 1).
*/
WIDGET_TYPE_1(24),
/**
* Interaction with widget (type 2).
*/
WIDGET_TYPE_2(25),
/**
* Interaction with widget (type 3).
*/
WIDGET_TYPE_3(26),
/**
* Interaction with widget (type 4).
*/
WIDGET_TYPE_4(28),
/**
* Interaction with widget (type 5).
*/
WIDGET_TYPE_5(29),
/**
* Interaction with widget (type 6).
*/
WIDGET_TYPE_6(30),
/**
* Menu action when using an item on another item inside a widget (inventory).
*/
ITEM_USE_ON_WIDGET_ITEM(31),
/**
* Menu action when using an item on a widget.
*/
ITEM_USE_ON_WIDGET(32),
/**
* First menu action for an item.
*/
ITEM_FIRST_OPTION(33),
/**
* Second menu action for an item.
*/
ITEM_SECOND_OPTION(34),
/**
* Third menu action for an item.
*/
ITEM_THIRD_OPTION(35),
/**
* Fourth menu action for an item.
*/
ITEM_FOURTH_OPTION(36),
/**
* Fifth menu action for an item.
*/
ITEM_FIFTH_OPTION(37),
/**
* Menu action to drop an item (identical to ITEM_FIFTH_OPTION).
*/
ITEM_DROP(37),
/**
* Menu action to use an item.
*/
ITEM_USE(38),
/**
* First menu action for a widget.
*/
WIDGET_FIRST_OPTION(39),
/**
* Second menu action for a widget.
*/
WIDGET_SECOND_OPTION(40),
/**
* Third menu action for a widget.
*/
WIDGET_THIRD_OPTION(41),
/**
* Fourth menu action for a widget.
*/
WIDGET_FOURTH_OPTION(42),
/**
* Fifth menu action for a widget.
*/
WIDGET_FIFTH_OPTION(43),
PLAYER_FIRST_OPTION(44),
PLAYER_SECOND_OPTION(45),
PLAYER_THIRD_OPTION(46),
PLAYER_FOURTH_OPTION(47),
PLAYER_FIFTH_OPTION(48),
PLAYER_SIXTH_OPTION(49),
PLAYER_SEVENTH_OPTION(50),
PLAYER_EIGTH_OPTION(51),
/**
* Default menu action for a widget.
*/
WIDGET_DEFAULT(57),
/**
* Menu action triggered by examining an object.
*/
EXAMINE_OBJECT(1002),
/**
* Menu action triggered by examining an NPC.
*/
EXAMINE_NPC(1003),
/**
* Menu action triggered by examining item on ground.
*/
EXAMINE_ITEM_GROUND(1004),
/**
* Menu action triggered by examining item in inventory.
*/
EXAMINE_ITEM(1005),
/**
* Menu action triggered by canceling a menu.
*/
CANCEL(1006),
/**
* Menu action triggered by either examining item in bank, examining
* item in inventory while having bank open, or examining equipped item.
*/
EXAMINE_ITEM_BANK_EQ(1007),
/**
* Menu action injected by runelite for its menu items.
*/
RUNELITE(1500),
/**
* Menu action injected by runelite for overlay menu items.
*/
RUNELITE_OVERLAY(1501),
/**
* Menu action for configuring runelite overlays.
*/
RUNELITE_OVERLAY_CONFIG(1502),
FOLLOW(2046),
TRADE(2047),
/**
* Menu action triggered when the id is not defined in this class.
*/
UNKNOWN(-1);
public static final int MENU_ACTION_DEPRIORITIZE_OFFSET = 2000;
private static final Map<Integer, MenuAction> map = new HashMap<>();
static
{
for (MenuAction menuAction : values())
{
map.put(menuAction.getId(), menuAction);
}
}
private final int id;
MenuAction(int id)
{
this.id = id;
}
public int getId()
{
return id;
}
public static MenuAction of(int id)
{
return map.getOrDefault(id, UNKNOWN);
}
}
+69
View File
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.Data;
/**
* A menu entry in a right-click menu.
*/
@Data
public class MenuEntry
{
/**
* The option text added to the menu (ie. "Walk here", "Use").
*/
private String option;
/**
* The target of the action (ie. Item or Actor name).
* <p>
* If the option does not apply to any target, this field
* will be set to empty string.
*/
private String target;
/**
* An identifier value for the target of the action.
*/
private int identifier;
/**
* The action the entry will trigger.
*/
private int type;
/**
* An additional parameter for the action.
*/
private int param0;
/**
* A second additional parameter for the action.
*/
private int param1;
/**
* If this field is true and you have single mouse button on and this entry is
* the top entry the right click menu will not be opened when you left click
*
* This is used for shift click
*/
private boolean forceLeftClick;
}
+119
View File
@@ -0,0 +1,119 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents a message in the chatbox.
*/
public interface MessageNode
{
/**
* Get the id for this message node
*
* @return
*/
int getId();
/**
* Gets the type of message.
*
* @return the message type
*/
ChatMessageType getType();
/**
* Gets the name of the player that sent the message.
*
* @return the player name
*/
String getName();
/**
* Sets the name of the player that sent the message.
*
* @param name the new player name
*/
void setName(String name);
/**
* Gets the sender of the message (ie. clan name).
*
* @return the message sender
*/
String getSender();
/**
* Sets the sender of the message.
*
* @param sender the new message sender
*/
void setSender(String sender);
/**
* Gets the message contents.
*
* @return the message contents
*/
String getValue();
/**
* Sets the message contents.
*
* @param value the new message contents
*/
void setValue(String value);
/**
* Gets the overriden message format.
*
* @return the message format
*/
String getRuneLiteFormatMessage();
/**
* Sets the overriden message format.
* <p>
* If this value is not null, the message contents as returned by
* {@link #getValue()} will be replaced with the format set here
* when a message is processed.
*
* @param runeLiteFormatMessage the new message format
*/
void setRuneLiteFormatMessage(String runeLiteFormatMessage);
/**
* Get the timestamp for the message, in seconds from the unix epoch.
*
* @return
*/
int getTimestamp();
/**
* Set the timestamp of the message
*
* @param timestamp
*/
void setTimestamp(int timestamp);
}
+106
View File
@@ -0,0 +1,106 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.model.Triangle;
import api.model.Vertex;
import java.util.List;
/**
* Represents the model of an object.
*/
public interface Model extends Renderable
{
/**
* Gets a list of all vertices of the model.
*
* @return the vertices
*/
List<Vertex> getVertices();
/**
* Gets a list of all triangles of the model.
*
* @return the triangle
*/
List<Triangle> getTriangles();
int getVerticesCount();
int[] getVerticesX();
int[] getVerticesY();
int[] getVerticesZ();
int getTrianglesCount();
int[] getTrianglesX();
int[] getTrianglesY();
int[] getTrianglesZ();
int[] getFaceColors1();
int[] getFaceColors2();
int[] getFaceColors3();
byte[] getTriangleTransparencies();
int getSceneId();
void setSceneId(int sceneId);
int getBufferOffset();
void setBufferOffset(int bufferOffset);
int getUvBufferOffset();
void setUvBufferOffset(int bufferOffset);
int getModelHeight();
void calculateBoundsCylinder();
byte[] getFaceRenderPriorities();
int getRadius();
short[] getFaceTextures();
float[][] getFaceTextureUCoordinates();
float[][] getFaceTextureVCoordinates();
void calculateExtreme(int orientation);
int getCenterX();
int getCenterY();
int getCenterZ();
int getExtremeX();
int getExtremeY();
int getExtremeZ();
int getXYZMag();
}
+40
View File
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2019, ThatGamerBlue <thatgamerblue@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public interface MouseRecorder
{
int[] getXs();
int[] getYs();
long[] getMillis();
int getIndex();
}
+81
View File
@@ -0,0 +1,81 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import javax.annotation.Nullable;
import rs.api.RSNPCDefinition;
/**
* Represents a non-player character in the game.
*/
public interface NPC extends Actor
{
/**
* Gets the ID of the NPC.
*
* @return the ID of the NPC
* //@see NpcID
*/
int getId();
@Override
String getName();
@Override
int getCombatLevel();
/**
* Gets the index position of this NPC in the clients cached
* NPC array.
*
* @return the NPC index
* @see Client#getCachedNPCs()
*/
int getIndex();
/**
* Gets the composition of this NPC.
*
* @return the composition
*/
NPCDefinition getDefinition();
/**
* Get the composition for this NPC and transform it if required
*
* @return the transformed NPC
*/
@Nullable
NPCDefinition getTransformedDefinition();
/**
* Returns true if this NPC has died
*
* @return
*/
boolean isDead();
void onDefinitionChanged(RSNPCDefinition composition);
}
+90
View File
@@ -0,0 +1,90 @@
package api;
public interface NPCDefinition
{
/**
* Gets the name of the NPC.
*
* @return the name
*/
String getName();
/**
* Gets the model IDs that compose this NPC.
*
* @return the NPCs model IDs
*/
int[] getModels();
/**
* Gets an array of possible right-click menu actions that can be
* performed on the NPC.
*
* @return the menu actions
*/
String[] getActions();
/**
* Gets whether the NPC can be clicked.
*
* @return true if the NPC can be clicked, false otherwise
*/
boolean isClickable();
/**
* Gets whether the NPC is visible on the mini-map.
*
* @return the mini-map visible state
*/
boolean isMinimapVisible();
/**
* Gets whether the NPC is visible.
*
* @return the visible state
*/
boolean isVisible();
/**
* Gets the ID of the NPC.
*
* @return the ID of the NPC
* @see NpcID
*/
int getId();
/**
* Gets the combat level of the NPC.
*
* @return the combat level, -1 if none
*/
int getCombatLevel();
/**
* Gets the configuration data for the NPC.
*
* @return the configuration data
*/
int[] getConfigs();
/**
* Transforms this NPC into a new state, which may have a different ID.
*
* @return the transformed composition
*/
NPCDefinition transform();
/**
* Gets the size of the NPC.
*
* @return the NPCs size
*/
int getSize();
/**
* Gets the displayed overhead icon of the NPC.
*
* @return the overhead icon
*/
HeadIcon getOverheadIcon();
}
+32
View File
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents a chat entity that has a name.
*/
public interface Nameable extends Comparable
{
}
+52
View File
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents a doubly linked node.
*/
public interface Node
{
/**
* Gets the next node.
*
* @return the next node
*/
Node getNext();
/**
* Gets the previous node.
*
* @return the previous node
*/
Node getPrevious();
/**
* Gets the hash value of the node.
*
* @return the hash value
*/
long getHash();
}
+40
View File
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2018, Tomas Slusny <slusnucky@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents a doubly linked node cache.
*/
public interface NodeCache
{
/**
* Resets cache.
*/
void reset();
void setCapacity(int capacity);
void setRemainingCapacity(int remainingCapacity);
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,82 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents the template of a specific object.
*/
public interface ObjectDefinition
{
/**
* Gets ID for the object.
*
* @return the object ID
*/
int getId();
/**
* Gets the name of the object.
*
* @return the object name
*/
String getName();
/**
* Gets an array of possible right-click menu actions that can be
* performed on the object.
*
* @return the menu actions
*/
String[] getActions();
/**
* Gets the map scene ID for the object.
*
* @return the scene ID
*/
int getMapSceneId();
/**
* Gets the map icon ID for the object.
*
* @return the map icon ID
*/
int getMapIconId();
/**
* Gets IDs for objects that are considered fakes of this object,
* such as barrows walls.
*
* @return the impostor IDs
*/
int[] getImpostorIds();
/**
* Gets the impostor composition for this object.
*
* @return the impostor
*/
ObjectDefinition getImpostor();
}
File diff suppressed because it is too large Load Diff
+36
View File
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Utility class containing ASM opcodes used by the RuneLite client.
*/
public class Opcodes
{
/**
* RuneLite execution opcode used to inject scripts.
*/
public static final int RUNELITE_EXECUTE = 6599;
}
+29
View File
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public interface PacketBuffer
{
}
+770
View File
@@ -0,0 +1,770 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.config.Constants;
import static api.config.Constants.TILE_FLAG_BRIDGE;
import api.coords.LocalPoint;
import api.model.Jarvis;
import api.model.Triangle;
import api.model.Vertex;
import api.widgets.Widget;
import api.widgets.WidgetInfo;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.geom.Area;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* A utility class containing methods to help with conversion between
* in-game features to canvas areas.
*/
public class Perspective
{
private static final double UNIT = Math.PI / 1024d; // How much of the circle each unit of SINE/COSINE is
public static final int LOCAL_COORD_BITS = 7;
public static final int LOCAL_TILE_SIZE = 1 << LOCAL_COORD_BITS; // 128 - size of a tile in local coordinates
public static final int LOCAL_HALF_TILE_SIZE = LOCAL_TILE_SIZE / 2;
public static final int SCENE_SIZE = Constants.SCENE_SIZE; // in tiles
public static final int[] SINE = new int[2048]; // sine angles for each of the 2048 units, * 65536 and stored as an int
public static final int[] COSINE = new int[2048]; // cosine
static
{
for (int i = 0; i < 2048; ++i)
{
SINE[i] = (int) (65536.0D * Math.sin((double) i * UNIT));
COSINE[i] = (int) (65536.0D * Math.cos((double) i * UNIT));
}
}
/**
* Translates two-dimensional ground coordinates within the 3D world to
* their corresponding coordinates on the game screen.
*
* @param client the game client
* @param point ground coordinate
* @param plane ground plane on the z axis
* @return a {@link Point} on screen corresponding to the position in
* 3D-space
*/
@Nullable
public static Point localToCanvas(@Nonnull Client client, @Nonnull LocalPoint point, int plane)
{
return localToCanvas(client, point, plane, 0);
}
/**
* Translates two-dimensional ground coordinates within the 3D world to
* their corresponding coordinates on the game screen.
*
* @param client the game client
* @param point ground coordinate
* @param plane ground plane on the z axis
* @param zOffset distance from ground on the z axis
* @return a {@link Point} on screen corresponding to the position in
* 3D-space
*/
@Nullable
public static Point localToCanvas(@Nonnull Client client, @Nonnull LocalPoint point, int plane, int zOffset)
{
final int tileHeight = getTileHeight(client, point, plane);
return localToCanvas(client, point.getX(), point.getY(), tileHeight - zOffset);
}
/**
* Translates three-dimensional local coordinates within the 3D world to
* their corresponding coordinates on the game screen.
*
* @param client the game client
* @param x ground coordinate on the x axis
* @param y ground coordinate on the y axis
* @param z
* @return a {@link Point} on screen corresponding to the position in
* 3D-space
*/
public static Point localToCanvas(@Nonnull Client client, int x, int y, int z)
{
if (x >= 128 && y >= 128 && x <= 13056 && y <= 13056)
{
x -= client.getCameraX();
y -= client.getCameraY();
z -= client.getCameraZ();
int cameraPitch = client.getCameraPitch();
int cameraYaw = client.getCameraYaw();
int pitchSin = SINE[cameraPitch];
int pitchCos = COSINE[cameraPitch];
int yawSin = SINE[cameraYaw];
int yawCos = COSINE[cameraYaw];
int var8 = yawCos * x + y * yawSin >> 16;
y = yawCos * y - yawSin * x >> 16;
x = var8;
var8 = pitchCos * z - y * pitchSin >> 16;
y = z * pitchSin + y * pitchCos >> 16;
if (y >= 50)
{
int pointX = client.getViewportWidth() / 2 + x * client.getScale() / y;
int pointY = client.getViewportHeight() / 2 + var8 * client.getScale() / y;
return new Point(
pointX + client.getViewportXOffset(),
pointY + client.getViewportYOffset());
}
}
return null;
}
/**
* Translates two-dimensional ground coordinates within the 3D world to
* their corresponding coordinates on the Minimap.
*
* @param client the game client
* @param point ground coordinate
* @return a {@link Point} on screen corresponding to the position in
* 3D-space
*/
@Nullable
public static Point localToMinimap(@Nonnull Client client, @Nonnull LocalPoint point)
{
return localToMinimap(client, point, 6400);
}
/**
* Translates two-dimensional ground coordinates within the 3D world to
* their corresponding coordinates on the Minimap.
*
* @param client the game client
* @param point ground coordinate
* @param distance max distance from local player to minimap point
* @return a {@link Point} on screen corresponding to the position in
* 3D-space
*/
@Nullable
public static Point localToMinimap(@Nonnull Client client, @Nonnull LocalPoint point, int distance)
{
LocalPoint localLocation = client.getLocalPlayer().getLocalLocation();
int x = point.getX() / 32 - localLocation.getX() / 32;
int y = point.getY() / 32 - localLocation.getY() / 32;
int dist = x * x + y * y;
if (dist < distance)
{
Widget minimapDrawWidget;
if (client.isResized())
{
if (client.getVar(Varbits.SIDE_PANELS) == 1)
{
minimapDrawWidget = client.getWidget(WidgetInfo.RESIZABLE_MINIMAP_DRAW_AREA);
}
else
{
minimapDrawWidget = client.getWidget(WidgetInfo.RESIZABLE_MINIMAP_STONES_DRAW_AREA);
}
}
else
{
minimapDrawWidget = client.getWidget(WidgetInfo.FIXED_VIEWPORT_MINIMAP_DRAW_AREA);
}
if (minimapDrawWidget == null || minimapDrawWidget.isHidden())
{
return null;
}
final int angle = client.getMapAngle() & 0x7FF;
final int sin = SINE[angle];
final int cos = COSINE[angle];
final int xx = y * sin + cos * x >> 16;
final int yy = sin * x - y * cos >> 16;
Point loc = minimapDrawWidget.getCanvasLocation();
int miniMapX = loc.getX() + xx + minimapDrawWidget.getWidth() / 2;
int miniMapY = minimapDrawWidget.getHeight() / 2 + loc.getY() + yy;
return new Point(miniMapX, miniMapY);
}
return null;
}
/**
* Calculates the above ground height of a tile point.
*
* @param client the game client
* @param point the local ground coordinate
* @param plane the client plane/ground level
* @return the offset from the ground of the tile
*/
public static int getTileHeight(@Nonnull Client client, @Nonnull LocalPoint point, int plane)
{
int sceneX = point.getSceneX();
int sceneY = point.getSceneY();
if (sceneX >= 0 && sceneY >= 0 && sceneX < SCENE_SIZE && sceneY < SCENE_SIZE)
{
byte[][][] tileSettings = client.getTileSettings();
int[][][] tileHeights = client.getTileHeights();
int z1 = plane;
if (plane < Constants.MAX_Z - 1 && (tileSettings[1][sceneX][sceneY] & TILE_FLAG_BRIDGE) == TILE_FLAG_BRIDGE)
{
z1 = plane + 1;
}
int x = point.getX() & (LOCAL_TILE_SIZE - 1);
int y = point.getY() & (LOCAL_TILE_SIZE - 1);
int var8 = x * tileHeights[z1][sceneX + 1][sceneY] + (LOCAL_TILE_SIZE - x) * tileHeights[z1][sceneX][sceneY] >> LOCAL_COORD_BITS;
int var9 = tileHeights[z1][sceneX][sceneY + 1] * (LOCAL_TILE_SIZE - x) + x * tileHeights[z1][sceneX + 1][sceneY + 1] >> LOCAL_COORD_BITS;
return (LOCAL_TILE_SIZE - y) * var8 + y * var9 >> LOCAL_COORD_BITS;
}
return 0;
}
/**
* Get the height of a location, in local coordinates. Interpolates the height from the adjacent tiles.
* Does not account for bridges.
* @param client
* @param localX
* @param localY
* @param plane
* @return
*/
private static int getHeight(@Nonnull Client client, int localX, int localY, int plane)
{
int sceneX = localX >> LOCAL_COORD_BITS;
int sceneY = localY >> LOCAL_COORD_BITS;
if (sceneX >= 0 && sceneY >= 0 && sceneX < SCENE_SIZE && sceneY < SCENE_SIZE)
{
int[][][] tileHeights = client.getTileHeights();
int x = localX & (LOCAL_TILE_SIZE - 1);
int y = localY & (LOCAL_TILE_SIZE - 1);
int var8 = x * tileHeights[plane][sceneX + 1][sceneY] + (LOCAL_TILE_SIZE - x) * tileHeights[plane][sceneX][sceneY] >> LOCAL_COORD_BITS;
int var9 = tileHeights[plane][sceneX][sceneY + 1] * (LOCAL_TILE_SIZE - x) + x * tileHeights[plane][sceneX + 1][sceneY + 1] >> LOCAL_COORD_BITS;
return (LOCAL_TILE_SIZE - y) * var8 + y * var9 >> LOCAL_COORD_BITS;
}
return 0;
}
/**
* Calculates a tile polygon from offset worldToScreen() points.
*
* @param client the game client
* @param localLocation local location of the tile
* @return a {@link Polygon} on screen corresponding to the given
* localLocation.
*/
public static Polygon getCanvasTilePoly(@Nonnull Client client, @Nonnull LocalPoint localLocation)
{
return getCanvasTileAreaPoly(client, localLocation, 1);
}
/**
* Returns a polygon representing an area.
*
* @param client the game client
* @param localLocation the center location of the AoE
* @param size the size of the area (ie. 3x3 AoE evaluates to size 3)
* @return a polygon representing the tiles in the area
*/
public static Polygon getCanvasTileAreaPoly(@Nonnull Client client, @Nonnull LocalPoint localLocation, int size)
{
final int plane = client.getPlane();
final int swX = localLocation.getX() - (size * LOCAL_TILE_SIZE / 2);
final int swY = localLocation.getY() - (size * LOCAL_TILE_SIZE / 2);
final int neX = localLocation.getX() + (size * LOCAL_TILE_SIZE / 2);
final int neY = localLocation.getY() + (size * LOCAL_TILE_SIZE / 2);
final int seX = swX;
final int seY = neY;
final int nwX = neX;
final int nwY = swY;
final byte[][][] tileSettings = client.getTileSettings();
final int sceneX = localLocation.getSceneX();
final int sceneY = localLocation.getSceneY();
if (sceneX < 0 || sceneY < 0 || sceneX >= SCENE_SIZE || sceneY >= SCENE_SIZE)
{
return null;
}
int tilePlane = plane;
if (plane < Constants.MAX_Z - 1 && (tileSettings[1][sceneX][sceneY] & TILE_FLAG_BRIDGE) == TILE_FLAG_BRIDGE)
{
tilePlane = plane + 1;
}
final int swHeight = getHeight(client, swX, swY, tilePlane);
final int nwHeight = getHeight(client, nwX, nwY, tilePlane);
final int neHeight = getHeight(client, neX, neY, tilePlane);
final int seHeight = getHeight(client, seX, seY, tilePlane);
Point p1 = localToCanvas(client, swX, swY, swHeight);
Point p2 = localToCanvas(client, nwX, nwY, nwHeight);
Point p3 = localToCanvas(client, neX, neY, neHeight);
Point p4 = localToCanvas(client, seX, seY, seHeight);
if (p1 == null || p2 == null || p3 == null || p4 == null)
{
return null;
}
Polygon poly = new Polygon();
poly.addPoint(p1.getX(), p1.getY());
poly.addPoint(p2.getX(), p2.getY());
poly.addPoint(p3.getX(), p3.getY());
poly.addPoint(p4.getX(), p4.getY());
return poly;
}
/**
* Calculates text position and centers depending on string length.
*
* @param client the game client
* @param graphics the game graphics
* @param localLocation local location of the tile
* @param text string for width measurement
* @param zOffset offset from ground plane
* @return a {@link Point} on screen corresponding to the given
* localLocation.
*/
public static Point getCanvasTextLocation(
@Nonnull Client client,
@Nonnull Graphics2D graphics,
@Nonnull LocalPoint localLocation,
@Nullable String text,
int zOffset)
{
if (text == null)
{
return null;
}
int plane = client.getPlane();
Point p = localToCanvas(client, localLocation, plane, zOffset);
if (p == null)
{
return null;
}
FontMetrics fm = graphics.getFontMetrics();
Rectangle2D bounds = fm.getStringBounds(text, graphics);
int xOffset = p.getX() - (int) (bounds.getWidth() / 2);
return new Point(xOffset, p.getY());
}
/**
* Calculates image position and centers depending on image size.
*
* @param client the game client
* @param localLocation local location of the tile
* @param image image for size measurement
* @param zOffset offset from ground plane
* @return a {@link Point} on screen corresponding to the given
* localLocation.
*/
public static Point getCanvasImageLocation(
@Nonnull Client client,
@Nonnull LocalPoint localLocation,
@Nonnull BufferedImage image,
int zOffset)
{
int plane = client.getPlane();
Point p = localToCanvas(client, localLocation, plane, zOffset);
if (p == null)
{
return null;
}
int xOffset = p.getX() - image.getWidth() / 2;
int yOffset = p.getY() - image.getHeight() / 2;
return new Point(xOffset, yOffset);
}
/**
* Calculates image position and centers depending on image size.
*
* @param client the game client
* @param localLocation local location of the tile
* @param image image for size measurement
* @return a {@link Point} on screen corresponding to the given
* localLocation.
*/
public static Point getMiniMapImageLocation(
@Nonnull Client client,
@Nonnull LocalPoint localLocation,
@Nonnull BufferedImage image)
{
Point p = Perspective.localToMinimap(client, localLocation);
if (p == null)
{
return null;
}
int xOffset = p.getX() - image.getWidth() / 2;
int yOffset = p.getY() - image.getHeight() / 2;
return new Point(xOffset, yOffset);
}
/**
* Calculates sprite position and centers depending on sprite size.
*
* @param client the game client
* @param localLocation local location of the tile
* @param sprite SpritePixel for size measurement
* @param zOffset offset from ground plane
* @return a {@link Point} on screen corresponding to the given localLocation.
*/
public static Point getCanvasSpriteLocation(
@Nonnull Client client,
@Nonnull LocalPoint localLocation,
@Nonnull Sprite sprite,
int zOffset)
{
int plane = client.getPlane();
Point p = localToCanvas(client, localLocation, plane, zOffset);
if (p == null)
{
return null;
}
int xOffset = p.getX() - sprite.getWidth() / 2;
int yOffset = p.getY() - sprite.getHeight() / 2;
return new Point(xOffset, yOffset);
}
/**
* You don't want this. Use {@link //TileObject#getClickbox()} instead.
* <p>
* Get the on-screen clickable area of {@code model} as though it's for the
* object on the tile at ({@code localX}, {@code localY}) and rotated to
* angle {@code orientation}.
*
* @param client the game client
* @param model the model to calculate a clickbox for
* @param orientation the orientation of the model (0-2048, where 0 is north)
* @param point the coordinate of the tile
* @return the clickable area of the model
*/
public static @Nullable Area getClickbox(@Nonnull Client client, Model model, int orientation, @Nonnull LocalPoint point)
{
if (model == null)
{
return null;
}
List<Triangle> triangles = model.getTriangles().stream()
.map(triangle -> triangle.rotate(orientation))
.collect(Collectors.toList());
List<Vertex> vertices = model.getVertices().stream()
.map(v -> v.rotate(orientation))
.collect(Collectors.toList());
Area clickBox = get2DGeometry(client, triangles, point);
Area visibleAABB = getAABB(client, vertices, point);
if (visibleAABB == null)
{
return null;
}
clickBox.intersect(visibleAABB);
return clickBox;
}
/**
* Determine if a given point is off-screen.
*
* @param client
* @param point
* @return
*/
private static boolean isOffscreen(@Nonnull Client client, @Nonnull Point point)
{
return (point.getX() < 0 || point.getX() >= client.getViewportWidth())
&& (point.getY() < 0 || point.getY() >= client.getViewportHeight());
}
private static @Nonnull Area get2DGeometry(
@Nonnull Client client,
@Nonnull List<Triangle> triangles,
@Nonnull LocalPoint point
)
{
int radius = 5;
Area geometry = new Area();
final int tileHeight = getTileHeight(client, point, client.getPlane());
for (Triangle triangle : triangles)
{
api.model.Vertex _a = triangle.getA();
Point a = localToCanvas(client,
point.getX() - _a.getX(),
point.getY() - _a.getZ(),
tileHeight + _a.getY());
if (a == null)
{
continue;
}
Vertex _b = triangle.getB();
Point b = localToCanvas(client,
point.getX() - _b.getX(),
point.getY() - _b.getZ(),
tileHeight + _b.getY());
if (b == null)
{
continue;
}
Vertex _c = triangle.getC();
Point c = localToCanvas(client,
point.getX() - _c.getX(),
point.getY() - _c.getZ(),
tileHeight + _c.getY());
if (c == null)
{
continue;
}
if (isOffscreen(client, a) && isOffscreen(client, b) && isOffscreen(client, c))
{
continue;
}
int minX = Math.min(Math.min(a.getX(), b.getX()), c.getX());
int minY = Math.min(Math.min(a.getY(), b.getY()), c.getY());
// For some reason, this calculation is always 4 pixels short of the actual in-client one
int maxX = Math.max(Math.max(a.getX(), b.getX()), c.getX()) + 4;
int maxY = Math.max(Math.max(a.getY(), b.getY()), c.getY()) + 4;
Rectangle clickableRect = new Rectangle(
minX - radius, minY - radius,
maxX - minX + radius, maxY - minY + radius
);
if (geometry.contains(clickableRect))
{
continue;
}
geometry.add(new Area(clickableRect));
}
return geometry;
}
private static Area getAABB(
@Nonnull Client client,
@Nonnull List<Vertex> vertices,
@Nonnull LocalPoint point
)
{
int maxX = 0;
int minX = 0;
int maxY = 0;
int minY = 0;
int maxZ = 0;
int minZ = 0;
for (Vertex vertex : vertices)
{
int x = vertex.getX();
int y = vertex.getY();
int z = vertex.getZ();
if (x > maxX)
{
maxX = x;
}
if (x < minX)
{
minX = x;
}
if (y > maxY)
{
maxY = y;
}
if (y < minY)
{
minY = y;
}
if (z > maxZ)
{
maxZ = z;
}
if (z < minZ)
{
minZ = z;
}
}
int centerX = (minX + maxX) / 2;
int centerY = (minY + maxY) / 2;
int centerZ = (minZ + maxZ) / 2;
int extremeX = (maxX - minX + 1) / 2;
int extremeY = (maxY - minY + 1) / 2;
int extremeZ = (maxZ - minZ + 1) / 2;
if (extremeX < 32)
{
extremeX = 32;
}
if (extremeZ < 32)
{
extremeZ = 32;
}
int x1 = point.getX() - (centerX - extremeX);
int y1 = centerY - extremeY;
int z1 = point.getY() - (centerZ - extremeZ);
int x2 = point.getX() - (centerX + extremeX);
int y2 = centerY + extremeY;
int z2 = point.getY() - (centerZ + extremeZ);
final int tileHeight = getTileHeight(client, point, client.getPlane());
Point p1 = localToCanvas(client, x1, z1, tileHeight + y1);
Point p2 = localToCanvas(client, x1, z2, tileHeight + y1);
Point p3 = localToCanvas(client, x2, z2, tileHeight + y1);
Point p4 = localToCanvas(client, x2, z1, tileHeight + y1);
Point p5 = localToCanvas(client, x1, z1, tileHeight + y2);
Point p6 = localToCanvas(client, x1, z2, tileHeight + y2);
Point p7 = localToCanvas(client, x2, z2, tileHeight + y2);
Point p8 = localToCanvas(client, x2, z1, tileHeight + y2);
List<Point> points = new ArrayList<>(8);
points.add(p1);
points.add(p2);
points.add(p3);
points.add(p4);
points.add(p5);
points.add(p6);
points.add(p7);
points.add(p8);
try
{
points = Jarvis.convexHull(points);
}
catch (NullPointerException e)
{
// No non-null screen points for this AABB e.g. for an way off-screen model
return null;
}
if (points == null)
{
return null;
}
Polygon hull = new Polygon();
for (Point p : points)
{
if (p != null)
{
hull.addPoint(p.getX(), p.getY());
}
}
return new Area(hull);
}
/**
* Calculates text position and centers on minimap depending on string length.
*
* @param client the game client
* @param graphics the game graphics
* @param localLocation local location of the tile
* @param text string for width measurement
* @return a {@link Point} on screen corresponding to the given
* localLocation.
*/
public static Point getCanvasTextMiniMapLocation(
@Nonnull Client client,
@Nonnull Graphics2D graphics,
@Nonnull LocalPoint localLocation,
@Nonnull String text)
{
Point p = Perspective.localToMinimap(client, localLocation);
if (p == null)
{
return null;
}
FontMetrics fm = graphics.getFontMetrics();
Rectangle2D bounds = fm.getStringBounds(text, graphics);
int xOffset = p.getX() - (int) (bounds.getWidth() / 2);
int yOffset = p.getY() - (int) (bounds.getHeight() / 2) + fm.getAscent();
return new Point(xOffset, yOffset);
}
}
+90
View File
@@ -0,0 +1,90 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import java.awt.Polygon;
import javax.annotation.Nullable;
/**
* Represents a player entity in the game.
*/
public interface Player extends Actor
{
@Override
int getCombatLevel();
int getPlayerId();
/**
* Gets the composition of this player.
*
* @return the composition
*/
PlayerAppearance getPlayerAppearance();
/**
* Gets the polygons that make up the players model.
*
* @return the model polygons
*/
Polygon[] getPolygons();
/**
* Gets the current team cape team number the player is on.
*
* @return team number, or 0 if not on any team
*/
int getTeam();
/**
* Checks whether this player is a member of the same clan as
* the local player.
*
* @return true if the player is a clan member, false otherwise
*/
boolean isClanMember();
/**
* Checks whether this player is a friend of the local player.
*
* @return true if the player is a friend, false otherwise
*/
boolean isFriend();
/**
* Gets the displayed overhead icon of the player.
*
* @return the overhead icon
*/
HeadIcon getOverheadIcon();
/**
* Gets the displayed skull icon of the player.
*
* @return the skull icon
*/
@Nullable
SkullIcon getSkullIcon();
}
@@ -0,0 +1,68 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.kit.KitType;
/**
* Represents the template of a player.
*/
public interface PlayerAppearance
{
/**
* Gets an array of IDs related to equipment slots.
* <p>
* If the ID for a specific slot is between 256 and 512, subtracting
* 256 will result in the kit ID. Values above 512 indicate an item
* and can be converted to the item ID by subtracting 512.
*
* @return the equipment IDs
*/
int[] getEquipmentIds();
/**
* Gets the equipment ID of a particular slot.
*
* @param type equipment slot
* @return the equipment ID
*/
int getEquipmentId(KitType type);
/**
* Gets the kit ID of a particular slot.
*
* @param type equipment slot
* @return the kit ID
*/
int getKitId(KitType type);
/**
* Update the cached hash value for player equipment
* Used to cache the player models based on equipment.
*/
void setHash();
void setTransformedNpcId(int id);
}
+113
View File
@@ -0,0 +1,113 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* A two-dimensional coordinate on the canvas.
*/
public class Point
{
private final int x;
private final int y;
public Point(int x, int y)
{
this.x = x;
this.y = y;
}
@Override
public String toString()
{
return "Point{" + "x=" + x + ", y=" + y + '}';
}
/**
* Gets the x-axis coordinate of the point.
*
* @return the x-axis coordinate
*/
public int getX()
{
return x;
}
/**
* Gets the y-axis coordinate of the point.
*
* @return the y-axis coordinate
*/
public int getY()
{
return y;
}
/**
* Gets the distance between this point and another.
*
* @param other other point
* @return the distance
*/
public int distanceTo(Point other)
{
return (int) Math.hypot(getX() - other.getX(), getY() - other.getY());
}
@Override
public int hashCode()
{
int hash = 3;
hash = 23 * hash + this.x;
hash = 23 * hash + this.y;
return hash;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final Point other = (Point) obj;
if (this.x != other.x)
{
return false;
}
if (this.y != other.y)
{
return false;
}
return true;
}
}
+178
View File
@@ -0,0 +1,178 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* An enumeration of different prayer spells.
*/
public enum Prayer
{
/**
* Thick Skin (Level 1, Defence).
*/
THICK_SKIN(Varbits.PRAYER_THICK_SKIN, 5.0),
/**
* Burst of Strength (Level 4, Strength).
*/
BURST_OF_STRENGTH(Varbits.PRAYER_BURST_OF_STRENGTH, 5.0),
/**
* Clarity of Thought (Level 7, Attack).
*/
CLARITY_OF_THOUGHT(Varbits.PRAYER_CLARITY_OF_THOUGHT, 5.0),
/**
* Sharp Eye (Level 8, Ranging).
*/
SHARP_EYE(Varbits.PRAYER_SHARP_EYE, 5.0),
/**
* Mystic Will (Level 9, Magic).
*/
MYSTIC_WILL(Varbits.PRAYER_MYSTIC_WILL, 5.0),
/**
* Rock Skin (Level 10, Defence).
*/
ROCK_SKIN(Varbits.PRAYER_ROCK_SKIN, 10.0),
/**
* Superhuman Strength (Level 13, Strength).
*/
SUPERHUMAN_STRENGTH(Varbits.PRAYER_SUPERHUMAN_STRENGTH, 10.0),
/**
* Improved Reflexes (Level 16, Attack).
*/
IMPROVED_REFLEXES(Varbits.PRAYER_IMPROVED_REFLEXES, 10.0),
/**
* Rapid Restore (Level 19, Stats).
*/
RAPID_RESTORE(Varbits.PRAYER_RAPID_RESTORE, 60.0 / 36.0),
/**
* Rapid Heal (Level 22, Hitpoints).
*/
RAPID_HEAL(Varbits.PRAYER_RAPID_HEAL, 60.0 / 18),
/**
* Protect Item (Level 25).
*/
PROTECT_ITEM(Varbits.PRAYER_PROTECT_ITEM, 60.0 / 18),
/**
* Hawk Eye (Level 26, Ranging).
*/
HAWK_EYE(Varbits.PRAYER_HAWK_EYE, 10.0),
/**
* Mystic Lore (Level 27, Magic).
*/
MYSTIC_LORE(Varbits.PRAYER_MYSTIC_LORE, 10.0),
/**
* Steel Skin (Level 28, Defence).
*/
STEEL_SKIN(Varbits.PRAYER_STEEL_SKIN, 20.0),
/**
* Ultimate Strength (Level 31, Strength).
*/
ULTIMATE_STRENGTH(Varbits.PRAYER_ULTIMATE_STRENGTH, 20.0),
/**
* Incredible Reflexes (Level 34, Attack).
*/
INCREDIBLE_REFLEXES(Varbits.PRAYER_INCREDIBLE_REFLEXES, 20.0),
/**
* Protect from Magic (Level 37).
*/
PROTECT_FROM_MAGIC(Varbits.PRAYER_PROTECT_FROM_MAGIC, 20.0),
/**
* Protect from Missiles (Level 40).
*/
PROTECT_FROM_MISSILES(Varbits.PRAYER_PROTECT_FROM_MISSILES, 20.0),
/**
* Protect from Melee (Level 43).
*/
PROTECT_FROM_MELEE(Varbits.PRAYER_PROTECT_FROM_MELEE, 20.0),
/**
* Eagle Eye (Level 44, Ranging).
*/
EAGLE_EYE(Varbits.PRAYER_EAGLE_EYE, 20.0),
/**
* Mystic Might (Level 45, Magic).
*/
MYSTIC_MIGHT(Varbits.PRAYER_MYSTIC_MIGHT, 20.0),
/**
* Retribution (Level 46).
*/
RETRIBUTION(Varbits.PRAYER_RETRIBUTION, 5.0),
/**
* Redemption (Level 49).
*/
REDEMPTION(Varbits.PRAYER_REDEMPTION, 10.0),
/**
* Smite (Level 52).
*/
SMITE(Varbits.PRAYER_SMITE, 30.0),
/**
* Chivalry (Level 60, Defence/Strength/Attack).
*/
CHIVALRY(Varbits.PRAYER_CHIVALRY, 40.0),
/**
* Piety (Level 70, Defence/Strength/Attack).
*/
PIETY(Varbits.PRAYER_PIETY, 40.0),
/**
* Preserve (Level 55).
*/
PRESERVE(Varbits.PRAYER_PRESERVE, 60.0 / 18),
/**
* Rigour (Level 74, Ranging/Damage/Defence).
*/
RIGOUR(Varbits.PRAYER_RIGOUR, 40.0),
/**
* Augury (Level 77, Magic/Magic Def./Defence).
*/
AUGURY(Varbits.PRAYER_AUGURY, 40.0);
private final Varbits varbit;
private final double drainRate;
Prayer(Varbits varbit, double drainRate)
{
this.varbit = varbit;
this.drainRate = drainRate;
}
/**
* Gets the varbit that stores whether the prayer is active or not.
*
* @return the prayer active varbit
*/
public Varbits getVarbit()
{
return varbit;
}
/**
* Gets the prayer drain rate (measured in pray points/minute)
*
* @return the prayer drain rate
*/
public double getDrainRate()
{
return drainRate;
}
}
+45
View File
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2018, Lotto <https://github.com/devLotto>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Stores the clients persisting preferences.
*/
public interface Preferences
{
/**
* Gets the remembered login username.
*
* @return the remembered username
*/
String getRememberedUsername();
/**
* Sets the remembered login username.
*
* @param username the new remembered username
*/
void setRememberedUsername(String username);
}
+169
View File
@@ -0,0 +1,169 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents a projectile entity (ie. cannonball, arrow).
*/
public interface Projectile extends Renderable
{
/**
* Gets the ID of the projectile.
*
* @return the projectile ID
* @see ProjectileID
*/
int getId();
/**
* Gets the actor that is targeted by this projectile.
*
* @return the target actor, or null if this projectile is an AoE attack
*/
Actor getInteracting();
/**
* Gets the original x-axis coordinate that this projectile started from.
*
* @return the original coordinate
*/
int getX1();
/**
* Gets the original y-axis coordinate that this projectile started from.
*
* @return the original coordinate
*/
int getY1();
/**
* Gets the plane that the projectile is on.
*
* @return the plane
*/
int getFloor();
/**
* Gets the height of the projectile.
*
* @return the height
*/
int getHeight();
/**
* Gets the ending height of the projectile.
*
* @return the ending height
*/
int getEndHeight();
/**
* Gets the game cycle that the projectile begun movement at.
*
* @return the start game cycle
*/
int getStartMovementCycle();
/**
* Gets the game cycle that the projectile will reach its target at.
*
* @return the end game cycle
*/
int getEndCycle();
/**
* Gets the remaining game cycles until the projectile reaches its
* target and despawns.
*
* @return the remaining game cycles
*/
int getRemainingCycles();
/**
* Gets the slope of the projectile.
* <p>
* This value indicates how much arc the projectile can have. Projectiles
* with larger slopes have a more noticeable arc when thrown.
*
* @return the slope of the projectile
*/
int getSlope();
/**
* Gets the starting height of the projectile.
*
* @return the starting height
*/
int getStartHeight();
/**
* Gets the current x-axis coordinate of the projectile.
*
* @return the x-axis coordinate
*/
double getX();
/**
* Gets the current y-axis coordinate of the projectile.
*
* @return the y-axis coordinate
*/
double getY();
/**
* Gets the current z-axis coordinate of the projectile.
*
* @return the z-axis coordinate
*/
double getZ();
/**
* Gets the scalar quantity (speed) at which the projectile is travelling.
*
* @return the scalar quantity
*/
double getScalar();
/**
* Gets the x-axis velocity of the projectile.
*
* @return the x-axis velocity
*/
double getVelocityX();
/**
* Gets the y-axis velocity of the projectile.
*
* @return the y-axis velocity
*/
double getVelocityY();
/**
* Gets the z-axis velocity of the projectile.
*
* @return the z-axis velocity
*/
double getVelocityZ();
}
+104
View File
@@ -0,0 +1,104 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Utility class used for mapping projectile IDs.
* <p>
* Note: This class is not complete and may be missing mapped IDs.
*/
public class ProjectileID
{
public static final int CANNONBALL = 53;
public static final int GRANITE_CANNONBALL = 1443;
public static final int TELEKINETIC_SPELL = 143;
public static final int LIZARDMAN_SHAMAN_AOE = 1293;
public static final int CRAZY_ARCHAEOLOGIST_AOE = 1260;
public static final int ICE_DEMON_RANGED_AOE = 1324;
public static final int ICE_DEMON_ICE_BARRAGE_AOE = 366;
public static final int VASA_AWAKEN_AOE = 1327;
public static final int VASA_RANGED_AOE = 1329;
public static final int TEKTON_METEOR_AOE = 660;
public static final int OLM_FALLING_CRYSTAL = 1357;
public static final int OLM_BURNING = 1349;
public static final int OLM_FALLING_CRYSTAL_TRAIL = 1352;
public static final int OLM_ACID_TRAIL = 1354;
public static final int OLM_FIRE_LINE = 1347;
public static final int OLM_MAGE_ATTACK = 1339;
public static final int OLM_RANGE_ATTACK = 1340;
public static final int VORKATH_BOMB_AOE = 1481;
public static final int VORKATH_POISON_POOL_AOE = 1483;
public static final int VORKATH_TICK_FIRE_AOE = 1482;
public static final int VORKATH_SPAWN_AOE = 1484;
public static final int ADDY_DRAG_POISON = 1486;
public static final int GALVEK_MINE = 1495;
public static final int GALVEK_BOMB = 1491;
public static final int DAWN_FREEZE = 1445;
public static final int DUSK_CEILING = 1435;
public static final int VETION_LIGHTNING = 280;
public static final int CHAOS_FANATIC_AOE = 551;
public static final int CORPOREAL_BEAST_AOE = 315;
public static final int CORPOREAL_BEAST_DARK_CORE_AOE = 319;
public static final int WINTERTODT_SNOW_FALL_AOE = 1310;
public static final int DEMONIC_GORILLA_RANGED = 1302;
public static final int DEMONIC_GORILLA_MAGIC = 1304;
public static final int DEMONIC_GORILLA_BOULDER = 856;
public static final int XARPUS_ACID = 1555;
public static final int CERB_FIRE = 1247;
/**
* missing: marble gargoyle, superior dark beast
*/
/**
* non AOE, regular projectiles
*/
public static final int VORKATH_DRAGONBREATH = 393;
public static final int VORKATH_RANGED = 1477;
public static final int VORKATH_MAGIC = 1479;
public static final int VORKATH_PRAYER_DISABLE = 1471;
public static final int VORKATH_VENOM = 1470;
public static final int VORKATH_ICE = 350;
public static final int HYDRA_MAGIC = 1662;
public static final int HYDRA_RANGED = 1663;
public static final int HYDRA_POISON = 1644;
public static final int HYDRA_LIGHTNING = 1664;
public static final int HYDRA_LIGHTNING_2 = 1665;
public static final int DRAKE_BREATH = 1637;
}
+67
View File
@@ -0,0 +1,67 @@
/*
* Copyright (c) 2017, Devin French <https://github.com/devinfrench>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import java.util.function.Predicate;
/**
* A query to search the game for objects that match.
*
* @param <EntityType> the returned object type
* @param <QueryType> the query type
*/
public abstract class Query<EntityType, QueryType>
{
protected Predicate<EntityType> predicate = x -> true;
protected Query()
{
}
/**
* Executes the query and filters through possible objects, returning only
* those who evaluate true using {@link #predicate}.
*
* @param client the game client
* @return the matching objects
*/
public abstract EntityType[] result(Client client);
/**
* Constructs and returns a predicate that will evaluate {@link #predicate}
* and the passed value.
*
* @param other the passed predicate
* @return the combined predicate
*/
protected Predicate<EntityType> and(Predicate<EntityType> other)
{
if (predicate == null)
{
return other;
}
return predicate.and(other);
}
}
+242
View File
@@ -0,0 +1,242 @@
/*
* Copyright (c) 2019 Abex
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.Getter;
public enum Quest
{
//Free Quests
BLACK_KNIGHTS_FORTRESS(299, "Black Knights' Fortress", VarPlayer.QUEST_BLACK_KNIGHTS_FORTRESS),
COOKS_ASSISTANT(300, "Cook's Assistant", VarPlayer.QUEST_COOKS_ASSISTANT),
THE_CORSAIR_CURSE(301, "The Corsair Curse", Varbits.QUEST_THE_CORSAIR_CURSE),
DEMON_SLAYER(302, "Demon Slayer", Varbits.QUEST_DEMON_SLAYER),
DORICS_QUEST(303, "Doric's Quest", VarPlayer.QUEST_DORICS_QUEST),
DRAGON_SLAYER(304, "Dragon Slayer", VarPlayer.QUEST_DRAGON_SLAYER),
ERNEST_THE_CHICKEN(305, "Ernest the Chicken", VarPlayer.QUEST_ERNEST_THE_CHICKEN),
GOBLIN_DIPLOMACY(306, "Goblin Diplomacy", Varbits.QUEST_GOBLIN_DIPLOMACY),
IMP_CATCHER(307, "Imp Catcher", VarPlayer.QUEST_IMP_CATCHER),
THE_KNIGHTS_SWORD(308, "The Knight's Sword", VarPlayer.QUEST_THE_KNIGHTS_SWORD),
MISTHALIN_MYSTERY(309, "Misthalin Mystery", Varbits.QUEST_MISTHALIN_MYSTERY),
PIRATES_TREASURE(310, "Pirate's Treasure", VarPlayer.QUEST_PIRATES_TREASURE),
PRINCE_ALI_RESCUE(311, "Prince Ali Rescue", VarPlayer.QUEST_PRINCE_ALI_RESCUE),
THE_RESTLESS_GHOST(312, "The Restless Ghost", VarPlayer.QUEST_THE_RESTLESS_GHOST),
ROMEO__JULIET(313, "Romeo & Juliet", VarPlayer.QUEST_ROMEO_AND_JULIET),
RUNE_MYSTERIES(314, "Rune Mysteries", VarPlayer.QUEST_RUNE_MYSTERIES),
SHEEP_SHEARER(315, "Sheep Shearer", VarPlayer.QUEST_SHEEP_SHEARER),
SHIELD_OF_ARRAV(316, "Shield of Arrav", VarPlayer.QUEST_SHIELD_OF_ARRAV),
VAMPIRE_SLAYER(317, "Vampire Slayer", VarPlayer.QUEST_VAMPIRE_SLAYER),
WITCHS_POTION(318, "Witch's Potion", VarPlayer.QUEST_WITCHS_POTION),
X_MARKS_THE_SPOT(550, "X Marks the Spot", Varbits.QUEST_X_MARKS_THE_SPOT),
//Members' Quests
ANIMAL_MAGNETISM(331, "Animal Magnetism", Varbits.QUEST_ANIMAL_MAGNETISM),
ANOTHER_SLICE_OF_HAM(332, "Another Slice of H.A.M.", Varbits.QUEST_ANOTHER_SLICE_OF_HAM),
BETWEEN_A_ROCK(333, "Between a Rock...", Varbits.QUEST_BETWEEN_A_ROCK),
BIG_CHOMPY_BIRD_HUNTING(334, "Big Chompy Bird Hunting", VarPlayer.QUEST_BIG_CHOMPY_BIRD_HUNTING),
BIOHAZARD(335, "Biohazard", VarPlayer.QUEST_BIOHAZARD),
CABIN_FEVER(336, "Cabin Fever", VarPlayer.QUEST_CABIN_FEVER),
CLOCK_TOWER(337, "Clock Tower", VarPlayer.QUEST_CLOCK_TOWER),
COLD_WAR(338, "Cold War", Varbits.QUEST_COLD_WAR),
CONTACT(339, "Contact!", Varbits.QUEST_CONTACT),
CREATURE_OF_FENKENSTRAIN(340, "Creature of Fenkenstrain", VarPlayer.QUEST_CREATURE_OF_FENKENSTRAIN),
DARKNESS_OF_HALLOWVALE(341, "Darkness of Hallowvale", Varbits.QUEST_DARKNESS_OF_HALLOWVALE),
DEATH_PLATEAU(342, "Death Plateau", VarPlayer.QUEST_DEATH_PLATEAU),
DEATH_TO_THE_DORGESHUUN(343, "Death to the Dorgeshuun", Varbits.QUEST_DEATH_TO_THE_DORGESHUUN),
THE_DEPTHS_OF_DESPAIR(344, "The Depths of Despair", Varbits.QUEST_THE_DEPTHS_OF_DESPAIR),
DESERT_TREASURE(345, "Desert Treasure", Varbits.QUEST_DESERT_TREASURE),
DEVIOUS_MINDS(346, "Devious Minds", Varbits.QUEST_DEVIOUS_MINDS),
THE_DIG_SITE(347, "The Dig Site", VarPlayer.QUEST_THE_DIG_SITE),
DRAGON_SLAYER_II(348, "Dragon Slayer II", Varbits.QUEST_DRAGON_SLAYER_II),
DREAM_MENTOR(349, "Dream Mentor", Varbits.QUEST_DREAM_MENTOR),
DRUIDIC_RITUAL(350, "Druidic Ritual", VarPlayer.QUEST_DRUIDIC_RITUAL),
DWARF_CANNON(351, "Dwarf Cannon", Varbits.QUEST_THE_GIANT_DWARF),
EADGARS_RUSE(352, "Eadgar's Ruse", VarPlayer.QUEST_EADGARS_RUSE),
EAGLES_PEAK(353, "Eagles' Peak", Varbits.QUEST_EAGLES_PEAK),
ELEMENTAL_WORKSHOP_I(354, "Elemental Workshop I", VarPlayer.QUEST_ELEMENTAL_WORKSHOP_I),
ELEMENTAL_WORKSHOP_II(355, "Elemental Workshop II", Varbits.QUEST_ELEMENTAL_WORKSHOP_II),
ENAKHRAS_LAMENT(356, "Enakhra's Lament", Varbits.QUEST_ENAKHRAS_LAMENT),
ENLIGHTENED_JOURNEY(357, "Enlightened Journey", Varbits.QUEST_ENLIGHTENED_JOURNEY),
THE_EYES_OF_GLOUPHRIE(358, "The Eyes of Glouphrie", Varbits.QUEST_THE_EYES_OF_GLOUPHRIE),
FAIRYTALE_I__GROWING_PAINS(359, "Fairytale I - Growing Pains", Varbits.QUEST_FAIRYTALE_I_GROWING_PAINS),
FAIRYTALE_II__CURE_A_QUEEN(360, "Fairytale II - Cure a Queen", Varbits.QUEST_FAIRYTALE_II_CURE_A_QUEEN),
FAMILY_CREST(361, "Family Crest", VarPlayer.QUEST_FAMILY_CREST),
THE_FEUD(362, "The Feud", Varbits.QUEST_THE_FEUD),
FIGHT_ARENA(363, "Fight Arena", VarPlayer.QUEST_FIGHT_ARENA),
FISHING_CONTEST(364, "Fishing Contest", VarPlayer.QUEST_FISHING_CONTEST),
FORGETTABLE_TALE(365, "Forgettable Tale...", Varbits.QUEST_FORGETTABLE_TALE),
BONE_VOYAGE(366, "Bone Voyage", Varbits.QUEST_BONE_VOYAGE),
THE_FREMENNIK_ISLES(367, "The Fremennik Isles", Varbits.QUEST_THE_FREMENNIK_ISLES),
THE_FREMENNIK_TRIALS(368, "The Fremennik Trials", VarPlayer.QUEST_THE_FREMENNIK_TRIALS),
GARDEN_OF_TRANQUILLITY(369, "Garden of Tranquillity", Varbits.QUEST_GARDEN_OF_TRANQUILLITY),
GERTRUDES_CAT(370, "Gertrude's Cat", VarPlayer.QUEST_GERTRUDES_CAT),
GHOSTS_AHOY(371, "Ghosts Ahoy", Varbits.QUEST_GHOSTS_AHOY),
THE_GIANT_DWARF(372, "The Giant Dwarf", Varbits.QUEST_THE_GIANT_DWARF),
THE_GOLEM(373, "The Golem", Varbits.QUEST_THE_GOLEM),
THE_GRAND_TREE(374, "The Grand Tree", VarPlayer.QUEST_THE_GRAND_TREE),
THE_GREAT_BRAIN_ROBBERY(375, "The Great Brain Robbery", VarPlayer.QUEST_THE_GREAT_BRAIN_ROBBERY),
GRIM_TALES(376, "Grim Tales", Varbits.QUEST_GRIM_TALES),
THE_HAND_IN_THE_SAND(377, "The Hand in the Sand", Varbits.QUEST_THE_HAND_IN_THE_SAND),
HAUNTED_MINE(378, "Haunted Mine", VarPlayer.QUEST_HAUNTED_MINE),
HAZEEL_CULT(379, "Hazeel Cult", VarPlayer.QUEST_HAZEEL_CULT),
HEROES_QUEST(380, "Heroes' Quest", VarPlayer.QUEST_HEROES_QUEST),
HOLY_GRAIL(381, "Holy Grail", VarPlayer.QUEST_HOLY_GRAIL),
HORROR_FROM_THE_DEEP(382, "Horror from the Deep", Varbits.QUEST_HORROR_FROM_THE_DEEP),
ICTHLARINS_LITTLE_HELPER(383, "Icthlarin's Little Helper", Varbits.QUEST_ICTHLARINS_LITTLE_HELPER),
IN_AID_OF_THE_MYREQUE(384, "In Aid of the Myreque", Varbits.QUEST_IN_AID_OF_THE_MYREQUE),
IN_SEARCH_OF_THE_MYREQUE(385, "In Search of the Myreque", VarPlayer.QUEST_IN_SEARCH_OF_THE_MYREQUE),
JUNGLE_POTION(386, "Jungle Potion", VarPlayer.QUEST_JUNGLE_POTION),
KINGS_RANSOM(387, "King's Ransom", Varbits.QUEST_KINGS_RANSOM),
LEGENDS_QUEST(388, "Legends' Quest", VarPlayer.QUEST_LEGENDS_QUEST),
LOST_CITY(389, "Lost City", VarPlayer.QUEST_LOST_CITY),
THE_LOST_TRIBE(390, "The Lost Tribe", Varbits.QUEST_THE_LOST_TRIBE),
LUNAR_DIPLOMACY(391, "Lunar Diplomacy", Varbits.QUEST_LUNAR_DIPLOMACY),
MAKING_FRIENDS_WITH_MY_ARM(392, "Making Friends with My Arm", Varbits.QUEST_MAKING_FRIENDS_WITH_MY_ARM),
MAKING_HISTORY(393, "Making History", Varbits.QUEST_MAKING_HISTORY),
MERLINS_CRYSTAL(394, "Merlin's Crystal", VarPlayer.QUEST_MERLINS_CRYSTAL),
MONKEY_MADNESS_I(395, "Monkey Madness I", VarPlayer.QUEST_MONKEY_MADNESS_I),
MONKEY_MADNESS_II(396, "Monkey Madness II", Varbits.QUEST_MONKEY_MADNESS_II),
MONKS_FRIEND(397, "Monk's Friend", VarPlayer.QUEST_MONKS_FRIEND),
MOUNTAIN_DAUGHTER(398, "Mountain Daughter", Varbits.QUEST_MOUNTAIN_DAUGHTER),
MOURNINGS_ENDS_PART_I(399, "Mourning's Ends Part I", VarPlayer.QUEST_MOURNINGS_ENDS_PART_I),
MOURNINGS_ENDS_PART_II(400, "Mourning's Ends Part II", Varbits.QUEST_MOURNINGS_ENDS_PART_II),
MURDER_MYSTERY(401, "Murder Mystery", VarPlayer.QUEST_MURDER_MYSTERY),
MY_ARMS_BIG_ADVENTURE(402, "My Arm's Big Adventure", Varbits.QUEST_MY_ARMS_BIG_ADVENTURE),
NATURE_SPIRIT(403, "Nature Spirit", VarPlayer.QUEST_NATURE_SPIRIT),
OBSERVATORY_QUEST(404, "Observatory Quest", VarPlayer.QUEST_OBSERVATORY_QUEST),
OLAFS_QUEST(405, "Olaf's Quest", Varbits.QUEST_OLAFS_QUEST),
ONE_SMALL_FAVOUR(406, "One Small Favour", VarPlayer.QUEST_ONE_SMALL_FAVOUR),
PLAGUE_CITY(407, "Plague City", VarPlayer.QUEST_PLAGUE_CITY),
PRIEST_IN_PERIL(408, "Priest in Peril", VarPlayer.QUEST_PRIEST_IN_PERIL),
THE_QUEEN_OF_THIEVES(409, "The Queen of Thieves", Varbits.QUEST_THE_QUEEN_OF_THIEVES),
RAG_AND_BONE_MAN(410, "Rag and Bone Man", VarPlayer.QUEST_RAG_AND_BONE_MAN),
RAG_AND_BONE_MAN_II(411, "Rag and Bone Man II", VarPlayer.QUEST_RAG_AND_BONE_MAN_II),
RATCATCHERS(412, "Ratcatchers", Varbits.QUEST_RATCATCHERS),
RECIPE_FOR_DISASTER(413, "Recipe for Disaster", Varbits.QUEST_RECIPE_FOR_DISASTER),
RECRUITMENT_DRIVE(414, "Recruitment Drive", Varbits.QUEST_RECRUITMENT_DRIVE),
REGICIDE(415, "Regicide", VarPlayer.QUEST_REGICIDE),
ROVING_ELVES(416, "Roving Elves", VarPlayer.QUEST_ROVING_ELVES),
ROYAL_TROUBLE(417, "Royal Trouble", Varbits.QUEST_ROYAL_TROUBLE),
RUM_DEAL(418, "Rum Deal", VarPlayer.QUEST_RUM_DEAL),
SCORPION_CATCHER(419, "Scorpion Catcher", VarPlayer.QUEST_SCORPION_CATCHER),
SEA_SLUG(420, "Sea Slug", VarPlayer.QUEST_SEA_SLUG),
SHADES_OF_MORTTON(421, "Shades of Mort'ton", VarPlayer.QUEST_SHADES_OF_MORTTON),
SHADOW_OF_THE_STORM(422, "Shadow of the Storm", Varbits.QUEST_SHADOW_OF_THE_STORM),
SHEEP_HERDER(423, "Sheep Herder", VarPlayer.QUEST_SHEEP_HERDER),
SHILO_VILLAGE(424, "Shilo Village", VarPlayer.QUEST_SHILO_VILLAGE),
THE_SLUG_MENACE(425, "The Slug Menace", Varbits.QUEST_THE_SLUG_MENACE),
A_SOULS_BANE(426, "A Soul's Bane", Varbits.QUEST_A_SOULS_BANE),
SPIRITS_OF_THE_ELID(427, "Spirits of the Elid", Varbits.QUEST_SPIRITS_OF_THE_ELID),
SWAN_SONG(428, "Swan Song", Varbits.QUEST_SWAN_SONG),
TAI_BWO_WANNAI_TRIO(429, "Tai Bwo Wannai Trio", VarPlayer.QUEST_TAI_BWO_WANNAI_TRIO),
A_TAIL_OF_TWO_CATS(430, "A Tail of Two Cats", Varbits.QUEST_A_TAIL_OF_TWO_CATS),
TALE_OF_THE_RIGHTEOUS(431, "Tale of the Righteous", Varbits.QUEST_TALE_OF_THE_RIGHTEOUS),
A_TASTE_OF_HOPE(432, "A Taste of Hope", Varbits.QUEST_A_TASTE_OF_HOPE),
TEARS_OF_GUTHIX(433, "Tears of Guthix", Varbits.QUEST_TEARS_OF_GUTHIX),
TEMPLE_OF_IKOV(434, "Temple of Ikov", VarPlayer.QUEST_TEMPLE_OF_IKOV),
THRONE_OF_MISCELLANIA(435, "Throne of Miscellania", VarPlayer.QUEST_THRONE_OF_MISCELLANIA),
THE_TOURIST_TRAP(436, "The Tourist Trap", VarPlayer.QUEST_THE_TOURIST_TRAP),
TOWER_OF_LIFE(437, "Tower of Life", Varbits.QUEST_TOWER_OF_LIFE),
TREE_GNOME_VILLAGE(438, "Tree Gnome Village", VarPlayer.QUEST_TREE_GNOME_VILLAGE),
TRIBAL_TOTEM(439, "Tribal Totem", VarPlayer.QUEST_TRIBAL_TOTEM),
TROLL_ROMANCE(440, "Troll Romance", VarPlayer.QUEST_TROLL_ROMANCE),
TROLL_STRONGHOLD(441, "Troll Stronghold", VarPlayer.QUEST_TROLL_STRONGHOLD),
UNDERGROUND_PASS(442, "Underground Pass", VarPlayer.QUEST_UNDERGROUND_PASS),
CLIENT_OF_KOUREND(443, "Client of Kourend", Varbits.QUEST_CLIENT_OF_KOUREND),
WANTED(444, "Wanted!", Varbits.QUEST_WANTED),
WATCHTOWER(445, "Watchtower", VarPlayer.QUEST_WATCHTOWER),
WATERFALL_QUEST(446, "Waterfall Quest", VarPlayer.QUEST_WATERFALL_QUEST),
WHAT_LIES_BELOW(447, "What Lies Below", Varbits.QUEST_WHAT_LIES_BELOW),
WITCHS_HOUSE(448, "Witch's House", VarPlayer.QUEST_WITCHS_HOUSE),
ZOGRE_FLESH_EATERS(449, "Zogre Flesh Eaters", Varbits.QUEST_ZOGRE_FLESH_EATERS),
THE_ASCENT_OF_ARCEUUS(542, "The Ascent of Arceuus", Varbits.QUEST_THE_ASCENT_OF_ARCEUUS),
THE_FORSAKEN_TOWER(543, "The Forsaken Tower", Varbits.QUEST_THE_FORSAKEN_TOWER),
//Miniquests
ENTER_THE_ABYSS(319, "Enter the Abyss", VarPlayer.QUEST_ENTER_THE_ABYSS),
ARCHITECTURAL_ALLIANCE(320, "Architectural Alliance", Varbits.QUEST_ARCHITECTURAL_ALLIANCE),
BEAR_YOUR_SOUL(321, "Bear your Soul", Varbits.QUEST_BEAR_YOUR_SOUL),
ALFRED_GRIMHANDS_BARCRAWL(322, "Alfred Grimhand's Barcrawl", VarPlayer.QUEST_ALFRED_GRIMHANDS_BARCRAWL),
CURSE_OF_THE_EMPTY_LORD(323, "Curse of the Empty Lord", Varbits.QUEST_CURSE_OF_THE_EMPTY_LORD),
ENCHANTED_KEY(324, "Enchanted Key", Varbits.QUEST_ENCHANTED_KEY),
THE_GENERALS_SHADOW(325, "The General's Shadow", Varbits.QUEST_THE_GENERALS_SHADOW),
SKIPPY_AND_THE_MOGRES(326, "Skippy and the Mogres", Varbits.QUEST_SKIPPY_AND_THE_MOGRES),
THE_MAGE_ARENA(327, "The Mage Arena", VarPlayer.QUEST_THE_MAGE_ARENA),
LAIR_OF_TARN_RAZORLOR(328, "Lair of Tarn Razorlor", Varbits.QUEST_LAIR_OF_TARN_RAZORLOR),
FAMILY_PEST(329, "Family Pest", Varbits.QUEST_FAMILY_PEST),
THE_MAGE_ARENA_II(330, "The Mage Arena II", Varbits.QUEST_THE_MAGE_ARENA_II);
@Getter
private final int id;
@Getter
private final String name;
private final Varbits varbit;
private final VarPlayer varPlayer;
Quest(int id, String name, Varbits varbit)
{
this.id = id;
this.name = name;
this.varbit = varbit;
this.varPlayer = null;
}
Quest(int id, String name, VarPlayer varPlayer)
{
this.id = id;
this.name = name;
this.varbit = null;
this.varPlayer = varPlayer;
}
public QuestState getState(Client client)
{
client.runScript(ScriptID.QUESTLIST_PROGRESS, id);
switch (client.getIntStack()[0])
{
case 2:
return QuestState.FINISHED;
case 1:
return QuestState.NOT_STARTED;
default:
return QuestState.IN_PROGRESS;
}
}
public int getVar(Client client)
{
if (varbit != null)
{
return client.getVar(varbit);
}
else
{
return client.getVar(varPlayer);
}
}
}
+32
View File
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2019 Abex
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public enum QuestState
{
IN_PROGRESS,
NOT_STARTED,
FINISHED
}
+75
View File
@@ -0,0 +1,75 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.coords.WorldPoint;
/**
* Represents an overview of the currently rendered world map.
*/
public interface RenderOverview
{
/**
* Gets the current position of the local player on the world map.
*
* @return the world map position
*/
Point getWorldMapPosition();
/**
* Gets the current zoom level of the world map.
*
* @return the world map zoon
*/
float getWorldMapZoom();
/**
* Sets the target position of the world map.
*
* @param worldPoint the new target position
*/
void setWorldMapPositionTarget(WorldPoint worldPoint);
/**
* Gets the world map manager.
*
* @return the world map manager
*/
WorldMapManager getWorldMapManager();
/**
* Initializes the world map with the provided data.
*
* @param var1 the new map data
*/
void initializeWorldMap(WorldMapData var1);
/**
* The data represented by the render.
*
* @return the map data
*/
WorldMapData getWorldMapData();
}
+45
View File
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents an object that can be rendered.
*/
public interface Renderable extends Node
{
/**
* Gets the model of the object.
*/
Model getModel();
/**
* Gets the height of the model.
*/
int getModelHeight();
void setModelHeight(int modelHeight);
void draw(int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z, long hash);
}
+41
View File
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents the entire 3D scene
*/
public interface Scene
{
/**
* Gets the tiles in the scene
*
* @return the tiles in [plane][x][y]
*/
Tile[][][] getTiles();
int getDrawDistance();
void setDrawDistance(int drawDistance);
}
+88
View File
@@ -0,0 +1,88 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents the model of a tile in the current scene.
*/
public interface SceneTileModel
{
/**
* Gets the underlay color of the tile.
*
* @return the underlay color
*/
int getModelUnderlay();
/**
* Gets the overlay color of the tile.
*
* @return the overlay color
*/
int getModelOverlay();
/**
* Gets the shape mask type.
*
* @return the shape mask
*/
int getShape();
/**
* Gets the rotation of the tile.
*
* @return the rotation
*/
int getRotation();
int[] getFaceX();
int[] getFaceY();
int[] getFaceZ();
int[] getVertexX();
int[] getVertexY();
int[] getVertexZ();
int[] getTriangleColorA();
int[] getTriangleColorB();
int[] getTriangleColorC();
int[] getTriangleTextureId();
int getBufferOffset();
void setBufferOffset(int bufferOffset);
int getUvBufferOffset();
void setUvBufferOffset(int bufferOffset);
int getBufferLen();
void setBufferLen(int bufferLen);
}
+57
View File
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Represents the paint of a tile in the current scene.
*/
public interface SceneTilePaint
{
/**
* Gets the RGB value of the paint.
*
* @return the paint RGB
*/
int getRBG();
int getSwColor();
int getSeColor();
int getNwColor();
int getNeColor();
int getTexture();
int getBufferOffset();
void setBufferOffset(int bufferOffset);
int getUvBufferOffset();
void setUvBufferOffset(int bufferOffset);
int getBufferLen();
void setBufferLen(int bufferLen);
}
+32
View File
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2018 Abex
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public interface Script extends Node
{
int[] getIntOperands();
int[] getInstructions();
}
+64
View File
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.widgets.Widget;
public interface ScriptEvent
{
int MOUSE_X = -2147483647;
int MOUSE_Y = -2147483646;
int MENU_OP = -2147483644;
int WIDGET_ID = -2147483645;
int WIDGET_INDEX = -2147483643;
int WIDGET_TARGET_ID = -2147483642;
int WIDGET_TARGET_INDEX = -2147483641;
int KEY_CODE = -2147483640;
int KEY_CHAR = -2147483639;
String NAME = "event_opbase";
/**
* Gets the widget of the event.
*
* @return the widget
* @see api.widgets.Widget
*/
Widget getSource();
/**
* Gets the menu index of the event
*
* @return the index
*/
int getOp();
/**
* Gets the target of the menu option
*
* @return the target
* @see api.events.MenuOptionClicked
*/
String getOpbase();
}
+193
View File
@@ -0,0 +1,193 @@
/*
* Copyright (c) 2018 Abex
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public final class ScriptID
{
/**
* Updates the scrollbar handle and container to the new height of the content container
* <ul>
* <li> int (WidgetID) Scrollbar's widget ID </li>
* <li> int (WidgetID) Container widget ID </li>
* <li> int how far down to scroll </li>
* </ul>
*/
public static final int UPDATE_SCROLLBAR = 72;
/**
* Sends a chat message
* <ul>
* <li> int (byte) Flags </li>
* <li> String Message to send </li>
* </ul>
*/
public static final int CHATBOX_INPUT = 96;
/**
* Rebuilds the chatbox
*/
public static final int BUILD_CHATBOX = 216;
/**
* Opens the Private Message chat interface
*
* Jagex refers to this script as {@code meslayer_mode6}
* <ul>
* <li> String Player to send private message to</li>
* </ul>
*/
public static final int OPEN_PRIVATE_MESSAGE_INTERFACE = 107;
/**
* Rebuilds the text input widget inside the chat interface
* <ul>
* <li> String Message Prefix. Only used inside the GE search interfaces
* </ul>
*/
public static final int CHAT_TEXT_INPUT_REBUILD = 222;
/**
* Layouts the bank widgets
*
* Takes 13 widget ids of various parts of the bank interface
*/
public static final int BANK_LAYOUT = 277;
/**
* Closes the chatbox input
* <ul>
* <li> int (boolean) Clear the current text </li>
* <li> int (boolean) Restore to chat view </li>
* </ul>
*/
public static final int RESET_CHATBOX_INPUT = 299;
/**
* Readies the chatbox panel for things like the chatbox input
* Inverse of RESET_CHATBOX_INPUT
*/
public static final int CLEAR_CHATBOX_PANEL = 677;
/**
* Builds the chatbox input widget
*/
public static final int CHAT_PROMPT_INIT = 223;
/**
* Joins the corresponding minigame chat
*/
public static final int FORCE_JOIN_CC = 437;
/**
* Displays the game messages when clicking on an item inside the Items Kept on Death interface
* <ul>
* <li> int (boolean) Item kept on death </li>
* <li> int Item Quantity </li>
* <li> String Item Name </li>
* </ul>
*/
public static final int KEPT_LOST_ITEM_EXAMINE = 1603;
/**
* Checks the state of the given stash unit.
* <ul>
* <li>int (loc) The stash unit object id</li>
* <li>int Bitpacked stash unit states</li>
* <li>int Bitpacked stash unit states 2</li>
* <li>int Bitpacked stash unit states 3</li>
* </ul>
* <p>
* Returns a pair of booleans indicating if the stash unit is built and if it is filled
*/
public static final int WATSON_STASH_UNIT_CHECK = 1479;
/**
* Queries the completion state of a quest by its struct id
* <ul>
* <li> int (struct) The id of the quest
* </ul>
* Returns
* <ul>
* <li> int (QuestState) the normalized state of the quest
* </ul>
*/
public static final int QUESTLIST_PROGRESS = 2267;
/**
* Updates the Diary/Quest interface's scrollbar
* <ul>
* <li> int (boolean) Reset scroll position </li>
* <li> int Number of lines </li>
* </ul>
*/
public static final int DIARY_QUEST_UPDATE_LINECOUNT = 2523;
/**
* Initializes the chatbox input to use RuneLite callbacks
* <ul>
* <li> String Prompt text </li>
* <li> String Default value </li>
* </ul>
*/
public static final int RUNELITE_CHATBOX_INPUT_INIT = 10001;
/**
* Handles zoom input
* <ul>
* <li> int zoom value </li>
* <li> int zoom value </li>
* </ul>
*/
public static final int CAMERA_DO_ZOOM = 42;
/**
* Does nothing
*
* This is used to eat events when you want a menu action attached to it
* because you need an op listener attached to it for it to work
*/
public static final int NULL = 10003;
/**
* Send a private message.
*/
public static final int PRIVMSG = 10004;
/**
* Creates a disabled experience drop
*
* <ul>
* <li>int (Skill ordinal) Sets what icon to use</li>
* <li>int Amount of exp to drop</li>
* </ul>
*/
public static final int XPDROP_DISABLED = 2091;
/**
* Join a clan, duh
*/
public static final int CUSTOM_JOIN_CLAN = 10690;
}
+52
View File
@@ -0,0 +1,52 @@
package api;
/**
* An enumeration of skills that a player can level.
*/
public enum Skill
{
ATTACK("Attack"),
DEFENCE("Defence"),
STRENGTH("Strength"),
HITPOINTS("Hitpoints"),
RANGED("Ranged"),
PRAYER("Prayer"),
MAGIC("Magic"),
COOKING("Cooking"),
WOODCUTTING("Woodcutting"),
FLETCHING("Fletching"),
FISHING("Fishing"),
FIREMAKING("Firemaking"),
CRAFTING("Crafting"),
SMITHING("Smithing"),
MINING("Mining"),
HERBLORE("Herblore"),
AGILITY("Agility"),
THIEVING("Thieving"),
SLAYER("Slayer"),
FARMING("Farming"),
RUNECRAFT("Runecraft"),
HUNTER("Hunter"),
CONSTRUCTION("Construction"),
/**
* The level of all skills added together.
*/
OVERALL("Overall");
private final String name;
Skill(String name)
{
this.name = name;
}
/**
* Gets the name of the skill.
*
* @return the skill name
*/
public String getName()
{
return name;
}
}
+61
View File
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2018, Infinitay <https://github.com/Infinitay>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* An enumeration of PK skulls.
*/
public enum SkullIcon
{
/**
* White skull from PVP world or wilderness
*/
SKULL,
/**
* Red skull from Tzhaar Fight Pits
*/
SKULL_FIGHT_PIT,
/**
* Deadman mode sprite carrying one key
*/
DEAD_MAN_ONE,
/**
* Deadman mode sprite carrying two keys
*/
DEAD_MAN_TWO,
/**
* Deadman mode sprite carrying three keys
*/
DEAD_MAN_THREE,
/**
* Deadman mode sprite carrying four keys
*/
DEAD_MAN_FOUR,
/**
* Deadman mode sprite carrying five keys
*/
DEAD_MAN_FIVE,
}
+73
View File
@@ -0,0 +1,73 @@
/*
* Copyright (c) 2018, SomeoneWithAnInternetConnection
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
/**
* Utility class used for mapping sound effect IDs.
*/
public final class SoundEffectID
{
public final static int UI_BOOP = 2266;
public final static int GE_INCREMENT_PLOP = 3929;
public final static int GE_DECREMENT_PLOP = 3930;
public final static int GE_ADD_OFFER_DINGALING = 3925;
public final static int GE_COLLECT_BLOOP = 3928;
public final static int GE_COIN_TINKLE = 3924;
public final static int CLOSE_DOOR = 60;
public final static int OPEN_DOOR = 62;
public final static int ITEM_DROP = 2739;
public final static int ITEM_PICKUP = 2582;
public final static int PICK_PLANT_BLOOP = 2581;
public final static int BURY_BONES = 2738;
public final static int TINDER_STRIKE = 2597;
public final static int FIRE_WOOSH = 2596;
public final static int TREE_FALLING = 2734;
public final static int TREE_CHOP = 2735;
public final static int MINING_TINK = 3220;
public final static int COOK_WOOSH = 2577;
public final static int MAGIC_SPLASH_BOING = 227;
public final static int SMITH_ANVIL_TINK = 3790;
public final static int SMITH_ANVIL_TONK = 3791;
/**
* Used for random event NPCs spawning, and the imp teleport.
*/
public final static int NPC_TELEPORT_WOOSH = 1930;
public final static int TELEPORT_VWOOP = 200;
public final static int ZERO_DAMAGE_SPLAT = 511;
public final static int TAKE_DAMAGE_SPLAT = 510;
public final static int ATTACK_HIT = 2498;
public final static int PRAYER_ACTIVATE_VROOM = 2690;
public final static int PRAYER_DEACTIVE_VWOOP = 2663;
public final static int PRAYER_DEPLETE_TWINKLE = 2672;
public final static int TOWN_CRIER_BELL_DING = 3813;
public final static int TOWN_CRIER_BELL_DONG = 3817;
public final static int TOWN_CRIER_SHOUT_SQUEAK = 3816;
}
+95
View File
@@ -0,0 +1,95 @@
/*
* Copyright (c) 2017, Tyler <https://github.com/tylerthardy>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import java.awt.Color;
import java.awt.image.BufferedImage;
/**
* Represents data about the pixels of a sprite image.
*/
public interface Sprite
{
int DEFAULT_SHADOW_COLOR = 3153952;
/**
* Draws the pixels at the given coordinates on the canvas.
*
* @param x the x-axis coordinate
* @param y the y-axis coordinate
*/
void drawAt(int x, int y);
/**
* Gets the width of the sprite image in pixels.
*
* @return the width
*/
int getWidth();
/**
* Gets the height of the sprite image in pixels.
*
* @return the height
*/
int getHeight();
/**
* Gets an array of all pixels data in the sprite.
*
* @return the pixel data
*/
int[] getPixels();
/**
* Converts the sprite into a BufferedImage.
*
* @return the resulting BufferedImage
*/
BufferedImage toBufferedImage();
/**
* Writes the contents of the sprite to the given BufferedImage.
*
* @param img the passsed buffered image
* @throws IllegalArgumentException if the width or height do not match
*/
void toBufferedImage(BufferedImage img) throws IllegalArgumentException;
/**
* Writes the contents of the Sprite with chosen outline to the BufferedImage
*
* @param color target color
*/
BufferedImage toBufferedOutline(Color color);
/**
* Writes the contents of the Sprite with chosen outline to the BufferedImage
*
* @param img target image
* @param color target color
*/
void toBufferedOutline(BufferedImage img, int color);
}
File diff suppressed because it is too large Load Diff
+42
View File
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public interface Texture extends Node
{
int[] getPixels();
int getAnimationDirection();
int getAnimationSpeed();
boolean isLoaded();
float getU();
void setU(float u);
float getV();
void setV(float v);
}
@@ -0,0 +1,50 @@
/*
* Copyright (c) 2018, Tomas Slusny <slusnucky@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
public interface TextureProvider
{
double getBrightness();
/**
* Set the brightness for textures, clearing the texture cache.
* @param brightness
*/
void setBrightness(double brightness);
/**
* Get all textures
*
* @return
*/
Texture[] getTextures();
/**
* Get the pixels for a texture
* @param textureId
* @return
*/
int[] load(int textureId);
}
+139
View File
@@ -0,0 +1,139 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.coords.LocalPoint;
import api.coords.WorldPoint;
import java.util.List;
/**
* Represents a tile in the game.
*/
public interface Tile
{
/**
* Gets the decoration on the tile.
*
* @return the tile decoration
*/
DecorativeObject getDecorativeObject();
/**
* Gets all game objects on the tile.
*
* @return the game objects
*/
GameObject[] getGameObjects();
/**
* Gets the items held on this tile.
*
* @return the item
*/
ItemLayer getItemLayer();
/**
* Gets the object on the ground layer of the tile.
*
* @return the ground object
*/
GroundObject getGroundObject();
/**
* Gets the wall of the tile.
*
* @return the wall object
*/
WallObject getWallObject();
/**
* Gets the scene paint of the tile.
*
* @return the paint
*/
SceneTilePaint getSceneTilePaint();
/**
* Gets the model of the tile in the scene.
*
* @return the tile model
*/
SceneTileModel getSceneTileModel();
/**
* Gets the location coordinate of the tile in the world.
*
* @return the world location
*/
WorldPoint getWorldLocation();
/**
* Gets the location coordinate of the tile in scene coords
*
* @return the scene location
*/
Point getSceneLocation();
/**
* Gets the local coordinate of the tile.
*
* @return the local location
*/
LocalPoint getLocalLocation();
/**
* Gets the plane that this tile is on.
*
* @return the plane
*/
int getPlane();
/**
* Get the plane this tile is rendered on, which is where the tile heights are from.
*
* @return
*/
int getRenderLevel();
/**
* Computes and returns whether this tile has line of sight to another.
*
* @param other the other tile
* @return true if there is no sight obstruction, false otherwise
*/
boolean hasLineOfSightTo(Tile other);
/**
* Get all the ground items for this tile
*
* @return the ground items
*/
List<Item> getGroundItems();
/**
* Return the tile under this one, if this tile is a bridge
*/
Tile getBridge();
}
+136
View File
@@ -0,0 +1,136 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import api.coords.LocalPoint;
import api.coords.WorldPoint;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.geom.Area;
import javax.annotation.Nullable;
/**
* Represents an object that a tile holds.
*/
public interface TileObject
{
/**
* Gets the hashed value of this object.
*
* @return the object hash
*/
long getHash();
/**
* Gets the x-axis coordinate of the object in local context.
*
* @return the x-axis coordinate
*/
int getX();
/**
* Gets the y-axis coordinate of the object in local context.
*
* @return the y-axis coordinate
*/
int getY();
/**
* Gets the plane of the tile that the object is on.
*
* @return the tile plane
*/
int getPlane();
/**
* Gets the ID of the object.
*
* @return the object ID
*/
int getId();
/**
* Gets the location coordinate of the object in the world.
*
* @return the world location
*/
WorldPoint getWorldLocation();
/**
* Gets the local location of the object.
*
* @return the local location
*/
LocalPoint getLocalLocation();
/**
* Gets the upper-left canvas point where this object is drawn.
*
* @return the canvas location
*/
Point getCanvasLocation();
/**
* Gets the upper-left canvas point where this object is drawn,
* offset by the passed value.
*
* @param zOffset the z-axis offset
* @return the canvas location
*/
Point getCanvasLocation(int zOffset);
/**
* Gets the polygon of the objects model as drawn on the canvas.
*
* @return the canvas polygon
*/
Polygon getCanvasTilePoly();
/**
* Gets the text position on the canvas.
*
* @param graphics the client graphics
* @param text the text to draw
* @param zOffset the offset from ground plane
* @return the canvas point to draw the text at
*/
Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset);
/**
* Gets a point on the canvas of where this objects mini-map indicator
* should appear.
*
* @return mini-map location on canvas
*/
Point getMinimapLocation();
/**
* Get the on-screen clickable area of the object.
*
* @return the clickable area
*/
@Nullable
Area getClickbox();
}
+59
View File
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* An enumeration of integer local variables.
*/
@AllArgsConstructor
@Getter
public enum VarClientInt
{
TOOLTIP_TIMEOUT(1),
/**
* 0 = no tooltip displayed
* 1 = tooltip displaying
*/
TOOLTIP_VISIBLE(2),
INPUT_TYPE(5),
MEMBERSHIP_STATUS(103),
/**
* -1 = player inventory closed
* 3 = player inventory opened
*/
PLAYER_INVENTORY_OPENED(171),
INVENTORY_TAB(171),
WORLD_MAP_SEARCH_FOCUSED(190);
private final int index;
}
+44
View File
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2018, Kamiel
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package api;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* An enumeration of string local variables.
*/
@AllArgsConstructor
@Getter
public enum VarClientStr
{
DUEL_OPPONENT_NAME(357),
CHATBOX_TYPED_TEXT(335),
INPUT_TEXT(359),
PRIVATE_MESSAGE_TARGET(360),
RECENT_CLAN_CHAT(362);
private final int index;
}

Some files were not shown because too many files have changed in this diff Show More