Repository reorganisation

Unified kotlin and java into just src/main
Unified the rs09 and core packages
Took all content out of the core package, and placed it into the new content package
Reorganised all source code relating to content to be easier to find and explore
This commit is contained in:
Ceikry
2023-01-26 13:59:28 +00:00
committed by Ryan
parent e4b799c44a
commit a100affda2
3156 changed files with 24205 additions and 30585 deletions
@@ -0,0 +1,63 @@
package content.global.skill.summoning.familiar;
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;
/**
* Represents the class used for handling the npc options of familiars.
* @author Emperor
* @author 'Vexia
* @version 2.0
*/
@Initializable
public final class FamiliarNPCOptionPlugin extends OptionHandler {
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
NPCDefinition.setOptionHandler("pick-up", this);
NPCDefinition.setOptionHandler("interact-with", this);
NPCDefinition.setOptionHandler("interact", this);
NPCDefinition.setOptionHandler("store", this);
NPCDefinition.setOptionHandler("withdraw", this);
return this;
}
@Override
public boolean handle(final Player player, Node node, String option) {
if (!(node instanceof Familiar)) {
return false;
}
Familiar familiar = (Familiar) node;
if (familiar.getOwner() != player) {
player.getPacketDispatch().sendMessage("This is not your familiar.");
return true;
}
switch (option) {
case "pick-up":
player.faceLocation(FaceLocationFlag.getFaceLocation(player, familiar));
player.getFamiliarManager().pickup();
break;
case "interact-with":
player.getDialogueInterpreter().open(343823);
break;
case "interact":
player.getDialogueInterpreter().open(node.getId(), node);
break;
case "store":
case "withdraw":
if (!familiar.isBurdenBeast()) {
player.getPacketDispatch().sendMessage("This is not a beast of burden.");
break;
}
((BurdenBeast) familiar).openInterface();
break;
}
return true;
}
}