forked from Upstream/mmocore
Added level up trigger for individual levels
This commit is contained in:
parent
3978f765c9
commit
a0f05957f8
@ -22,12 +22,20 @@ public class LevelUpEventTrigger implements EventTriggerHandler {
|
||||
|
||||
if (event.hasProfession())
|
||||
for (String event1 : profess.getEventTriggers())
|
||||
{
|
||||
if (event1.startsWith("level-up-") && event1.substring(9).equalsIgnoreCase(event.getProfession().getId())) {
|
||||
profess.getEventTriggers(event1).getTriggers().forEach(trigger -> trigger.apply(player));
|
||||
break;
|
||||
}
|
||||
|
||||
if (event1.startsWith("level-up-") && event1.substring(9).equalsIgnoreCase(event.getProfession().getId() + "-" + event.getNewLevel())) {
|
||||
profess.getEventTriggers(event1).getTriggers().forEach(trigger -> trigger.apply(player));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!event.hasProfession() && profess.hasEventTriggers("level-up"))
|
||||
profess.getEventTriggers("level-up").getTriggers().forEach(trigger -> trigger.apply(player));
|
||||
if (!event.hasProfession() && profess.hasEventTriggers("level-up-" + event.getNewLevel()))
|
||||
profess.getEventTriggers("level-up-" + event.getNewLevel()).getTriggers().forEach(trigger -> trigger.apply(player));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user