• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

A bit of complicated. Check inside for details.

Level 17
Joined
Jun 2, 2009
Messages
1,141
Description of my item: When your hero takes damage from enemy heroes, it cannot be used for 3 seconds.

Trigger: I am removing X item and giving the useless Y item to attacked unit for 3 seconds. Then replacing Y with X

Issue: When you die if you have the Y (useless version of X) and when you revive, no more you will get the X item (real one)

  • Dagger Event Takes Damage
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource is A Hero) Equal to True
      • (DamageEventSource is an illusion) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget has an item of type Dagger of Teleportation) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by DamageEventTarget of type Dagger of Teleportation)
          • Hero - Create Disabled Dagger of Teleportation and give it to DamageEventTarget
          • Countdown Timer - Pause Dagger[(Player number of (Owner of DamageEventTarget))]
          • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
          • Set DaggerUnit[(Player number of (Owner of DamageEventTarget))] = (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget has an item of type Disabled Dagger of Teleportation) Equal to True
            • Then - Actions
              • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget has an item of type Windblade |cffffff00(Agility Unique)|r) Equal to True
            • Then - Actions
              • Item - Remove (Item carried by DamageEventTarget of type Windblade |cffffff00(Agility Unique)|r)
              • Hero - Create Disabled Windblade and give it to DamageEventTarget
              • Countdown Timer - Pause Dagger[(Player number of (Owner of DamageEventTarget))]
              • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
              • Set DaggerUnit[(Player number of (Owner of DamageEventTarget))] = (Triggering unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (DamageEventTarget has an item of type Disabled Windblade) Equal to True
                • Then - Actions
                  • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
        • Else - Actions
  • Dagger Event User Revives
    • Events
      • Time - Dagger[2] expires
      • Time - Dagger[3] expires
      • Time - Dagger[4] expires
      • Time - Dagger[5] expires
      • Time - Dagger[6] expires
      • Time - Dagger[8] expires
      • Time - Dagger[9] expires
      • Time - Dagger[10] expires
      • Time - Dagger[11] expires
      • Time - Dagger[12] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_Dagger[bj_forLoopAIndex]) then
          • Set TempIntegerDagger = (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DaggerUnit[TempIntegerDagger] is in Oluler_ug) Equal to False
              • (Life of HeroOyuncu[TempIntegerDagger]) Greater than or equal to 2.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HeroOyuncu[TempInteger] has an item of type Disabled Dagger of Teleportation) Equal to True
                • Then - Actions
                  • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type Disabled Dagger of Teleportation)
                  • Hero - Create Dagger of Teleportation and give it to DaggerUnit[TempIntegerDagger]
                  • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (HeroOyuncu[TempInteger] has an item of type Disabled Windblade) Equal to True
                    • Then - Actions
                      • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type Disabled Windblade)
                      • Hero - Create Windblade |cffffff00(Agility Unique)|r and give it to DaggerUnit[TempIntegerDagger]
                    • Else - Actions
                      • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
            • Else - Actions
          • Custom script: exitwhen true
          • Custom script: endif
This trigger was working before. But i have created another version of the item. And no more it works.
Dagger of Teleportation and Disabled Dagger of Teleportation
Windblade and Disabled Windblade

