Help with item owner system!

nnieheayp

Member
Reaction score
2
I need item owner system same as DotA style. There has one player's item can't use other player (showing disable icon at not-owner player).How can i make that ? Please help me :confused:
 

jackall

You can change this now in User CP.
Reaction score
37
make a trigger that detects when a unit aquires an item and sets its custom value to the players' number if the item is not owned

something like this i guess

Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set players = (All players)
      • Player Group - Pick every player in players and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Item being manipulated)) Equal to 100
            • Then - Actions
              • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Item being manipulated)) Equal to (Player number of (Owner of (Triggering unit)))
                • Then - Actions
                  • Do nothing
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Custom value of (Item being manipulated)) Not equal to (Player number of (Owner of (Triggering unit)))
                    • Then - Actions
                      • Hero - Drop (Item being manipulated) from (Triggering unit)
                      • Item - Remove (Last dropped item)
                      • Hero - Create DISitemtype and give it to (Triggering unit)
                    • Else - Actions
      • Custom script: call DestroyForce(udg_players)

Note 1: if your map contains shareable items you have to change it
Note 2: i used 100 custom value in the first if/then/else because there is no player with that number
Note 3: players is a force(player group) variable, DISitemtype is a item type variable(you should use it with array so that it affects all items)
 

FarAwaY

TH.net Regular
Reaction score
9
>Set Players = All Players

This is unnecessary. 'All players' do not leak.

># Hero - Drop (Item being manipulated) from (Triggering unit)
# Item - Remove (Last dropped item)

Is that necessary? Simply do Remove item Being manipulated.

Other than that, it should probably work, although I dislike the method of using "(Custom value of (Item being manipulated)) Equal to 100"...
 

jackall

You can change this now in User CP.
Reaction score
37
well, i used 100 just as an example you can use any number as long as its not within the player number range(1-12 or something like that)

and i guess you could just use remove item being manipulated
 

Komaqtion

You can change this now in User CP.
Reaction score
469
>Set Players = All Players

This is unnecessary. 'All players' do not leak.

This is Map-Destroying!!
As if you destroy "All players" at one time in-game, it's unusable for the rest of it...
 

FarAwaY

TH.net Regular
Reaction score
9
>This is Map-Destroying!!
As if you destroy "All players" at one time in-game, it's unusable for the rest of it...

Erm...simply remove creating the variable AND remove the Custom script that destroys the leak. Since you're removing the variable you no longer need to destroy the leak anyways.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top