Merge pull request #4 from Ceikry/DesertTweakin

Desert tweakin
This commit is contained in:
The Celery Man 2020-03-13 10:28:33 -05:00 committed by GitHub
commit 3ce385bc0e
13 changed files with 1090 additions and 5 deletions

View file

@ -0,0 +1,251 @@
package plugin.interaction.city.pollnivneach;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.content.dialogue.FacialExpression;
import org.crandor.game.node.entity.player.Player;
import org.crandor.plugin.InitializablePlugin;
/**
* Dialogue for Ali the Camel Man
* @author ceik
*/
@InitializablePlugin
public class AliCamelMan extends DialoguePlugin {
public AliCamelMan(){
/**
* Empty
*/
}
public AliCamelMan(Player player){ super(player);}
@Override
public DialoguePlugin newInstance(Player player){ return new AliCamelMan(player);}
public boolean open(Object... args){
npc("Welcome to my discount camel store.","Can I help you with anything?");
return true;
}
public boolean handle(int interaceId, int buttonId){
switch(stage){
case 0:
interpreter.sendOptions("Select one.","A discount camel store?","Tell me about this town.","Lovely day isn't it?","Are those camels around the side for sale?","I'm looking for Ali from Pollnivneach.");
stage = 10;
break;
case 10:
switch(buttonId){
case 1:
player(FacialExpression.ASKING,"A discount camel store?");
stage = 20;
break;
case 2:
player(FacialExpression.THINKING,"Tell me about this town.");
stage = 30;
break;
case 3:
player(FacialExpression.ASKING,"Lovely day isn't it?");
stage = 40;
break;
case 4:
player(FacialExpression.ASKING,"Are those camels around the side for sale?");
stage = 50;
break;
case 5:
player(FacialExpression.ASKING,"I'm looking for Ali from Pollnivneach.");
stage = 60;
}
break;
case 20:
npc(FacialExpression.JOLLY,"Yes- a great idea - selling camels at discounted","prices so that the common man can experience","the joys of owning a camel too. They're not just","a source of kebab meat you know!");
stage = 21;
break;
case 21:
interpreter.sendOptions("Select one.","So can I buy a camel then? I'm hungry!","Yes camels are beautiful creatures.","Filthy animals all they do is spit and...","Actually I think I was a camel in a previous existence.","So is business good then?");
stage = 22;
break;
case 22:
switch(buttonId){
case 1:
player(FacialExpression.ASKING,"So can I buy a camel then? I'm hungry!");
stage = 230;
break;
case 2:
player(FacialExpression.HAPPY,"Yes camels are beautiful creatures.");
stage = 240;
break;
case 3:
player(FacialExpression.DISGUSTED,"Filthy animals all they do is spit and...");
stage = 250;
break;
case 4:
player(FacialExpression.THINKING,"Actually I think I was a camel in a previous existence.");
stage = 260;
break;
case 5:
player(FacialExpression.ASKING,"So is business good then?");
stage = 270;
}
break;
case 230:
npc(FacialExpression.DISGUSTED,"I would never sell to the likes of you,","they are beautiful majestic creatures not sandwich","fillers! Get ouf my shop.");
stage = 100;
break;
case 240:
npc(FacialExpression.LAUGH,"Ah, wondrous creatures, ships of the desert, far","more useful than any horse or donkey.","A man's best friend.");
stage = 25;
break;
case 25:
npc(FacialExpression.FRIENDLY,"Is there anything else I can help you with?");
stage = 26;
break;
case 26:
interpreter.sendOptions("Select one.","Well yes actually I'd like to ask about something else.","No but thanks for your time.");
stage = 27;
break;
case 27:
switch(buttonId){
case 1:
player("Well yes actually I'd like to ask about something else.");
stage = 0;
break;
case 2:
player("No but thanks for your time.");
stage = 100;
break;
}
break;
case 250:
npc(FacialExpression.ANGRY,"Pah! You just do not know how to treat them.","If you abuse them and treat them badly of","course they are going to spit and bite.");
stage = 25;
break;
case 260:
npc(FacialExpression.LAUGH,"You're teasing me now! You rogue! Everyone has","a laugh at my expense, I'm just more","enlightened than you!");
stage = 25;
break;
case 270:
npc(FacialExpression.HAPPY,"Business is booming, Pollnivneach has never seen this","number of visitors.");
stage = 271;
break;
case 271:
npc(FacialExpression.THINKING,"In fact I'm thinking of expanding and trying to break","into the camel hire market.");
stage = 25;
break;
case 30:
npc(FacialExpression.THINKING,"Well Polvnivneach is a funny little place. It's a","small town and you'd think it would be a","quiet place.");
stage = 300;
break;
case 300:
npc(FacialExpression.ANGRY,"But those menaphites and bandits are making this place","quit unbearable.");
stage = 310;
break;
case 310:
interpreter.sendOptions("Select one.","In what way?","Well the weak will always be trodden on. Why not stand up to them?","Perhaps I can help.");
stage = 311;
break;
case 311:
switch(buttonId){
case 1:
player(FacialExpression.ASKING,"In what way?");
stage = 320;
break;
case 2:
player(FacialExpression.ASKING,"Well the weak will always be trodden on. Why not stand up to them?");
stage = 330;
break;
case 3:
player(FacialExpression.FRIENDLY,"Perhaps I can help.");
stage = 340;
break;
}
break;
case 320:
npc(FacialExpression.ANGRY,"Well one group is just as bad as the other, stealing from each other","and the locals, fighting, and just the last dayone of the","bandits came looking for protection money.");
stage = 321;
break;
case 321:
player(FacialExpression.ANGRY,"Why don't the authorities stop this?");
stage = 322;
break;
case 322:
npc(FacialExpression.SAD,"If you haven't noticed this is a remote town, half way between","Menaphos and Al Kharid, a place where neither","exert any power.");
stage = 323;
break;
case 323:
npc(FacialExpression.SAD,"To tell the truth we live in hope that an objective","outsider could broker a deal to halt the hostilities","between them.");
stage = 324;
break;
case 324:
player("Perhaps I will.");
stage = 25;
break;
case 330:
npc("That's a little unfair my friend. We can't all be brave","adventurers. If we were, where would you go to get camels","at discounted prices?");
stage = 331;
break;
case 331:
npc(FacialExpression.ASKING,"You might think about that. Anyways isn't it the job of the brave","adventurer to deliver the weak and innocent from","evil and harm?");
stage = 25;
break;
case 340:
//TODO: Add the quest and fix dialogue starting here.
npc(FacialExpression.SAD,"No, I don't think you can just yet. Perhaps in the future.");
stage = 100;
break;
case 40:
npc(FacialExpression.SUSPICIOUS,"It's a beautiful day today but word has it","that it will rain tomorrow.");
stage = 400;
break;
case 400:
player(FacialExpression.SUSPICIOUS,"Really?");
stage = 410;
break;
case 410:
npc(FacialExpression.LAUGH,"No don't worry I'm only joking!");
stage = 420;
break;
case 420:
player(FacialExpression.ANNOYED,"Ok so....");
stage = 25;
break;
case 50:
npc(FacialExpression.HALF_GUILTY,"Those two camels around the side are already sold.");
stage = 500;
break;
case 500:
npc(FacialExpression.FRIENDLY,"I've got new stock coming very soon though.","Come back later if you're still interested.");
stage = 25;
break;
case 60:
npc(FacialExpression.HAPPY,"Well you've found your man.");
stage = 600;
break;
case 600:
player(FacialExpression.SUSPICIOUS,"Really do you have an uncle called Ali?");
stage = 610;
break;
case 610:
npc(FacialExpression.NEUTRAL,"Why yes - All my uncles are called Ali!");
stage = 620;
break;
case 620:
player(FacialExpression.THINKING,"Oh dear! Do any of them own a stall in the","Al Kharid Bazaar?");
stage = 630;
break;
case 630:
npc(FacialExpression.THINKING,"Well no, but one of them owns a camel hire franchise.");
stage = 640;
break;
case 640:
player(FacialExpression.ANNOYED,"Never mind.");
stage = 100;
break;
case 100:
end();
break;
}
return true;
}
@Override
public int[] getIds(){return new int[] {1867};}
}

