Replacement problem...

hunterrravyn

TH.net Regular
Reaction score
19
So what ive done is starting to confuse me....
Basicly it supposed to:
Unit gets item

Unit type = Hero mellee

If Item bieng manipulated is certain item
Add certain ability
Remove Manipulated item

and then replace the unit and give it its wepon

Heres the triggers that are supossed to make it work (thier are seveal weapons)

Abbility gain

Code:
Event-Unit - A unit Acquires an item
Conditons-(Unit-type of (Triggering unit)) Equal to Base Hero Melee
Actions-If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Item being manipulated) Equal to (Item carried by (Triggering unit) of type |cffdc143cPistol|r)
    Then - Actions
        Unit - Add |cffdc143cPistol|r  to (Triggering unit)
        Multiboard - Hide all multiboards
        Multiboard - Show all multiboards
        Item - Remove (Item being manipulated)
    Else - Actions

Unit replacement

Code:
Event-Unit - A unit Acquires an item
Conditon-
Action-If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Item-type of (Item being manipulated)) Equal to |cffdc143cPistol|r
    Then - Actions
        Unit - Replace (Triggering unit) with a Base Hero Pistol using The old unit's relative life and mana
        Trigger - Turn off PistolGain <gen>
        Item - Create |cffdc143cPistol|r at (Position of (Last replaced unit))
        Hero - Give (Last created item) to (Last replaced unit)
        Wait 0.01 seconds
        Trigger - Turn on PistolGain <gen>
    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Item being manipulated)) Equal to |cffdc143cChain Gun|r
            Then - Actions
                Unit - Replace (Triggering unit) with a Base Hero Chaingun using The old unit's relative life and mana
                Trigger - Turn off ChaingunGain <gen>
                Item - Create |cffdc143cChain Gun|r at (Position of (Last replaced unit))
                Hero - Give (Last created item) to (Last replaced unit)
                Wait 0.01 seconds
                Item - Create |cffdc143cPistol|r at (Position of (Triggering unit))
                Trigger - Turn on ChaingunGain <gen>
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Item being manipulated)) Equal to |cffdc143cShotgun|r
                    Then - Actions
                        Unit - Replace (Triggering unit) with a Base Hero Shotgun using The old unit's relative life and mana
                        Trigger - Turn off ShotgunGain <gen>
                        Item - Create |cffdc143cShotgun|r at (Position of (Last replaced unit))
                        Hero - Give (Last created item) to (Last replaced unit)
                        Wait 0.01 seconds
                        Unit - Remove |cffdc143cChaingun|r  from (Triggering unit)
                        Item - Create |cffdc143cPistol|r at (Position of (Triggering unit))
                        Trigger - Turn on ShotgunGain <gen>
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Item-type of (Item being manipulated)) Equal to |cffdc143cSniper Rifle|r
                            Then - Actions
                                Unit - Replace (Triggering unit) with a Base Hero Sniper using The old unit's relative life and mana
                                Trigger - Turn off SniperGain <gen>
                                Item - Create |cffdc143cSniper Rifle|r at (Position of (Last replaced unit))
                                Hero - Give (Last created item) to (Last replaced unit)
                                Wait 0.01 seconds
                                Unit - Remove |cffdc143cShotgun|r  from (Triggering unit)
                                Unit - Remove |cffdc143cChaingun|r  from (Triggering unit)
                                Item - Create |cffdc143cPistol|r at (Position of (Triggering unit))
                                Trigger - Turn on SniperGain <gen>
                            Else - Actions
                                Do nothing


If anyone can either solve my problem or make it more effient it would be very helpful.
 

Vassilev

New Member
Reaction score
39
(Item-type of (Item being manipulated)) Equal to |cffdc143cChain Gun|r

Why dont you use this as your condition in the first trigger? instead of:

(Item being manipulated) Equal to (Item carried by (Triggering unit) of type |cffdc143cPistol|r)
 
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