help with my map

refl3ction

New Member
how do i make a trigger that prevents a hero from holding 3 weapons the max that he can hold is 2, so that he has to drop one before he can pick up another one :confused:

also wondering how do you create a maximum on attributes? bcuz in my doom3 rpg the item "security armor" increases agility (which increases armor) but i want the agility to cap at 125
 
Werbung:

Abelhawk

New Member
Yeah that should work, item types.

As for the agility cap, try the Constants section. It has caps and limits for lots of stuff, including things like hero level.
 

maTt540

New Member
Theres an Rpg I like to play on wc3 called wars of warcraft rpg with triggers like this. I have a version, should I post the JASS trigger in the map here?

What the heck, I guess I will!

This was for weapons, where the person used artifacts in 1 catagory.

Code:
function Trig_pickupweapon_Conditions takes nothing returns boolean
????if ( not ( GetItemType(GetManipulatedItem()) == ITEM_TYPE_ARTIFACT ) ) then
????????return false
????endif
????return true
endfunction

function Trig_pickupweapon_Func002Func002C takes nothing returns boolean
????if ( not ( GetItemType(GetManipulatedItem()) == ITEM_TYPE_ARTIFACT ) ) then
????????return false
????endif
????if ( not ( udg_WeaponHand[GetConvertedPlayerId(GetOwningPlayer(GetManipulatingUnit()))] == true ) ) then
????????return false
????endif
????return true
endfunction

function Trig_pickupweapon_Func002C takes nothing returns boolean
????if ( not ( GetItemType(GetManipulatedItem()) == ITEM_TYPE_ARTIFACT ) ) then
????????return false
????endif
????if ( not ( udg_WeaponHand[GetConvertedPlayerId(GetOwningPlayer(GetManipulatingUnit()))] == false ) ) then
????????return false
????endif
????return true
endfunction

function Trig_pickupweapon_Actions takes nothing returns nothing
????if ( Trig_pickupweapon_Func002C() ) then
????????set udg_WeaponHand[GetConvertedPlayerId(GetOwningPlayer(GetManipulatingUnit()))] = true
????else
????????if ( Trig_pickupweapon_Func002Func002C() ) then
????????????call DisableTrigger( gg_trg_DropWeapon )
????????????call SetItemPositionLoc( GetManipulatedItem(), GetItemLoc(GetManipulatedItem()) )
????????????call EnableTrigger( gg_trg_DropWeapon )
????????else
????????endif
????endif
endfunction

//===========================================================================
function InitTrig_pickupweapon takes nothing returns nothing
????set gg_trg_pickupweapon = CreateTrigger(??)
????call TriggerRegisterAnyUnitEventBJ( gg_trg_pickupweapon, EVENT_PLAYER_UNIT_PICKUP_ITEM )
????call TriggerAddCondition( gg_trg_pickupweapon, Condition( function Trig_pickupweapon_Conditions ) )
????call TriggerAddAction( gg_trg_pickupweapon, function Trig_pickupweapon_Actions )
endfunction
 
Werbung:

Undead_Lives

New Member
A MUCH easier way (in my opinion) is to use GUI...
Events
Code:
A Unit Aquires an Item
Conditions
Item type Equal to Tome of Experience
Actions
Set ItemInteger to (Item Integer + 1)

next trigger..
Code:
Events
A Unit Aquires an Item
Conditions
Item type Equal to Tome of Experience
Actions
If ItemInteger Equal to 2 Then Drop (Item being manipulated) from (Triggering unit) Else Do Nothing
 
Top