Page 1 of 1

Open Items - for the few event ones you can't auto open!

Posted: Thu Feb 02, 2017 3:19 am
by 0x00

Code: Select all

--
-- Open Event Item
-- Author:  0x00 <0x00.ninja@gmail.com>
--
-- FOR USE ONLY WITH AIONSCRIPT 2.0 from Nyerk.xyz

-- Purpose:
--     Open all those [RANDOM ITEM NAME] event items

-- change this to the event item
inventory_item_name = "Kuporinerk's box containing Ceranium Medal Fragments";
-- change this to the cool down, in seconds
inventory_item_cool_down = 4;

timer = 0;

function OnLoad()
  Write("Open Event Item - by 0x00");
end

function OnRun()
    if timer >= Time() then
		return true;
	end
	local Inventory = InventoryList[inventory_item_name];
	if Inventory ~= nil then
		if Inventory:GetCooldown() == 0 then
			PlayerInput:Inventory( Inventory:GetName());
			timer = Time() + (1000 * inventory_item_cool_down) + 50; -- add "cast time" of ~1s
			return true;
		end
	end
end