mirror of
https://github.com/moparisthebest/MoparClassic
synced 2024-11-16 06:05:06 -05:00
32 lines
723 B
Java
32 lines
723 B
Java
package msc.gs.event;
|
|
|
|
import msc.gs.model.ChatMessage;
|
|
import msc.gs.model.Npc;
|
|
import msc.gs.model.Player;
|
|
|
|
public abstract class DelayedQuestChat extends DelayedEvent {
|
|
public int curIndex;
|
|
public String[] messages;
|
|
public Npc npc;
|
|
public Player owner;
|
|
|
|
public DelayedQuestChat(Npc npc, Player owner, String[] messages) {
|
|
super(null, 2200);
|
|
this.owner = owner;
|
|
this.npc = npc;
|
|
this.messages = messages;
|
|
curIndex = 0;
|
|
}
|
|
|
|
public abstract void finished();
|
|
|
|
public void run() {
|
|
owner.informOfNpcMessage(new ChatMessage(npc, messages[curIndex], owner));
|
|
curIndex++;
|
|
if (curIndex == messages.length) {
|
|
finished();
|
|
stop();
|
|
return;
|
|
}
|
|
}
|
|
} |