If you have the Teleportation Dagger or Windblade and if you die when it is disabled, i cannot replace it with real one when the hero revives.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
Are revived heroes removed from Oluler_ug?
Yes. If you really want to make sure about it, here is the trigger. I am sharing the entire trigger just in case.

  • Respawn Check
    • Events
      • Time - RespawnTimer[2] expires
      • Time - RespawnTimer[3] expires
      • Time - RespawnTimer[4] expires
      • Time - RespawnTimer[5] expires
      • Time - RespawnTimer[6] expires
      • Time - RespawnTimer[8] expires
      • Time - RespawnTimer[9] expires
      • Time - RespawnTimer[10] expires
      • Time - RespawnTimer[11] expires
      • Time - RespawnTimer[12] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if GetExpiredTimer() == udg_RespawnTimer[bj_forLoopAIndex] then
          • Custom script: exitwhen true
          • Custom script: endif
      • Custom script: set udg_Boolean = UnitAlive(udg_GOD_Hero[bj_forLoopAIndex])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boolean Equal to True
        • Then - Actions
          • -------- Heronun sahibi buyback atmış, kamerayı heroya çevir ve heroyu seç. --------
          • Set RespawnTime[(Integer A)] = -1.00
          • Selection - Select GOD_Hero[(Integer A)] for (Owner of GOD_Hero[(Integer A)])
          • Unit - Set life of GOD_Hero[(Integer A)] to 100.00%
          • Unit - Set mana of GOD_Hero[(Integer A)] to 100.00%
          • Unit Group - Remove GOD_Hero[(Integer A)] from Oluler_ug
          • Camera - Pan camera for (Owner of GOD_Hero[(Integer A)]) to (Position of GOD_Hero[(Integer A)]) over 0.50 seconds
          • Animation - Change GOD_Hero[(Integer A)] flying height to 0.00 at 0.00
          • Countdown Timer - Pause RespawnTimer[(Integer A)]
          • Multiboard - Set the text for NewTable item in column 3, row Table_PlayerLine[(Integer A)] to <Empty String>
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of GOD_Hero[(Integer A)]) is in LeaverPlayers) Equal to False
            • Then - Actions
              • Game - Display to (All players) the text: (PlayerNames[(Integer A)] + para ödeyerek dogdu!)
            • Else - Actions
        • Else - Actions
          • -------- Hero hala ölü ve respawn zamanının bitmesini bekliyor. --------
          • Set RespawnTime[(Integer A)] = (RespawnTime[(Integer A)] - 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RespawnTime[(Integer A)] Less than or equal to 0.00
            • Then - Actions
              • Multiboard - Set the text for NewTable item in column 3, row Table_PlayerLine[(Integer A)] to <Empty String>
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • mod_sp Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Player((Integer A))) is an ally of ClanDevilPlayer) Equal to True
                    • Then - Actions
                      • Hero - Instantly revive GOD_Hero[(Integer A)] at (Center of LumbersD <gen>), Show revival graphics
                      • Hero - Instantly revive zU_AIHero[(Integer A)] at (Center of LumbersD <gen>), Show revival graphics
                    • Else - Actions
                      • Hero - Instantly revive GOD_Hero[(Integer A)] at (Center of LumbersR <gen>), Show revival graphics
                      • Hero - Instantly revive zU_AIHero[(Integer A)] at (Center of LumbersR <gen>), Show revival graphics
                • Else - Actions
                  • Hero - Instantly revive GOD_Hero[(Integer A)] at ((Owner of GOD_Hero[(Integer A)]) start location), Show revival graphics
              • Selection - Select GOD_Hero[(Integer A)] for (Owner of GOD_Hero[(Integer A)])
              • Camera - Pan camera for (Owner of GOD_Hero[(Integer A)]) to (Position of GOD_Hero[(Integer A)]) over 0.50 seconds
              • Animation - Change GOD_Hero[(Integer A)] flying height to 0.00 at 0.00
              • Unit - Set life of GOD_Hero[(Integer A)] to 100.00%
              • Unit - Set mana of GOD_Hero[(Integer A)] to 100.00%
              • Unit Group - Remove GOD_Hero[(Integer A)] from Oluler_ug
              • Countdown Timer - Pause RespawnTimer[(Integer A)]
            • Else - Actions
              • Multiboard - Set the text for NewTable item in column 3, row Table_PlayerLine[(Integer A)] to (Player_Colors[(Integer A)] + ((String((Integer(RespawnTime[(Integer A)])))) + |r))
 
Level 39
Joined
Feb 27, 2007
Messages
5,019
Why remove the item at all? You should be able to disable its active ability just like you can with unit abilities. You can enable/disable while dead without issues.

Can probably also put a techtree requirement (some unit type) on the item that you create/destroy appropriately to toggle that one item. This would only work for one unit per player, though. Disabling would work for any number of units.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
Why remove the item at all? You should be able to disable its active ability just like you can with unit abilities. You can enable/disable while dead without issues.

Can probably also put a techtree requirement (some unit type) on the item that you create/destroy appropriately to toggle that one item. This would only work for one unit per player, though. Disabling would work for any number of units.
But is it seem disabled as visual? This is the important part. You have to know when it can be active again.
And i have tried that but it didn't worked

Events
Player - Player 1 (Red) skips a cinematic sequence
Actions
Player - Disable Blink (Item Version) for Player 1 (Red)
Wait 3.00 seconds
Player - Enable Blink (Item Version) for Player 1 (Red)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
Why remove the item at all? You should be able to disable its active ability just like you can with unit abilities. You can enable/disable while dead without issues.