View file

@ -0,0 +1,93 @@
package plugin.interaction.city.pollnivneach;
import org.crandor.cache.def.impl.NPCDefinition;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.content.dialogue.FacialExpression;
import org.crandor.game.interaction.OptionHandler;
import org.crandor.game.node.Node;
import org.crandor.game.node.entity.npc.NPC;
import org.crandor.game.node.entity.player.Player;
import org.crandor.game.system.task.Pulse;
import org.crandor.game.world.GameWorld;
import org.crandor.game.world.update.flag.context.Animation;
import org.crandor.plugin.InitializablePlugin;
import org.crandor.plugin.Plugin;
import org.crandor.tools.RandomFunction;
/**
* Handles Ali the Camel interaction
* @author ceik
*/
@InitializablePlugin
public class AliTheCamelHandler extends OptionHandler {
public Plugin<Object> newInstance(Object arg) throws Throwable {
new AliTheCamelDialogue().init();
NPCDefinition.forId(1873).getConfigurations().put("option:pet",this);
return this;
}
public boolean handle(Player player, Node node, String options){
NPC npc = (NPC) node;
if(npc.getId() == 1873){
if (options.equals("pet")){
player.getDialogueInterpreter().open(1873);
}
}
return true;
}
public class AliTheCamelDialogue extends DialoguePlugin {
public AliTheCamelDialogue(){
/**
* Empty
*/
}
public AliTheCamelDialogue(Player player){super(player);}
@Override
public DialoguePlugin newInstance(Player player){return new AliTheCamelDialogue(player);}
@Override
public boolean open(Object... args){
int phrase = RandomFunction.random(1,4);
switch(phrase){
case 1:
player(FacialExpression.AFRAID,"That beast would probably bite my fingers off","if I tried to pet it");
break;
case 2:
player(FacialExpression.DISGUSTED,"I'm not going to pet that! I might get fleas","or something else that nasty creature","might have.");
break;
case 3:
player(FacialExpression.THINKING,"Mmmm... Won't you make the nicest kebab?");
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
player.lock();
player.animate(new Animation(7299));
player.getImpactHandler().setDisabledTicks(3);
GameWorld.submit(new Pulse(4, player) {
@Override
public boolean pulse() {
player.unlock();
player.getAnimator().reset();
return true;
}
});
player.getDialogueInterpreter().sendDialogue("The camel tries to kick you for insulting it.");
stage = 1;
break;
case 1:
end();
break;
}
return true;
}
@Override
public int[] getIds(){return new int[] {1873};}
}
}

