Dark Cellar (Sakaroth) Quest:
using System;
using System.Collections.Generic;
using System.Linq;
using D3;
using QB.Base;
namespace QB.Quests
{
internal class OldRuins
{
private static int _difficulty;
private static int _frameCount;
private static int _step;
private static readonly List<Action> _actionList = new List<Action>();
// Displays difficulty and quest, initializes creation of action list, starts on tick events
public static void Load(int i = 0)
{
_difficulty = i;
if (_difficulty == 3)
Game.Print("Inferno SNOQuestId.Blacksmith loaded");
else if (_difficulty == 2)
Game.Print("Hell SNOQuestId.Blacksmith loaded");
else if (_difficulty == 1)
Game.Print("Nightmare SNOQuestId.Blacksmith loaded");
else
{
Game.Print("Normal SNOQuestId.Blacksmith loaded");
_difficulty = 0;
}
CreateActionList();
Game.OnTickEvent += Game_OnTickEvent;
}
private static void CreateActionList()
{
// If in game, leave game
_actionList.Add(() =>
{
if (Game.Ingame)
MouseInterface.Click(UiElementHash.LeaveGame);
else
{
Combat.ResetBuffs();
_step++;
}
});
// If out of game, continue
_actionList.Add(() =>
{
if (!Game.Ingame)
_step++;
});
// Sets difficulty, SNOQuestId, and step http://d3advanced.com/wiki/index.php?title=Quests
_actionList.Add(() =>
{
Game.SetQuest(_difficulty, SNOQuestId.Blacksmith, 0);
_step++;
});
// Starts Game
_actionList.Add(() =>
{
MouseInterface.Click(UiElementHash.StartResumeGame);
_step++;
});
// If in game, continue
_actionList.Add(() =>
{
if (Game.Ingame)
_step++;
});
// Move to Deckard Cain
_actionList.Add(() =>
{
//if (Navigation.GetDistance("Waypoint") > 10f)
Navigation.MoveTo("Waypoint");
//else
_step++;
});
_actionList.Add(() =>
{
if (Navigation.GetDistance("Waypoint") < 2f)
{
UnitCollection.Interact("Waypoint");
_step++;
}
});
_actionList.Add(() =>
{
UIElement element = UIElement.Get().Where(u => u.Name.Contains("stackpanel.entry 1.wrapper.button")).FirstOrDefault();
if (element != default(UIElement))
{
element.Click();
_step++;
}
else
{
Game.Print("Teleport not possibru sry");
_step = 6;
return;
}
});
_actionList.Add(() =>
{
if (Navigation.GetDistance(2003f, 2764f) > 10f)
Navigation.MoveTo(2003f, 2764f);
else
_step++;
});
_actionList.Add(() =>
{
if (Navigation.GetDistance(2001f, 2701f) > 10f)
Navigation.MoveTo(2001f, 2701f);
else
_step++;
});
_actionList.Add(() =>
{
if (Navigation.GetDistance(1997f, 2670f) > 10f)
Navigation.MoveTo(1997f, 2670f);
else
_step++;
});
_actionList.Add(() =>
{
if (Navigation.GetDistance(1990f, 2609f) > 10f)
Navigation.MoveTo(1990f, 2609f);
else
_step++;
});
_actionList.Add(() =>
{
if (Navigation.GetDistance(2015f, 2577f) > 10f)
Navigation.MoveTo(2015f, 2577f);
else
_step++;
});
_actionList.Add(() =>
{
if (Navigation.GetDistance(2057f, 2531f) > 10f)
Navigation.MoveTo(2057f, 2531f);
else
_step++;
});
_actionList.Add(() =>
{
if (UnitCollection.Exists("Dank Cellar"))
{
_step++;
}
else
_step = 0;
});
_actionList.Add(() =>
{
if (Navigation.GetDistance(2087f, 2495f) > 10f)
Navigation.MoveTo(2087f, 2495f);
else
_step++;
});
_actionList.Add(() =>
{
if (Navigation.GetDistance(2066f, 2476f) > 10f)
Navigation.MoveTo(2066f, 2476f);
else
_step++;
});
_actionList.Add(() =>
{
if (UnitCollection.Exists("Dank Cellar"))
{
UnitCollection.Interact("Dank Cellar");
_step++;
}
else
_step = 0;
});
_actionList.Add(() =>
{
if (Navigation.GetDistance(122f, 151f) > 10f)
Navigation.MoveTo(122f, 151f);
else
_step++;
});
_actionList.Add(() =>
{
if (UnitCollection.Exists("Sarkoth"))
{
if (UnitCollection.Exists("Quill Fiend"))
Combat.Attack("Quill Fiend");
else
{
if (Navigation.GetDistance("Sarkoth") > 10f)
Navigation.MoveTo("Sarkoth");
Combat.Attack("Sarkoth");
}
}
else
_step++;
});
// Loot
_actionList.Add(() =>
{
if (Loot.Exists())
Loot.Get();
else
_step++;
});
// Go to town
_actionList.Add(() =>
{
if ((!Me.InTown) && (Me.Mode != UnitMode.Casting || Me.Mode != UnitMode.Warping))
Me.UsePower(SNOPowerId.UseStoneOfRecall);
else
_step = 0;
});
}
private static void Game_OnTickEvent(EventArgs e)
{
if (++_frameCount%20 != 0)
return;
#if DEBUG
Game.Print("_step = " + _step);
#endif
// Check if dead
if (Game.Ingame && Me.Life <= 0f && Me.Mode == UnitMode.Dead)
{
MouseInterface.Click(UiElementHash.Revive);
_step = 0;
}
// Invoke action
if (_actionList.Any())
_actionList[_step].Invoke();
}
}
}
I just removed some comments and didn't test it since then. if it's not working just say it

ps: didn't test death. not sure if it is working
edit://
I will be adding a few more in the future