Hi,
Writing this trigger in Jass (Not vJass)
Currently it does not pick up an item if the inventory is full... And I need it to.
It's a key part of this map so if anyone could offer me assistance on this issue I would be most grateful.
Writing this trigger in Jass (Not vJass)
JASS:
function Trig_Item_Control_Caelia_Actions takes nothing returns nothing
local integer x = 0
local integer itemCount = 0
local item PickedUp = GetManipulatedItem()
local item Match
local unit Caster = GetManipulatingUnit()
local integer TextLife = 3
local integer TextFade = 2
local integer TextSize = 10
local integer Speed = 50
local integer Direction = 90
//Check for second item
loop
exitwhen x > 6
if ( GetItemType(UnitItemInSlot(Caster, x-1)) == GetItemType(PickedUp) ) then
set itemCount = ( itemCount + 1 )
if (not(UnitItemInSlot(Caster, x-1) == PickedUp)) then
set Match = UnitItemInSlot(Caster, x-1)
endif
endif
set x = x + 1
endloop
//Drop old item and display normal text
if ( itemCount > 1 ) then
call UnitRemoveItem( Caster, Match )
call UnitRemoveItem( Caster, PickedUp )
call UnitAddItem( Caster, PickedUp)
if (GetItemType(GetManipulatedItem()) == ITEM_TYPE_CAMPAIGN) then
call create_floating_text_Caelia (Caster, 100, 100, 100, "New Armour!", TextSize, TextLife, TextFade, true, Speed, Direction)
elseif (GetItemType(GetManipulatedItem()) == ITEM_TYPE_PERMANENT) then
call create_floating_text_Caelia (Caster, 100, 100, 100, "Another Item!", TextSize, TextLife, TextFade, true, Speed, Direction)
endif
endif
if (GetItemType(GetManipulatedItem()) == ITEM_TYPE_ARTIFACT) then
call create_floating_text_Caelia (Caster, 100, 100, 100, "I need no such thing!", TextSize, TextLife, TextFade, true, Speed, Direction)
call UnitRemoveItem( Caster, PickedUp )
endif
if (GetItemType(GetManipulatedItem()) == ITEM_TYPE_PURCHASABLE) then
call create_floating_text_Caelia (Caster, 100, 100, 100, "I need no such thing!", TextSize, TextLife, TextFade, true, Speed, Direction)
call UnitRemoveItem( Caster, PickedUp )
endif
endfunction
Currently it does not pick up an item if the inventory is full... And I need it to.
It's a key part of this map so if anyone could offer me assistance on this issue I would be most grateful.