Rewrote all the logic, encoding, etc for player/npc rendering masks (Animations, force movements, etc.)
Groundwork for modular 578 support has now been laid (at least in regards to render masks) Introduced an improved and more accurate API for using force movement (the old API is still around, all of its methods marked as deprecated) Converted a couple example cases to using the new force movement API just as a proof of concept Added a method to tick/time conversion methods to convert between client cycles and ticks Added all authentically-named buffer read/write methods to the buffer class
This commit is contained in:
@@ -9,7 +9,7 @@ import core.game.node.item.Item
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.map.RegionManager
|
||||
import core.game.world.update.flag.context.ChatMessage
|
||||
import core.game.world.update.flag.player.ChatFlag
|
||||
import core.game.world.update.flag.*
|
||||
import core.integrations.discord.Discord
|
||||
import org.json.simple.JSONArray
|
||||
import org.json.simple.JSONObject
|
||||
@@ -132,14 +132,14 @@ class DoublingMoney : Script() {
|
||||
val message = arrayOf("Doubling Money", "Doubling Money", "Doubling Money!", "Doubling moneyy").random()
|
||||
val messageEffect = arrayOf(0, 256).random()
|
||||
val ctx = ChatMessage(bot, message, messageEffect, message.length)
|
||||
bot.updateMasks.register(ChatFlag(ctx))
|
||||
bot.updateMasks.register(EntityFlag.Chat, ctx)
|
||||
sleepTime = 8
|
||||
}
|
||||
Effort.VERY_HIGH -> {
|
||||
val message = arrayOf("Doubling money!", "Doubling money").random()
|
||||
val messageEffect = arrayOf(771, 2818, 2562, 768, 512, 2304, 2560, 769, 1792).random()
|
||||
val ctx = ChatMessage(bot, message, messageEffect, message.length)
|
||||
bot.updateMasks.register(ChatFlag(ctx))
|
||||
bot.updateMasks.register(EntityFlag.Chat, ctx)
|
||||
sleepTime = 9
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ class DoublingMoney : Script() {
|
||||
if (botTradeModule.getInterface() == TradeModule.ACCEPT_INTERFACE && coinsFromBot > 0 && effort == Effort.VERY_HIGH) {
|
||||
val message = "Payed ${(if (coinsFromBot < 1000) "${coinsFromBot}gp" else "${coinsFromBot / 1000}k")}"
|
||||
val ctx = ChatMessage(bot, message, 512, message.length)
|
||||
bot.updateMasks.register(ChatFlag(ctx))
|
||||
bot.updateMasks.register(EntityFlag.Chat, ctx)
|
||||
|
||||
sleepTime = 7
|
||||
}
|
||||
@@ -325,7 +325,7 @@ class DoublingMoney : Script() {
|
||||
if (effort == Effort.VERY_HIGH) {
|
||||
val message = "Received ${(if (coins.amount < 1000) "${coins.amount}gp" else "${coins.amount / 1000}k")}"
|
||||
val ctx = ChatMessage(bot, message, 256, message.length)
|
||||
bot.updateMasks.register(ChatFlag(ctx))
|
||||
bot.updateMasks.register(EntityFlag.Chat, ctx)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import core.game.system.task.Pulse
|
||||
import core.game.world.GameWorld
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.update.flag.context.Animation
|
||||
import core.game.world.update.flag.player.FaceLocationFlag
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
|
||||
@@ -136,7 +135,7 @@ class BasaltRockShortcut : AgilityShortcut {
|
||||
player.sendMessage(noJump)
|
||||
} else {
|
||||
player.lock(3)
|
||||
player.faceLocation(FaceLocationFlag.getFaceLocation(player, Location.create(2518, 3611, 0)))
|
||||
player.faceLocation(Location.create(2518, 3611, 0))
|
||||
AgilityHandler.forceWalk(player, -1, Location.create(2516, 3611, 0), Location.create(2518, 3611, 0), Animation.create(769), 20, 0.0, null, 1)
|
||||
}
|
||||
return true
|
||||
@@ -147,7 +146,7 @@ class BasaltRockShortcut : AgilityShortcut {
|
||||
player.sendMessage(noJump)
|
||||
} else {
|
||||
player.lock(3)
|
||||
player.faceLocation(FaceLocationFlag.getFaceLocation(player, Location.create(2516, 3611, 0)))
|
||||
player.faceLocation(Location.create(2516, 3611, 0))
|
||||
AgilityHandler.forceWalk(player, -1, Location.create(2518, 3611, 0), Location.create(2516, 3611, 0), Animation.create(769), 20, 0.0, null, 1)
|
||||
}
|
||||
return true
|
||||
@@ -199,4 +198,4 @@ class BasaltRockShortcut : AgilityShortcut {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import core.game.node.scenery.SceneryBuilder;
|
||||
import core.game.world.GameWorld;
|
||||
import core.game.world.map.RegionManager;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.game.world.update.flag.player.FaceLocationFlag;
|
||||
import core.tools.RandomFunction;
|
||||
|
||||
/**
|
||||
@@ -129,7 +128,7 @@ public final class FireMakingPulse extends SkillPulse<Item> {
|
||||
SceneryBuilder.add(object, fire.getLife(), getAsh(player, fire, object));
|
||||
GroundItemManager.destroy(groundItem);
|
||||
player.moveStep();
|
||||
player.faceLocation(FaceLocationFlag.getFaceLocation(player, object));
|
||||
player.faceLocation(object.getFaceLocation(player.getLocation()));
|
||||
player.getSkills().addExperience(Skills.FIREMAKING,fire.getXp());
|
||||
|
||||
int playerRegion = player.getViewport().getRegion().getId();
|
||||
@@ -191,4 +190,4 @@ public final class FireMakingPulse extends SkillPulse<Item> {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@ import core.cache.def.impl.NPCDefinition;
|
||||
import core.game.interaction.OptionHandler;
|
||||
import core.game.node.Node;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.world.update.flag.player.FaceLocationFlag;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
|
||||
@@ -39,7 +38,7 @@ public final class FamiliarNPCOptionPlugin extends OptionHandler {
|
||||
}
|
||||
switch (option) {
|
||||
case "pick-up":
|
||||
player.faceLocation(FaceLocationFlag.getFaceLocation(player, familiar));
|
||||
player.faceLocation(familiar.getFaceLocation(player.getLocation()));
|
||||
player.getFamiliarManager().pickup();
|
||||
break;
|
||||
case "interact-with":
|
||||
|
||||
@@ -12,7 +12,6 @@ import core.game.system.task.Pulse;
|
||||
import core.game.world.GameWorld;
|
||||
import core.game.world.map.RegionManager;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.game.world.update.flag.player.FaceLocationFlag;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
import core.plugin.ClassScanner;
|
||||
@@ -153,7 +152,7 @@ public class ForgeRegentNPC extends Familiar {
|
||||
familiar.moveStep();
|
||||
GroundItemManager.destroy(ground);
|
||||
player.getSkills().addExperience(Skills.FIREMAKING, log.getXp() + 10);
|
||||
familiar.faceLocation(FaceLocationFlag.getFaceLocation(familiar, object));
|
||||
familiar.faceLocation(object.getFaceLocation(familiar.getLocation()));
|
||||
SceneryBuilder.add(object, log.getLife(), FireMakingPulse.getAsh(player, log, object));
|
||||
if (player.getViewport().getRegion().getId() == 10806) {
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.SEERS_VILLAGE, 1, 9);
|
||||
|
||||
@@ -21,7 +21,6 @@ import core.game.world.GameWorld;
|
||||
import core.game.world.map.RegionManager;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.game.world.update.flag.context.Graphics;
|
||||
import core.game.world.update.flag.player.FaceLocationFlag;
|
||||
import core.plugin.Plugin;
|
||||
import core.plugin.ClassScanner;
|
||||
|
||||
@@ -132,7 +131,7 @@ public class PyreLordNPC extends Familiar {
|
||||
familiar.moveStep();
|
||||
GroundItemManager.destroy(ground);
|
||||
player.getSkills().addExperience(Skills.FIREMAKING, log.getXp() + 10);
|
||||
familiar.faceLocation(FaceLocationFlag.getFaceLocation(familiar, object));
|
||||
familiar.faceLocation(object.getFaceLocation(familiar.getLocation()));
|
||||
SceneryBuilder.add(object, log.getLife(), FireMakingPulse.getAsh(player, log, object));
|
||||
if (player.getViewport().getRegion().getId() == 10806) {
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.SEERS_VILLAGE, 1, 9);
|
||||
|
||||
Reference in New Issue
Block a user