Can probably also put a techtree requirement (some unit type) on the item that you create/destroy appropriately to toggle that one item. This would only work for one unit per player, though. Disabling would work for any number of units.
He's on an older version, I don't think he can disable it. Unless Disable Ability For Player would work but then it'll have issues with multiple Heroes per player.

Anyway, is there really much of an issue?

A hero dies -> Pause their disabled Item timers.

A hero revives -> Loop over inventory -> If hero has any of the Disabled items, replace them with Enabled items.

Edit:
@JFAMAP
Also, your Events use Timers [2] to [12] but your For Loop goes from 1 to 12. Either you forgot to add Timers [1] or your For Loop should go from 2 to 12.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,141
He's on an older version, I don't think he can disable it. Unless Disable Ability For Player would work but then it'll have issues with multiple Heroes per player.

Anyway, is there really much of an issue?

A hero dies -> Pause their disabled Item timers.

A hero revives -> Loop over inventory -> If hero has any of the Disabled items, replace them with Enabled items.

Edit:
@JFAMAP
Also, your Events use Timers [2] to [12] but your For Loop goes from 1 to 12. Either you forgot to add Timers [1] or your For Loop should go from 2 to 12.
Player 1 and 7 are Forces. By the way this was working in previous versions. But it was only 1 item, then i have added second item.

This was working.
  • Dagger Event
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (DamageEventSource is A Hero) Equal to True
          • (DamageEventSource is an illusion) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget has an item of type Dagger of Teleportation) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by DamageEventTarget of type Dagger of Teleportation)
          • Hero - Create Disabled Dagger of Teleportation and give it to DamageEventTarget
          • Countdown Timer - Pause Dagger[(Player number of (Owner of DamageEventTarget))]
          • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
          • Set DaggerUnit[(Player number of (Owner of DamageEventTarget))] = (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget has an item of type Disabled Dagger of Teleportation) Equal to True
            • Then - Actions
              • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
            • Else - Actions
  • Dagger Timer Expires Copy
    • Events
      • Time - Dagger[2] expires
      • Time - Dagger[3] expires
      • Time - Dagger[4] expires
      • Time - Dagger[5] expires
      • Time - Dagger[6] expires
      • Time - Dagger[8] expires
      • Time - Dagger[9] expires
      • Time - Dagger[10] expires
      • Time - Dagger[11] expires
      • Time - Dagger[12] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_Dagger[bj_forLoopAIndex]) then
          • Set TempIntegerDagger = (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DaggerUnit[TempIntegerDagger] is in Oluler_ug) Equal to False
              • (Life of HeroOyuncu[TempIntegerDagger]) Greater than or equal to 2.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HeroOyuncu[TempInteger] has an item of type Disabled Dagger of Teleportation) Equal to True
                • Then - Actions
                  • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type Disabled Dagger of Teleportation)
                  • Hero - Create Dagger of Teleportation and give it to DaggerUnit[TempIntegerDagger]
                  • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (HeroOyuncu[TempInteger] has an item of type Disabled Windblade) Equal to True
                    • Then - Actions
                      • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type Disabled Windblade)
                      • Hero - Create Windblade |cffffff00(Agility Unique)|r and give it to DaggerUnit[TempIntegerDagger]
                    • Else - Actions
                      • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
            • Else - Actions
          • Custom script: exitwhen true
          • Custom script: endif
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
Player 1 and 7 are Forces. By the way this was working in previous versions. But it was only 1 item, then i have added second item.
You're enabling the Dagger OR Windblade, not both:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (DaggerUnit[TempIntegerDagger] is in Oluler_ug) Equal to False
      • (Life of HeroOyuncu[TempIntegerDagger]) Greater than or equal to 2.00
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (HeroOyuncu[TempInteger] has an item of type Disabled Dagger of Teleportation) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type Disabled Dagger of Teleportation)
          • Hero - Create Dagger of Teleportation and give it to DaggerUnit[TempIntegerDagger]
          • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (HeroOyuncu[TempInteger] has an item of type Disabled Windblade) Equal to True
            • Then - Actions
              • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type Disabled Windblade)
              • Hero - Create Windblade |cffffff00(Agility Unique)|r and give it to DaggerUnit[TempIntegerDagger]
            • Else - Actions
              • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
    • Else - Actions
You don't want to use Else - Actions here. You want both of these items to get checked and enabled.

