Added quest start, complete, and turnin events, and a faction points event to scripted player events.

This commit is contained in:
luisc committed 2022-01-12 20:12:16 -06:00
1 parent 8919a182c5
commit b024f800ae
9 files changed
+152 -20

No files matched your search

@@ -4,6 +4,7 @@ import java.util.Vector;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import noppes.npcs.EventHooks;
import noppes.npcs.Server;
import noppes.npcs.constants.EnumPacketClient;
import noppes.npcs.constants.EnumQuestRepeat;
@@ -30,6 +31,10 @@ public class PlayerQuestController {
public static void addActiveQuest(Quest quest, EntityPlayer player) {
PlayerQuestData data = PlayerDataController.instance.getPlayerData(player).questData;
if(canQuestBeAccepted(quest, player)){
if (EventHooks.onQuestStarted(player, quest)) {
return;
}
data.activeQuests.put(quest.id,new QuestData(quest));
Server.sendData((EntityPlayerMP)player, EnumPacketClient.MESSAGE, "quest.newquest", quest.title);
Server.sendData((EntityPlayerMP)player, EnumPacketClient.CHAT, "quest.newquest", ": ", quest.title);