FIx some item cooldown stuff

main
4n0n 2 years ago
parent dcfb50374d
commit 5363858a0d
  1. 9
      scripts/outlaw.lua
  2. 4
      src/APL/APL.lua
  3. 12
      src/Item/Item.lua
  4. 2
      src/_bastion.lua

@ -39,6 +39,7 @@ local InstantPoison = Bastion.SpellBook:GetSpell(315584)
local AtrophicPosion = Bastion.SpellBook:GetSpell(381637)
local IrideusFragment = Bastion.ItemBook:GetItem(193743)
local Healthstone = Bastion.ItemBook:GetItem(5512)
local PurgeTarget = Bastion.UnitManager:CreateCustomUnit('purge', function(unit)
local purge = nil
@ -158,6 +159,14 @@ SpecialAPL:AddSpell(
end):SetTarget(Player)
)
-- SpecialAPL:AddSpell(
-- Healthstone:UsableIf(function(self)
-- return self:IsKnownAndUsable() and
-- not Player:IsCastingOrChanneling() and
-- Player:GetHealthPercent() < 40
-- end):SetTarget(Player)
-- )
SpecialAPL:AddItem(
IrideusFragment:UsableIf(function(self)
return self:IsEquippedAndUsable() and

@ -72,12 +72,12 @@ function APL:Execute()
if actor.item then
if actor.condition then
-- print("Bastion: APL:Execute: Condition for spell " .. actor.spell:GetName())
actor.item:UsableIf(actor.usableFunc):Cast(actor.target,
actor.item:UsableIf(actor.usableFunc):Use(actor.target,
actor.condition)
end
-- print("Bastion: APL:Execute: No condition for spell " .. actor.spell:GetName())
actor.item:UsableIf(actor.usableFunc):Cast(actor.target)
actor.item:UsableIf(actor.usableFunc):Use(actor.target)
end
if actor.action then
-- print("Bastion: APL:Execute: Executing action " .. actor.action)

@ -134,7 +134,8 @@ end
-- Check if the Item is Usable
function Item:IsEquippedAndUsable()
return (self:IsEquippable() and self:IsEquipped()) or (not self:IsEquippable() and self:IsUsable())
return ((self:IsEquippable() and self:IsEquipped()) or
(not self:IsEquippable() and self:IsUsable())) and not self:IsOnCooldown()
end
-- Is equippable
@ -336,8 +337,13 @@ function Item:IsDiseaseDispel()
})[self:GetID()]
end
function Item:IsItem(Item)
return self:GetID() == Item:GetID()
function Item:IsItem(item)
return self:GetID() == item:GetID()
end
function Item:GetSpell()
local name, spellID = GetItemSpell(self:GetID())
return Bastion.SpellBook:GetSpell(spellID)
end
return Item

@ -28,8 +28,8 @@ Bastion.Module = Bastion.require("Module")
Bastion.UnitManager = Bastion.require("UnitManager"):New()
Bastion.EventManager = Bastion.require("EventManager"):New()
Bastion.Spell = Bastion.require("Spell")
Bastion.Item = Bastion.require("Item")
Bastion.SpellBook = Bastion.require("SpellBook"):New()
Bastion.Item = Bastion.require("Item")
Bastion.ItemBook = Bastion.require("ItemBook"):New()
Bastion.AuraTable = Bastion.require("AuraTable")
Bastion.Class = Bastion.require("Class")

Loading…
Cancel
Save