function Trig_Special_Items_Actions takes nothing returns nothing
local force playzor = CreateForce()
local item newitem = GetManipulatedItem()
local integer loopnr = 0
call ForceAddPlayer(playzor, GetOwningPlayer(GetTriggerUnit()))
if ( GetItemType(newitem) == ITEM_TYPE_ARTIFACT ) then
loop
exitwhen loopnr >= 6
if ( GetItemType(UnitItemInSlot(GetTriggerUnit(), loopnr)) == ITEM_TYPE_ARTIFACT ) and (UnitItemInSlot(GetTriggerUnit(), loopnr) != GetManipulatedItem()) then
call QuestMessageBJ( playzor, bj_QUESTMESSAGE_UPDATED, "You are already wielding a Weapon!" )
call UnitRemoveItem( GetTriggerUnit(), newitem )
endif
set loopnr = (loopnr + 1)
endloop
endif
if ( GetItemType(newitem) == ITEM_TYPE_PERMANENT ) then
loop
exitwhen loopnr >= 6
if ( GetItemType(UnitItemInSlot(GetTriggerUnit(), loopnr)) == ITEM_TYPE_PERMANENT ) and (UnitItemInSlot(GetTriggerUnit(), loopnr) != GetManipulatedItem()) then
call QuestMessageBJ( playzor, bj_QUESTMESSAGE_UPDATED, "You are already carrying a Shield!" )
call UnitRemoveItem( GetTriggerUnit(), newitem )
endif
set loopnr = (loopnr + 1)
endloop
endif
if ( GetItemType(newitem) == ITEM_TYPE_CAMPAIGN ) then
loop
exitwhen loopnr >= 6
if ( GetItemType(UnitItemInSlot(GetTriggerUnit(), loopnr)) == ITEM_TYPE_CAMPAIGN ) and (UnitItemInSlot(GetTriggerUnit(), loopnr) != GetManipulatedItem()) then
call QuestMessageBJ( playzor, bj_QUESTMESSAGE_UPDATED, "You are already wearing an Armor!" )
call UnitRemoveItem( GetTriggerUnit(), newitem )
endif
set loopnr = (loopnr + 1)
endloop
endif
call DestroyForce(playzor)
set playzor = null
set newitem = null
endfunction
//===========================================================================
function InitTrig_Special_Items takes nothing returns nothing
local trigger gg_trg_Special_Items = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Special_Items, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( gg_trg_Special_Items, function Trig_Special_Items_Actions )
endfunction
lol..that will not be easy.So, in my ORPG where there will be about 1000 different items per class, i need to make 1000 different variables with 2000 different triggers to hold everything ?
So, in my ORPG where there will be about 1000 different items per class, i need to make 1000 different variables with 2000 different triggers to hold everything ?
Or - Any (Conditions) are true
Conditions
(Item-type of (Item being manipulated)) Equal to Sword of pwnage
(Item-type of (Item being manipulated)) Equal to Sword of a thousand thruths
(Item-type of (Item being manipulated)) Equal to Sword of another sword