Your Dagger Timer Expires trigger should do this:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (DaggerUnit[TempIntegerDagger] is in Oluler_ug) Equal to False
      • (Life of HeroOyuncu[TempIntegerDagger]) Greater than or equal to 2.00
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (HeroOyuncu[TempInteger] has an item of type Disabled Dagger of Teleportation) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type Disabled Dagger of Teleportation)
          • Hero - Create Dagger of Teleportation and give it to DaggerUnit[TempIntegerDagger]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (HeroOyuncu[TempInteger] has an item of type Disabled Windblade) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type Disabled Windblade)
          • Hero - Create Windblade |cffffff00(Agility Unique)|r and give it to DaggerUnit[TempIntegerDagger]
        • Else - Actions
    • Else - Actions
Also, I got rid of the unnecessary Timer starting. Why would you start the timers again?



Also, Greater than or equal to 2.00 life? That's not correct.
  • (Life of HeroOyuncu[TempIntegerDagger]) Greater than or equal to 2.00
A unit is considered Dead when it's Life is Less than ~0.405.

I forget the exact value.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,141
@Uncle I do not know what should i do. Because my trigger includes Jass things and i do not know what these does and it makes finding issue impossible to me. I have copied trigger to test map and now it totally not works. (i do not know what it means
Custom script: if (GetExpiredTimer() == udg_Dagger[bj_forLoopAIndex])

  • Dagger Event Copy
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource is A Hero) Equal to True
      • (DamageEventSource is an illusion) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget has an item of type TRUE ITEM) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by DamageEventTarget of type TRUE ITEM)
          • Hero - Create FAKE ITEM and give it to DamageEventTarget
          • Countdown Timer - Pause Dagger[(Player number of (Owner of DamageEventTarget))]
          • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
          • Set DaggerUnit[(Player number of (Owner of DamageEventTarget))] = (Triggering unit)
          • Game - Display to (All players) for 1.00 seconds the text: ((Name of DaggerUnit[(Player number of (Owner of DamageEventTarget))]) + takes damage.)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget has an item of type FAKE ITEM) Equal to True
            • Then - Actions
              • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
            • Else - Actions

I have shrinked trigger. Here is the messages i am able to see
Starts
6
First 2 conditions passed
Hero DOES NOT HAVE THE FAKE ITEM

Why i cannot pass here?
If - Conditions
(HeroOyuncu[TempInteger] has an item of type FAKE ITEM) Equal to True
Then - Actions
Game - Display to (All players) for 1.00 seconds the text: Hero has the FAKE i...

And this is the map Inits
Set HeroOyuncu[2] = Blood Mage 0009 <gen>
HeroOyuncu: Unit Array [12]
TempInteger: Integer
TempIntegerDagger: Integer


  • Dagger Timer Expires Copy
    • Events
      • Time - Dagger[2] expires
    • Conditions
    • Actions
      • Game - Display to (All players) for 1.00 seconds the text: Starts
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_Dagger[bj_forLoopAIndex]) then
          • Set TempIntegerDagger = (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DaggerUnit[TempIntegerDagger] is in Oluler_ug) Equal to False
              • (Life of HeroOyuncu[TempIntegerDagger]) Greater than or equal to 2.00
            • Then - Actions
              • Game - Display to (All players) for 1.00 seconds the text: First 2 conditions ...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HeroOyuncu[TempInteger] has an item of type FAKE ITEM) Equal to True
                • Then - Actions
                  • Game - Display to (All players) for 1.00 seconds the text: Hero has the FAKE i...
                  • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type FAKE ITEM)
                  • Hero - Create TRUE ITEM and give it to DaggerUnit[TempIntegerDagger]
                  • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
                  • Game - Display to (All players) for 1.00 seconds the text: Hero DOES NOT HAVE ...
            • Else - Actions
              • Game - Display to (All players) the text: 5
          • Custom script: exitwhen true
          • Custom script: endif
          • Game - Display to (All players) the text: 6
Update: I have partially solved.
(HeroOyuncu[TempInteger] has an item of type FAKE ITEM) Equal to True
I have replaced TempInteger with TempIntegerDagger and now i can get the item. Now i am going to test give the item after the Hero dies
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,141
Please read previous post before this

