mirror of
https://github.com/PikaMug/Quests.git
synced 2024-09-29 15:37:27 +02:00
*Multiple lines of text.
*add extra text to description and finish text.
This commit is contained in:
parent
cfb567f59c
commit
83bdc7b458
@ -107,7 +107,11 @@ public class NpcListener implements Listener {
|
||||
quester.questToTake = q.name;
|
||||
|
||||
String s = extracted(quester);
|
||||
player.sendMessage(s);
|
||||
|
||||
for (String msg : s.split("<br>")) {
|
||||
player.sendMessage(msg);
|
||||
}
|
||||
|
||||
plugin.conversationFactory.buildConversation((Conversable) player).begin();
|
||||
|
||||
} else if (quester.currentQuest.equals(q) == false) {
|
||||
@ -128,7 +132,9 @@ public class NpcListener implements Listener {
|
||||
quester.questToTake = q.name;
|
||||
String s = extracted(quester);
|
||||
|
||||
player.sendMessage(s);
|
||||
for (String msg : s.split("<br>")) {
|
||||
player.sendMessage(msg);
|
||||
}
|
||||
|
||||
plugin.conversationFactory.buildConversation((Conversable) player).begin();
|
||||
}
|
||||
|
@ -143,7 +143,10 @@ public class PlayerListener implements Listener {
|
||||
+ "\n"
|
||||
+ ChatColor.RESET + plugin.getQuest(quester.questToTake).description + "\n";
|
||||
|
||||
player.sendMessage(s);
|
||||
for (String msg : s.split("<br>")) {
|
||||
player.sendMessage(msg);
|
||||
}
|
||||
|
||||
plugin.conversationFactory.buildConversation((Conversable) player).begin();
|
||||
|
||||
}
|
||||
|
@ -173,7 +173,13 @@ public class Quest {
|
||||
q.reset();
|
||||
q.completedQuests.add(name);
|
||||
String none = ChatColor.GRAY + "- (None)";
|
||||
player.sendMessage(Quests.parseString(finished, q.currentQuest));
|
||||
|
||||
String ps = Quests.parseString(finished, q.currentQuest);
|
||||
|
||||
for (String msg : ps.split("<br>")) {
|
||||
player.sendMessage(msg);
|
||||
}
|
||||
|
||||
if(moneyReward > 0 && Quests.economy != null){
|
||||
Quests.economy.depositPlayer(q.name, moneyReward);
|
||||
none = null;
|
||||
|
@ -611,6 +611,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
|
||||
if (input.equalsIgnoreCase("cancel") == false) {
|
||||
if (input.startsWith("++")) {
|
||||
if (context.getSessionData(CK.Q_ASK_MESSAGE) != null) {
|
||||
context.setSessionData(CK.Q_ASK_MESSAGE, context.getSessionData(CK.Q_ASK_MESSAGE) + " " + input.substring(2));
|
||||
return new CreateMenuPrompt();
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.Q_ASK_MESSAGE, input);
|
||||
}
|
||||
|
||||
@ -632,6 +638,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
|
||||
if (input.equalsIgnoreCase("cancel") == false) {
|
||||
if (input.startsWith("++")) {
|
||||
if (context.getSessionData(CK.Q_FINISH_MESSAGE) != null) {
|
||||
context.setSessionData(CK.Q_FINISH_MESSAGE, context.getSessionData(CK.Q_FINISH_MESSAGE) + " " + input.substring(2));
|
||||
return new CreateMenuPrompt();
|
||||
}
|
||||
}
|
||||
context.setSessionData(CK.Q_FINISH_MESSAGE, input);
|
||||
}
|
||||
|
||||
|
@ -222,8 +222,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
loadEvents();
|
||||
log.log(Level.INFO, "[Quests] " + quests.size() + " Quest(s) loaded.");
|
||||
log.log(Level.INFO, "[Quests] " + events.size() + " Event(s) loaded.");
|
||||
if (snoop) {
|
||||
questers.putAll(getOnlineQuesters());
|
||||
if (snoop) {
|
||||
snoop();
|
||||
}
|
||||
}
|
||||
@ -779,6 +779,11 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
+ RESET + getQuest(quester.questToTake).description + "\n";
|
||||
|
||||
cs.sendMessage(s);
|
||||
|
||||
for (String msg : s.split("<br>")) {
|
||||
cs.sendMessage(msg);
|
||||
}
|
||||
|
||||
conversationFactory.buildConversation((Conversable) cs).begin();
|
||||
|
||||
} else {
|
||||
|
@ -92,7 +92,11 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
|
||||
quester.questToTake = q.name;
|
||||
|
||||
String s = extracted(quester);
|
||||
player.sendMessage(s);
|
||||
|
||||
for (String msg : s.split("<br>")) {
|
||||
player.sendMessage(msg);
|
||||
}
|
||||
|
||||
plugin.conversationFactory.buildConversation((Conversable) player).begin();
|
||||
|
||||
}else{
|
||||
|
Loading…
Reference in New Issue
Block a user