View file

@ -0,0 +1,226 @@
package plugin.interaction.city.pollnivneach;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.content.dialogue.FacialExpression;
import org.crandor.game.node.entity.npc.NPC;
import org.crandor.game.node.entity.player.Player;
import org.crandor.game.node.item.Item;
import org.crandor.plugin.InitializablePlugin;
@InitializablePlugin
public class AliTheKebabSeller extends DialoguePlugin {
public AliTheKebabSeller(){
/**
* Empty
*/
}
public AliTheKebabSeller(Player player){ super(player);}
@Override
public DialoguePlugin newInstance(Player player){return new AliTheKebabSeller(player);}
@Override
public boolean open(Object... args){
NPC npc = (NPC)args[0];
player("Hello");
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId){
boolean hasSauced = false;
switch(stage){
case 0:
npc("Hello. What can I do for you?");
stage = 1;
break;
case 1:
player("I don't know, what can you do for me?");
stage = 2;
break;
case 2:
npc("Well, that depends.");
stage = 3;
break;
case 3:
player("Depends on what?");
stage = 4;
break;
case 4:
npc("It depends on whether you like kebabs or not.");
stage = 5;
break;
case 5:
player("Why is that?");
stage = 6;
break;
case 6:
npc("Seeing as I'm in the kebab construction industry.","I mainly help people who have want of a kebab.");
stage = 7;
break;
case 7:
player(FacialExpression.THINKING,"Well then, what kind of kebabs do you, erm, construct?");
stage = 8;
break;
case 8:
npc("I offer two different types of kebabs: the standard","run-of-the-mill kebab seen throughout 2009scape and","enjoyed by many a intoxicated dwarf, and my specialty,","the extra-hot kebab. So which shall it be?");
stage = 9;
break;
case 9:
npc("Or are my services even required?");
stage = 10;
break;
case 10:
interpreter.sendOptions("Select one","Yes, thanks.","No thanks, I'm good");
stage = 11;
break;
case 11:
switch(buttonId){
case 1:
player("Yes, thanks.");
stage = 12;
break;
case 2:
player("No thanks, I'm good.");
stage = 100;
break;
}
break;
case 12:
interpreter.sendOptions("Select one.","I want a kebab, please.", "Could I have one of those crazy hot kebabs of yours?","Would you sell me that bottle of special kebab sauce?", "What is the difference between the standard and extra hot?","I need some information.");
stage = 13;
break;
case 13:
switch(buttonId){
case 1:
player("I want a kebab, please.");
stage = 20;
break;
case 2:
player("Could I have one of those crazy hot kebabs of yours?");
stage = 30;
break;
case 3:
player("Would you sell me that bottle of special kebab sauce?");
stage = 40;
break;
case 4:
player("What is the difference between the standard and extra hot?");
stage = 50;
break;
case 5:
player("I need some information.");
stage = 60;
break;
}
break;
case 20:
npc("That will be 3 coins please.");
if(player.getInventory().contains(995,3)) {
stage = 21;
} else {
stage = 25;
}
break;
case 21:
npc("Here you go.");
player.getInventory().remove(new Item(995,3));
player.getInventory().add(new Item(1971));
stage = 22;
break;
case 22:
npc("Is there anything else I can do for you?");
stage = 10;
break;
case 25:
player("I seem to have not brought enough money with me. Sorry.");
stage = 22;
break;
case 30:
npc("A super kebab it is so. Be careful, they really are as hot as","they are made out to be.");
stage = 31;
break;
case 31:
player("Sure, sure.");
stage = 32;
break;
case 32:
npc("Here you go.");
player.getInventory().add(new Item(4608));
stage = 33;
break;
case 33:
player("Thanks.");
stage = 22;
break;
case 40:
if(!player.getInventory().containsItem(new Item(4610))) {
npc("Well, that depends on what you have in mind.");
stage = 41;
break;
} else {
npc("I already gave it to you!");
stage = 22;
break;
}
case 41:
player("Set yourself at east, I have no intention of setting up a","rival kebab shop.");
stage = 42;
break;
case 42:
npc("Well, then, what do you want it for?");
stage = 43;
break;
case 43:
player("I don't know, but I think I could have a little fun with it.");
stage = 44;
break;
case 44:
npc("You're not going to put it in drunken Ali's drink"," now, are you? That's what happened last time","I gave someone the sauce.");
stage = 45;
break;
case 45:
player("No, that would be a bit cliche, I think I'll come up with","something more original.");
stage = 46;
break;
case 46:
npc("Just be careful with it, it's potent enough to give a camel","the runs.");
player.getInventory().add(new Item(4610));
stage = 47;
break;
case 47:
player("Thank you very much.");
stage = 22;
break;
case 50:
npc("If I told you that I would have to kill you. Kebab sales is","a cut-throat industry. The extra-hot kebab gives","me the competitive edge on the rest and if I were to","divulge my secrets to every passing adventurer, well it");
stage = 51;
break;
case 51:
npc("would soon disappear.");
stage = 52;
break;
case 52:
player("So there's no difference except the sauce you use then!");
stage = 53;
break;
case 53:
npc("Shh! Keep your voice down. You should have told me you","were from the union.");
stage = 22;
break;
case 60:
npc("If information is what you need, there are many better"," people to ask than myself who could help you. One of the","town's street urchins or perhaps the local drunk.","I may be many things to many people, but a");
stage = 61;
break;
case 61:
npc("gossip I am not.");
stage = 22;
break;
case 100:
end();
break;
}
return true;
}
@Override
public int[] getIds() {return new int[] {1865};}
}