It seems i have finally managed the find source. BUT i do not know how to solve this.
I have the TRUE item and damaged by enemy tower and dies in 2 hits.
Now i have a DEAD hero within oluler group Unit Group - Add Blood Mage 0009 <gen> to Oluler_ug
3 Seconds timer expires and this trigger no more works again. It must start the timer again. Because still i am waiting for revive time.
But this trigger runs once..

  • Dagger Timer Expires Copy
    • Events
      • Time - Dagger[2] expires
    • Conditions
    • Actions
      • Game - Display to (All players) for 1.00 seconds the text: Starts
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_Dagger[bj_forLoopAIndex]) then
          • Set TempIntegerDagger = (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DaggerUnit[TempIntegerDagger] is in Oluler_ug) Equal to False
              • (Life of HeroOyuncu[TempIntegerDagger]) Greater than or equal to 2.00
            • Then - Actions
              • Game - Display to (All players) for 1.00 seconds the text: First 2 conditions ...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HeroOyuncu[TempIntegerDagger] has an item of type FAKE ITEM) Equal to True
                • Then - Actions
                  • Game - Display to (All players) for 1.00 seconds the text: Hero has the FAKE i...
                  • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type FAKE ITEM)
                  • Hero - Create TRUE ITEM and give it to DaggerUnit[TempIntegerDagger]
                  • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
                  • Game - Display to (All players) for 1.00 seconds the text: Hero DOES NOT HAVE ...
            • Else - Actions
              • Game - Display to (All players) the text: 5
          • Custom script: exitwhen true
          • Custom script: endif
          • Game - Display to (All players) the text: 6
  • Test Revive
    • Events
      • Player - Player 2 (Blue) types a chat message containing r as An exact match
    • Conditions
    • Actions
      • Hero - Instantly revive Blood Mage 0009 <gen> at (Center of Region 004 <gen>), Show revival graphics
      • Unit Group - Remove Blood Mage 0009 <gen> from Oluler_ug
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
A unit takes damage -> If unit has X then disable X. If unit has Y then disable Y. Start the Timer if any of these are true.

The timer expires -> If unit has X then enable X. If unit has Y then enable Y.

A unit dies -> It if's timer is running then pause the timer.

A unit revives -> If it's timer is paused then check it's items. If unit has X then enable X. If unit has Y then enable Y.

That's the logic. X = first item. Y = second item.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
But the problem is, still i do not know how to do that...
By the way look, what i found... It was from 2 years ago How to detect reincarnated unit? (extreme question about reincarnation)
Same issue actually.
But you were already doing it for one item. Just copy and paste that same logic and apply it to a second item. Also, like I said before, stop using Else - Actions, you want BOTH of these Items to work at the same time.

ELSE is for when you want one thing OR another thing to happen.

For example:
If some Condition is True THEN add 500 gold ELSE add 500 lumber.

That'll add 500 gold OR add 500 lumber. It can't ever Add 500 gold AND 500 lumber at the same time because I've separated the logic with an ELSE.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
And surprisingly still i cannot do that. This is the map file. Still i am trying to understand why i cannot get the item after i revive.
This trigger runs once and stops working.
  • Dagger Timer Expires Copy
    • Events
      • Time - Dagger[2] expires
    • Conditions
    • Actions
      • Game - Display to (All players) for 1.00 seconds the text: Starts
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_Dagger[bj_forLoopAIndex]) then
          • Set TempIntegerDagger = (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DaggerUnit[TempIntegerDagger] is in Oluler_ug) Equal to False
              • (Life of HeroOyuncu[TempIntegerDagger]) Greater than or equal to 2.00
            • Then - Actions
              • Game - Display to (All players) for 1.00 seconds the text: First 2 conditions ...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HeroOyuncu[TempIntegerDagger] has an item of type FAKE ITEM) Equal to True
                • Then - Actions
                  • Game - Display to (All players) for 1.00 seconds the text: Hero has the FAKE i...
                  • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type FAKE ITEM)
                  • Hero - Create TRUE ITEM and give it to DaggerUnit[TempIntegerDagger]
                  • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
                  • Game - Display to (All players) for 1.00 seconds the text: Hero DOES NOT HAVE ...
            • Else - Actions
              • Game - Display to (All players) the text: 5
          • Custom script: exitwhen true
          • Custom script: endif
          • Game - Display to (All players) the text: 6
I am dying with Fake item, i am waiting several seconds, reviving my hero and waiting few more seconds but still i cannot get the real item.
 

Attachments

  • dagger.w3x
    321.1 KB · Views: 0
Top