Does one have a working script for all classes?
AION Patch 5.0+ Pots
for example: Sorcerer?
thanks :3
Potion Script 4 all Classes
-
- Posts: 75
- Joined: Wed Jan 18, 2017 12:27 pm
- Has thanked: 10 times
- Been thanked: 13 times
Re: Potion Script 4 all Classes
As far as i remember someone posted a code sample some time ago.
I tweaked it for my needs:
just paste it to the start of your class script and in the attack function execute it through
You will have to change the potion names.
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
Code: Select all
self:CheckPotion();
Re: Potion Script 4 all Classes
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
Who is online
Users browsing this forum: No registered users and 1 guest