Skip to content

Commit

Permalink
xpdrops: add support for new dmm xp rates (open-osrs#251)
Browse files Browse the repository at this point in the history
* xpdrop: support new dmm xp rates

supports hits in XP drops for new DMM XP rates

* Update XpDropPlugin.java
  • Loading branch information
xKylee authored May 20, 2020
1 parent ead25fb commit 1b9635c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions experiencedrop/experiencedrop.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

version = "0.0.4"
version = "0.0.5"

project.extra["PluginName"] = "XP Drop"
project.extra["PluginDescription"] = "Enable customization of the way XP drops are displayed"
Expand All @@ -40,4 +40,4 @@ tasks {
))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import static net.runelite.api.ScriptID.XPDROP_DISABLED;
import net.runelite.api.Skill;
import net.runelite.api.SpriteID;
import net.runelite.api.VarClientInt;
import net.runelite.api.Varbits;
import net.runelite.api.WorldType;
import net.runelite.api.events.FakeXpDrop;
Expand Down Expand Up @@ -75,7 +76,7 @@ public class XpDropPlugin extends Plugin
{
private static final int XPDROP_PADDING = 2; // space between xp drop icons
private static final double HITPOINT_RATIO = 1.33; // Base rate of hp xp per point damage
private static final double DMM_MULTIPLIER_RATIO = 10;
private static double DMM_MULTIPLIER_RATIO;

@Inject
private Client client;
Expand Down Expand Up @@ -395,6 +396,14 @@ private void calculateDamageDealt(int diff)
// DeadMan mode has an XP modifier of 10x
if (client.getWorldType().contains(WorldType.DEADMAN))
{
if (client.getVar(VarClientInt.DMM_SAFEZONE) == 0)
{
DMM_MULTIPLIER_RATIO = 15;
}
if (client.getVar(VarClientInt.DMM_SAFEZONE) == 1)
{
DMM_MULTIPLIER_RATIO = 10;
}
damageDealt = damageDealt / DMM_MULTIPLIER_RATIO;
}

Expand Down Expand Up @@ -441,4 +450,4 @@ public void onStatChanged(StatChanged statChanged)
hasDropped = true;
}
}
}
}

0 comments on commit 1b9635c

Please sign in to comment.