Page 1 of 1

Potion Script 4 all Classes

Posted: Thu Jul 13, 2017 11:11 am
by LordSnack
Does one have a working script for all classes?
AION Patch 5.0+ Pots
for example: Sorcerer?


thanks :3

Re: Potion Script 4 all Classes

Posted: Thu Jul 13, 2017 12:27 pm
by unkn0wnus3r
As far as i remember someone posted a code sample some time ago.
I tweaked it for my needs:

Code: Select all

function CheckPotion()
	        -- Retrieve the  potion item.
        	local PotionLife = InventoryList:GetInventory( "Enhanced Recovery Serum" );
		local PotionMana = InventoryList:GetInventory( "[Jakunerk] Mana Serum" );
		
		
		 -- Check if Currenthealth < 0.5 and uses a Life Potion.
        if Player:GetHealthCurrent() < Player:GetHealthMaximum() / 2 and PotionLife ~= nil and PotionLife:GetCooldown() == 0 then
           PlayerInput:Inventory( PotionLife:GetName());
           return false;
		end

		  -- Check if CurrentMana < 0.5 and uses a Mana Potion.
        if Player:GetManaCurrent() < Player:GetManaMaximum() / 2 and PotionMana ~= nil and PotionMana:GetCooldown() == 0 then
           PlayerInput:Inventory( PotionMana:GetName());
           return false;
		end
end
just paste it to the start of your class script and in the attack function execute it through

Code: Select all

self:CheckPotion();
You will have to change the potion names.

Re: Potion Script 4 all Classes

Posted: Thu Jul 13, 2017 12:50 pm
by LordSnack
thanks man :3

Re: Potion Script 4 all Classes

Posted: Thu Jul 27, 2017 10:09 pm
by Quench
why not just modify HelperFunction.lua like this ?

Code: Select all

-- Check if this is a life potion
			if string.find( Inventory:GetName(), "Design" ) == nil and ( string.find( Inventory:GetName(), "Recovery Potion" ) ~= nil or string.find( Inventory:GetName(), "Recovery Potion" ) ~= nil ) then
				
				if string.find( Inventory:GetName(), "Fortified" ) ~= nil then
					if TotalRecharge >= 2480 and BestRecharge < 2480 then
						BestInventory = Inventory;
						BestRecharge = 2480;
					end
				elseif string.find( Inventory:GetName(), "Enhanced" ) ~= nil then
					if TotalRecharge >= 1540 and BestRecharge < 1540 then
						BestInventory = Inventory;
						BestRecharge = 1540;
					end