• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Full Inventory Issues

Status
Not open for further replies.
Level 7
Joined
Dec 30, 2008
Messages
72
Hi,

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.
 
Status
Not open for further replies.
Top