Potion Script 4 all Classes

Post Reply
User avatar
LordSnack
Posts: 96
Joined: Tue Jun 13, 2017 10:44 pm
Has thanked: 26 times
Been thanked: 10 times

Potion Script 4 all Classes

Post by LordSnack » Thu Jul 13, 2017 11:11 am

Does one have a working script for all classes?
AION Patch 5.0+ Pots
for example: Sorcerer?


thanks :3
EU Thor - Gameforge | NA - Danaria

unkn0wnus3r
Posts: 75
Joined: Wed Jan 18, 2017 12:27 pm
Has thanked: 10 times
Been thanked: 13 times

Re: Potion Script 4 all Classes

Post by unkn0wnus3r » Thu Jul 13, 2017 12:27 pm

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.

User avatar
LordSnack
Posts: 96
Joined: Tue Jun 13, 2017 10:44 pm
Has thanked: 26 times
Been thanked: 10 times

Re: Potion Script 4 all Classes

Post by LordSnack » Thu Jul 13, 2017 12:50 pm

thanks man :3
EU Thor - Gameforge | NA - Danaria

Quench
Posts: 1
Joined: Thu Jul 27, 2017 4:11 pm

Re: Potion Script 4 all Classes

Post by Quench » Thu Jul 27, 2017 10:09 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest