Upload from upload_mods.ps1
This commit is contained in:
40
Scripts/Dialog/DialogActionGiveQuestRebirth.cs
Normal file
40
Scripts/Dialog/DialogActionGiveQuestRebirth.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
public class DialogActionGiveQuestRebirth : DialogActionAddBuff
|
||||
{
|
||||
public override void PerformAction(EntityPlayer player)
|
||||
{
|
||||
//Log.Out("GiveQuestRebirth-PerformAction START");
|
||||
Quest newQuest = QuestClass.CreateQuest(ID);
|
||||
if (newQuest == null)
|
||||
return;
|
||||
|
||||
if (newQuest != null)
|
||||
{
|
||||
//Log.Out("GiveQuestRebirth-PerformAction 1");
|
||||
QuestClass questClass = newQuest.QuestClass;
|
||||
if (questClass != null)
|
||||
{
|
||||
//Log.Out("GiveQuestRebirth-PerformAction 2");
|
||||
|
||||
for (int i = 0; i < player.QuestJournal.quests.Count; i++)
|
||||
{
|
||||
//Log.Out("QUEST ID: " + player.QuestJournal.quests[i].ID);
|
||||
//Log.Out("QUEST STATE: " + player.QuestJournal.quests[i].CurrentState);
|
||||
if (player.QuestJournal.quests[i].CurrentState == Quest.QuestState.InProgress)
|
||||
{
|
||||
if (player.QuestJournal.quests[i].ID.ToLower() == ID.ToLower())
|
||||
{
|
||||
GameManager.ShowTooltip((EntityPlayerLocal)player, Localization.Get("questunavailable"));
|
||||
//Log.Out("YOU ALREADY HAVE THIS QUEST");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Log.Out("GiveQuestRebirth-PerformAction 3");
|
||||
player.QuestJournal.AddQuest(newQuest);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//Log.Out("GiveQuestRebirth-PerformAction END");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user