mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-28 13:45:32 +01:00
Events can have more than one mob, fixes #38
This commit is contained in:
parent
f95bff322e
commit
ae154427af
@ -1568,20 +1568,18 @@ public class EventFactory implements ConversationAbandonedListener {
|
|||||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetMobAmountsFirst"));
|
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetMobAmountsFirst"));
|
||||||
return new QuestMobPrompt(mobIndex, questMob);
|
return new QuestMobPrompt(mobIndex, questMob);
|
||||||
}
|
}
|
||||||
if (context.getSessionData(CK.E_MOB_TYPES) == null) {
|
if (context.getSessionData(CK.E_MOB_TYPES) == null || ((LinkedList<String>) context.getSessionData(CK.E_MOB_TYPES)).isEmpty()) {
|
||||||
LinkedList<String> list = new LinkedList<String>();
|
|
||||||
list.add(questMob.serialize());
|
|
||||||
context.setSessionData(CK.E_MOB_TYPES, list);
|
|
||||||
} else {
|
|
||||||
if (((LinkedList<String>) context.getSessionData(CK.E_MOB_TYPES)).isEmpty()) {
|
|
||||||
LinkedList<String> list = new LinkedList<String>();
|
LinkedList<String> list = new LinkedList<String>();
|
||||||
list.add(questMob.serialize());
|
list.add(questMob.serialize());
|
||||||
context.setSessionData(CK.E_MOB_TYPES, list);
|
context.setSessionData(CK.E_MOB_TYPES, list);
|
||||||
} else {
|
} else {
|
||||||
LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.E_MOB_TYPES);
|
LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.E_MOB_TYPES);
|
||||||
|
if (mobIndex < list.size()) {
|
||||||
list.set(mobIndex, questMob.serialize());
|
list.set(mobIndex, questMob.serialize());
|
||||||
context.setSessionData(CK.E_MOB_TYPES, list);
|
} else {
|
||||||
|
list.add(questMob.serialize());
|
||||||
}
|
}
|
||||||
|
context.setSessionData(CK.E_MOB_TYPES, list);
|
||||||
}
|
}
|
||||||
return new MobPrompt();
|
return new MobPrompt();
|
||||||
} else if (input.equalsIgnoreCase("16")) {
|
} else if (input.equalsIgnoreCase("16")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user