MoparClassic/GameServer/src/msc/gs/event/DelayedQuestChat.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;
}
}
}