View file

@ -0,0 +1,42 @@
package plugin.interaction.city.pollnivneach;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.node.entity.player.Player;
import org.crandor.plugin.InitializablePlugin;
/**
* Stand-in dialogue for Black Jack Seller til blackjacking/the quest is implemented
* @author ceik
*/
@InitializablePlugin
public class BlackJackSeller extends DialoguePlugin {
public BlackJackSeller(){
/**
* empty.
*/
}
public BlackJackSeller(Player player){super(player);}
@Override
public DialoguePlugin newInstance(Player player){return new BlackJackSeller(player);}
@Override
public boolean open(Object... args){
npc("I'm not interested in selling to you. Not yet...");
stage = 0;
return true;
}
@Override
public boolean handle(int intefaceId, int objectId){
switch(stage){
case 0:
end();
break;
}
return true;
}
@Override
public int[] getIds() {return new int[] {2548};}
}

View file

@ -0,0 +1,59 @@
package plugin.interaction.city.pollnivneach;
import org.crandor.cache.def.impl.NPCDefinition;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.interaction.OptionHandler;
import org.crandor.game.node.Node;
import org.crandor.game.node.entity.npc.NPC;
import org.crandor.game.node.entity.player.Player;
import org.crandor.plugin.InitializablePlugin;
import org.crandor.plugin.Plugin;
/**
* Stand-in for bandit dialogue until blackjacking is implemented
* @author ceik
*/
@InitializablePlugin
public class DesertBandit extends OptionHandler {
public Plugin<Object> newInstance(Object arg) throws Throwable {
new BanditDialogue().init();
NPCDefinition.forId(6388).getConfigurations().put("option:talk-to",this);
return this;
}
public boolean handle(Player player, Node node, String options){
NPC npc = (NPC) node;
if(npc.getId() == 6388){
if (options.equals("talk-to")){
player.getDialogueInterpreter().open(6388);
}
}
return true;
}
public class BanditDialogue extends DialoguePlugin {
public BanditDialogue() {
/**
* Empty.
*/
}
public BanditDialogue(Player player){super(player);}
@Override
public DialoguePlugin newInstance(Player player){return new BanditDialogue(player);}
@Override
public boolean open(Object... args){
npc("Go away.");
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId){
end();
return true;
}
@Override
public int[] getIds() {return new int[] {6388};}
}
}

View file

@ -0,0 +1,109 @@
package plugin.interaction.city.pollnivneach;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.content.dialogue.FacialExpression;
import org.crandor.game.interaction.NodeUsageEvent;
import org.crandor.game.interaction.UseWithHandler;
import org.crandor.game.node.entity.player.Player;
import org.crandor.game.node.item.GroundItemManager;
import org.crandor.game.node.item.Item;
import org.crandor.plugin.InitializablePlugin;
import org.crandor.plugin.Plugin;
/**
* Handles Ali the Snake Charmer
* @author ceik
*/
@InitializablePlugin
public class SnakeCharmerBasket extends UseWithHandler {
public SnakeCharmerBasket() {
super(995);
}
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
addHandler(6230, OBJECT_TYPE, this);
new AliTheSnakeCharmer().init();
return this;
}
@Override
public boolean handle(NodeUsageEvent event) {
final Player player = event.getPlayer();
if (player.getInventory().containsItem(new Item(995,3))) {
player.getInventory().remove(new Item(995, 3));
player.getDialogueInterpreter().open(1872, true);
}
return true;
}
public class AliTheSnakeCharmer extends DialoguePlugin {
public AliTheSnakeCharmer() {
/**
* empty.
*/
}
public AliTheSnakeCharmer(Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new AliTheSnakeCharmer(player);
}
@Override
public boolean open(Object... args) {
if (args.length > 0) {
stage = 5;
} else {
player("Wow a snake charmer. Can I have a go? Please?");
stage = 0;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
player.getDialogueInterpreter().sendDialogue("The snake charmer fails to acknowledge you,","he seems too deep into the music to notice you.");
stage = 4;
break;
case 4:
end();
break;
case 5:
player.getDialogueInterpreter().sendDialogue("The snake charmer snaps out of his trance","and directs his full attention to you.");
stage = 6;
break;
case 6:
player(FacialExpression.JOLLY, "Wow a snake charmer. Can I have a go? Please?");
stage = 7;
break;
case 7:
if(!player.getInventory().containsItems(new Item(4605),new Item(4606)) && !player.getBank().containItems(4605,4606)) {
if (player.getInventory().freeSlots() >= 2) {
player.getInventory().add(new Item(4605));
player.getInventory().add(new Item(4606));
} else {
GroundItemManager.create(new Item(4605), player.getLocation());
GroundItemManager.create(new Item(4606), player.getLocation());
}
npc(FacialExpression.ANNOYED, "If it means that you'll leave me alone, I would give you"," my snake harming super starter kit complete","with flute and basket.");
} else {
npc(FacialExpression.ANGRY,"I already gave you one!");
}
stage = 4;
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[]{1872};
}
}
}

