- Joined
- Feb 24, 2007
- Messages
- 23
Hello guys,
I'm using this Inventory System and I was wondering if it would be possible to open the Equipment Windows by casting an Ability. The only problem is that I'm not an expert in vJass, so I could need some help.
I found two parts in the script that might be relevant to my problem:
I thought that it might be necessary to add another condition, something like .Cast maybe? (But I'm not sure).
To open the Inventory when the right ability is cast, I copied and modified the useItem-Code:
So how can I include this code in the system or is the code even right?
I'm using this Inventory System and I was wondering if it would be possible to open the Equipment Windows by casting an Ability. The only problem is that I'm not an expert in vJass, so I could need some help.
I found two parts in the script that might be relevant to my problem:
JASS:
private static method onInit takes nothing returns nothing
call TriggerAddCondition(.Use, Condition(function Inventory.useItem))
call TriggerAddCondition(.Pickup, Condition(function Inventory.pickupItem))
I thought that it might be necessary to add another condition, something like .Cast maybe? (But I'm not sure).
To open the Inventory when the right ability is cast, I copied and modified the useItem-Code:
JASS:
private static method castAbility takes nothing returns boolean
local Inventory this = .table[GetTriggerUnit()]
if (GetSpellAbilityId() == 'MyAbility') then
return .openInventory(GetTriggerUnit())
endif
return false
endmethod
So how can I include this code in the system or is the code even right?