Thank you so much for the help. i am still very new to this area. i tried having my lock to use grand spellstone but it doesn't "Left click" the spellstone to the weapon.
i just based this on the snipets for rogue also.
private void EnchantWeapon()
{
bool hasMainHandEnchant = Lua.LuaDoString<bool>
(@"local hasMainHandEnchant, _, _, _, _, _, _, _, _ = GetWeaponEnchantInfo()
if (hasMainHandEnchant) then
return '1'
else
return '0'
end");
if (!hasMainHandEnchant)
{
IEnumerable<uint> MP = InstantPoisonDictionary
.Where(i => i.Key <= ObjectManager.Me.Level && ItemsManager.HasItemById(i.Value))
.OrderByDescending(i => i.Key)
.Select(i => i.Value);
if (MP.Any())
{
MHPoison = MP.First();
ItemsManager.UseItem(MHPoison);
Thread.Sleep(10);
Lua.LuaDoString("/click PickupInventoryItem(16)");
Thread.Sleep(5000);
return;
}
}
}
private static Dictionary<int, uint> InstantPoisonDictionary = new Dictionary<int, uint>
{
{ 79, 41196 },
};
may i ask please how to check if the required item is available in the bag before casting the spell especially needed for casting buffs.
Thank you @Talamin