View file

@ -0,0 +1,39 @@
package plugin.interaction.city.pollnivneach;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.node.entity.player.Player;
import org.crandor.plugin.InitializablePlugin;
/**
* Handles the street urchin npc TODO: Add more dialogue after/during the quest when it is implemented.
* @author ceik
*/
@InitializablePlugin
public class StreetUrchinDialogue extends DialoguePlugin {
public StreetUrchinDialogue(){
/**
* Empty
*/
}
public StreetUrchinDialogue(Player player){super(player);}
@Override
public DialoguePlugin newInstance(Player player){return new StreetUrchinDialogue(player);}
public boolean open(Object... args){
player.getDialogueInterpreter().sendDialogue("This child doesn't seem interested in you.");
return true;
}
public boolean handle(int interfaceId, int buttonId){
switch(stage){
case 0:
end();
break;
}
return true;
}
@Override
public int[] getIds(){return new int[] {6357};}
}

View file

@ -0,0 +1,36 @@
package plugin.interaction.city.sophanem;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.node.entity.npc.NPC;
import org.crandor.game.node.entity.player.Player;
import org.crandor.plugin.InitializablePlugin;
/**
* Handles the Klenter NPC, which should be invisible until a quest stage has been reached. Will do that when quest is added.
* @author ceik
*/
@InitializablePlugin
public class KlenterNPC extends DialoguePlugin {
public KlenterNPC(){
/**
* Empty
*/
}
public KlenterNPC(Player player){super(player);}
@Override
public DialoguePlugin newInstance(Player player){return new KlenterNPC(player);}
@Override
public boolean open(Object... args){
npc("OOOOoOOOoOO");
return true;
}
@Override
public boolean handle(int interfaceId,int buttonId){
return true;
}
@Override
public int[] getIds(){return new int[] {2014};}
}

View file

