• 🏆 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!

Unit to be replaced gets duplicated instead

Status
Not open for further replies.
Level 29
Joined
Mar 9, 2012
Messages
1,557
When an unit with stoneform ability is supposed to get replaced through trigger it is getting duplicated instead, what may cause this and how to fix ?
This is the triggered ability:
  • Fel Infusion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fel Infusion
      • (Race of (Target unit of ability being cast)) Equal to Demon
    • Actions
      • Set FelInf_Unit = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Grunt (fel)
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Grunt (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Worg Rider (fel)
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Worg Rider (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Spearthrower (fel)
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Spearthrower (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Drummer
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Drummer (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Drake Rider
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Drake Rider (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Black Drake
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Black Drake (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Warlock
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Warlock (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Dread Knight
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Dread Knight (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Stalker
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Stalker (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Fel Ogre
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Fel Ogre (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Fel Ogre
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Fel Ogre (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Peon (fel)
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Peon (chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Peon (upgraded)
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Peon (upgraded,chaos) using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of FelInf_Unit) Equal to Guard
        • Then - Actions
          • Unit - Replace FelInf_Unit with a Guard (chaos) using The old unit's relative life and mana
        • Else - Actions
below part checks and displays error message blablah
  • Fel Infusion check
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(rejuvination))
      • (Level of Fel Infusion for (Triggering unit)) Greater than 0
    • Actions
      • Set caster = (Triggering unit)
      • Set target = (Target unit of issued order)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of target) Not equal to (Owner of caster)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Unit - Pause caster
              • Unit - Order caster to Stop
              • Unit - Unpause caster
              • -------- Display error message that you must target your own units --------
              • Custom script: if udg_ErrorSound == null then
              • Custom script: set udg_ErrorSound = CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
              • Custom script: endif
              • Set ErrorMessage = You need to target one of your own units
              • Set ErrorPlayer = (Owner of caster)
              • Custom script: if GetLocalPlayer() == udg_ErrorPlayer then
              • Custom script: call ClearTextMessages()
              • Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.52, 0.96, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
              • Custom script: call StartSound(udg_ErrorSound)
              • Custom script: endif
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Race of target) Not equal to (Race of caster)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Unit - Pause caster
              • Unit - Order caster to Stop
              • Unit - Unpause caster
              • -------- Display error message that you cant target that unit --------
              • Custom script: if udg_ErrorSound == null then
              • Custom script: set udg_ErrorSound = CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
              • Custom script: endif
              • Set ErrorMessage = You cant target allied, mercenary, summoned, or units that already have chaos damage.
              • Set ErrorPlayer = (Owner of caster)
              • Custom script: if GetLocalPlayer() == udg_ErrorPlayer then
              • Custom script: call ClearTextMessages()
              • Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.52, 0.96, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
              • Custom script: call StartSound(udg_ErrorSound)
              • Custom script: endif
            • Else - Actions
        • Else - Actions
TL;DR: Ability itself functions as intended, except duplicating this particular Fel Ogre unit, which has an Sleep ability based on Stoneform.
unitname(fel) are set to daemon race, unitname(chaos) are set race to orc
 
Level 29
Joined
Mar 9, 2012
Messages
1,557
So this spell isn't supposed to transform the caster, but the targeted unit of the ability?

This is an ultimate skill for the Archon hero in my map, tooltip:
Infuses an non-mechanical, non-heroic Chaos unit with vile energies, permanently allowing it to deal chaos damage type. |nDoes not work on allies or mercenaries.|r
In order to get it function right each chaos unit race is set to otherwise unused demon and has an clone with chaos dmg with race orc. Also the first check makes it sure you cant cast it on an ally, even if he too is playing Fel horde. (tooltip refers to Felhorde as Chaos)
If this part can get fixed:
TL;DR: Ability itself functions as intended, except duplicating this particular Fel Ogre unit, which has an Sleep ability based on Stoneform.
then map with Fel horde will be my next release, so please help me ^^'
 
Status
Not open for further replies.
Top