@ -0,0 +1,113 @@
package plugin.interaction.city.sophanem;
import org.crandor.cache.def.impl.NPCDefinition;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.content.dialogue.FacialExpression;
import org.crandor.game.node.entity.npc.NPC;
import org.crandor.game.node.entity.player.Player;
import org.crandor.plugin.InitializablePlugin;
/**
* Handles Sphinx dialogue
* @author ceik
*/
@InitializablePlugin
public final class SphinxDialogue extends DialoguePlugin {
public SphinxDialogue() {
/**
* Empty
*/
}
public SphinxDialogue(Player player){super(player);}
@Override
public DialoguePlugin newInstance(Player player) {
return new SphinxDialogue(player);
}
@Override
public boolean open(Object... args){
npc = (NPC) args[0];
if(player.getFamiliarManager().hasPet() && player.getFamiliarManager().getFamiliar().getId() >= 761 && player.getFamiliarManager().getFamiliar().getId() < 767){
player("Good day.");
stage = 50;
} else {
player("Good day.");
stage = 0;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId){
switch(stage){
case 0:
npc("You have the feel of a cat person","about you. Do you look after one?");
stage = 1;
break;
case 1:
interpreter.sendOptions("Select one.","Yes, but I don't bring it to harsh places like this.","No, you are mistaken.","Yes, but I have left mine in the bank.");
stage = 2;
break;
case 2:
switch(buttonId){
case 1:
player("Yes, but I don't bring it to harsh places like this.");
stage = 3;
break;
case 2:
player("No, you are mistaken.");
stage = 5;
break;
case 3:
player("Yes, but I have left mine in the bank.");
stage = 7;
break;
}
break;
case 3:
npc(FacialExpression.SAD,"A pity, they can be of great help in","some adventures. I would like to talk to","your cat. Would you bring it to me?");
stage = 4;
break;
case 4:
player("I might, but I have a few things to sort out first.");
stage = 10;
break;
case 5:
npc(FacialExpression.SUSPICIOUS,"Really? I'm generally quite good at knowing","these things.");
stage = 10;
break;
case 7:
npc(FacialExpression.AFRAID,"What? That's no place for a cat!");
stage = 10;
break;
case 10:
end();
break;
case 50:
player.getDialogueInterpreter().sendDialogue("The Sphinx ignores you.");
stage = 51;
break;
case 51:
npc("Ah, how interesting... a cat. Come here to","me, kitty.");
stage = 52;
break;
case 52:
player.getFamiliarManager().getFamiliar().sendChat("Meow");
stage = 53;
case 53:
player.getDialogueInterpreter().sendDialogue("The Sphinx and the cat have a chat.");
stage = 54;
break;
case 54:
//TODO : Add dialogue for quest-related bits after the quests are added, ends here for now.
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 1990 };
}
}

View file

@ -0,0 +1,49 @@
package plugin.interaction.city.sophanem;
import org.crandor.game.content.dialogue.DialoguePlugin;
import org.crandor.game.node.entity.player.Player;
import org.crandor.plugin.InitializablePlugin;
/**
* Stand-in until we get the real dialogue for Tarik
* @author ceik
*/
@InitializablePlugin
public class TarikDialogue extends DialoguePlugin {
public TarikDialogue() {
/**
* Empty
*/
}
public TarikDialogue(Player player){super(player);}
@Override
public DialoguePlugin newInstance(Player player) {
return new TarikDialogue(player);
}
@Override
public boolean open(Object... args){
npc("I found this crazy looking pyramid here.","I can't seem to figure out what it's for.","Maybe you should head inside?");
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId){
switch(stage){
case 0:
player("Oh, alright...");
stage = 1;
break;
case 1:
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 4478 };
}
}

View file

@ -0,0 +1,66 @@
package plugin.interaction.city.sophanem;
import org.crandor.cache.def.impl.ObjectDefinition;
import org.crandor.game.content.skill.Skills;
import org.crandor.game.interaction.OptionHandler;
import org.crandor.game.node.Node;
import org.crandor.game.node.entity.impl.ForceMovement;
import org.crandor.game.node.entity.player.Player;
import org.crandor.game.node.object.GameObject;
import org.crandor.game.system.task.Pulse;
import org.crandor.game.world.GameWorld;
import org.crandor.game.world.map.Location;
import org.crandor.game.world.update.flag.context.Animation;
import org.crandor.plugin.InitializablePlugin;
import org.crandor.plugin.Plugin;
/**
* Handles the Sophanem wall shortcut
* @author ceik
*/
@InitializablePlugin
public final class WallShortcut extends OptionHandler {
private static final Animation CLIMB_DOWN = Animation.create(2589);
private static final Animation CRAWL_THROUGH = Animation.create(2590);
private static final Animation CLIMB_UP = Animation.create(2591);
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
ObjectDefinition.forId(6620).getConfigurations().put("option:climb-through", this);
return null;
}
@Override
public boolean handle(final Player player, Node node, String option) {
if (player.getSkills().getLevel(Skills.AGILITY) < 21) {
player.getDialogueInterpreter().sendDialogue("You need an Agility level of at least 21 to do this.");
return true;
}
player.lock(4);
final GameObject o = (GameObject) node;
if (o.getId() == 6620) {
ForceMovement.run(player, Location.create(3320, 2796, 0), o.getLocation(), CLIMB_DOWN);
GameWorld.submit(new Pulse(1, player) {
int count;
@Override
public boolean pulse() {
switch (++count) {
case 2:
player.animate(CRAWL_THROUGH);
player.getProperties().setTeleportLocation(Location.create(3324, 2796, 0));
break;
case 3:
ForceMovement.run(player, Location.create(3324, 2796, 0), Location.create(3324, 2796, 0), CLIMB_UP);
return true;
}
return false;
}
});
}
return true;
}
}

View file

@ -206,7 +206,7 @@ public final class AgilityPyramidCourse extends AgilityCourse {
*/
private void handleLowWall(final Player player, final GameObject object) {
Direction d = Direction.getDirection(player.getLocation(), object.getLocation());
final boolean fail = hasFailed(player);
final boolean fail = player.getSkills().getLevel(Skills.AGILITY) >= 75 ? false : hasFailed(player) ;
if (player.getLocation().equals(Location.create(3355, 2848, 1)) || player.getLocation().equals(Location.create(3359, 2838, 3))) {
d = Direction.NORTH;
} else if (player.getLocation().equals(Location.create(3355, 2850, 1)) || player.getLocation().equals(Location.create(3359, 2840, 3))) {
@ -238,7 +238,8 @@ public final class AgilityPyramidCourse extends AgilityCourse {
Direction d = Direction.getLogicalDirection(player.getLocation(), getLedgeLocation(player, object));
final Direction dir = d;
final int diff = object.getRotation() == 3 && dir == Direction.EAST ? 1 : object.getRotation() == 3 && dir == Direction.WEST ? 0 : d == Direction.EAST || (d == Direction.SOUTH && object.getRotation() != 0) || d == Direction.NORTH ? 0 : 1;
final boolean fail = hasFailed(player);
final boolean fail = player.getSkills().getLevel(Skills.AGILITY) >= 75 ? false : hasFailed(player) ;
player.getSkills().getLevel(Skills.AGILITY);
final Location end = player.getLocation().transform(dir.getStepX() * (fail ? 3 : 5), dir.getStepY() * (fail ? 3 : 5), 0);
player.getPacketDispatch().sendMessage("You put your foot on the ledge and try to edge across...");
if (fail) {
@ -286,7 +287,7 @@ public final class AgilityPyramidCourse extends AgilityCourse {
private void handlePlank(final Player player, final GameObject object) {
final boolean custom = object.getLocation().equals(new Location(3365, 2835, 3)) || object.getLocation().equals(new Location(3370, 2835, 3));
final Direction dir = custom ? Direction.EAST : Direction.getLogicalDirection(player.getLocation(), object.getLocation());
final boolean fail = hasFailed(player);
final boolean fail = player.getSkills().getLevel(Skills.AGILITY) >= 75 ? false : hasFailed(player) ;
final Location end = object.getLocation().transform(object.getId() != 10868 ? dir : dir.getOpposite(), fail ? 2 : 5);
AgilityHandler.walk(player, fail ? -1 : 1, player.getLocation(), end, Animation.create(155), fail ? 0.0 : 56.4, fail ? null : "You walk carefully across the slippery plank...");
if (fail) {
@ -308,7 +309,7 @@ public final class AgilityPyramidCourse extends AgilityCourse {
*/
private void handleJumpGap(Player player, GameObject object) {
final Direction dir = Direction.getDirection(player.getLocation(), getGapLocation(player, object));
final boolean fail = hasFailed(player);
final boolean fail = player.getSkills().getLevel(Skills.AGILITY) >= 75 ? false : hasFailed(player) ;
player.getPacketDispatch().sendMessage("You jump the gap...");
if (fail) {
final boolean regular = object.getRotation() == 0 || object.getRotation() == 3;
@ -336,7 +337,7 @@ public final class AgilityPyramidCourse extends AgilityCourse {
*/
private void handleGapCross(final Player player, final GameObject object) {
final Direction dir = Direction.getLogicalDirection(player.getLocation(), getGapCrossLocation(player, object));
final boolean fail = hasFailed(player);
final boolean fail = player.getSkills().getLevel(Skills.AGILITY) >= 75 ? false : hasFailed(player) ;
final Location end = player.getLocation().transform(dir, fail ? 4 : 5);
final int rot = object.getRotation();
int mod = player.getLocation().equals(new Location(3359, 2849, 2)) ? 0 : player.getLocation().equals(new Location(3357, 2841, 2)) ? 1 : player.getLocation().equals(new Location(3367, 2832, 1)) ? 1 : player.getLocation().equals(new Location(3372, 2832, 1)) ? 0 : object.getLocation().equals(new Location(3370, 2831, 1)) ? 0 : rot == 1 && dir == Direction.EAST ? 0 : rot == 3 && (dir == Direction.WEST || dir == Direction.EAST) ? 1 : rot == 0 && dir == Direction.SOUTH ? 1 : dir == Direction.WEST && rot != 3 || dir == Direction.EAST ? 1 : 0;

View file

@ -165,6 +165,7 @@ public final class DesertZone extends MapZone implements Plugin<Object> {
borders.addException(new ZoneBorders(3147, 3019, 3185, 3059));// Bedabin
borders.addException(new ZoneBorders(3217, 2881, 3248, 2914));// pyramid
borders.addException(new ZoneBorders(3264, 2752, 3323, 2810));// Sophanem
borders.addException(new ZoneBorders(3326,2942,3371,3006)); //Pollnivneach
borders.addException(new ZoneBorders(3007, 4672, 3071, 4735));// agility-pyramid
// top(region12105)
borders.addException(new ZoneBorders(3274, 3014, 3305, 3041));// Mining