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

[Trigger] Im trying to make spells which makes the mirror images you have now cast mirror image

Status
Not open for further replies.
Level 5
Joined
Jun 26, 2016
Messages
60
Here is my trigger :

  • Illusion mastery
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Walk SAMURO
    • Actions
      • Unit Group - Pick every unit in (Units within 1000000000.00 of (Center of (Playable map area)) matching (((Color of (Owner of (Triggering unit))) Equal to (Color of (Owner of (Matching unit)))) and (((Matching unit) is an illusion) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Replace (Picked unit) with a Samuro 1 using The new unit's max life and mana
          • Unit - Add Bladestorm to (Last replaced unit)
          • Hero - Set (Last replaced unit) Hero-level to (Level of (Triggering unit)), Hide level-up graphics
          • Unit - Order (Last replaced unit) to Orc Blademaster - Mirror Image
      • Wait 0.30 seconds
      • Unit Group - Pick every unit in (Units within 1000000000.00 of (Center of (Playable map area)) matching (((Color of (Owner of (Triggering unit))) Equal to (Color of (Owner of (Matching unit)))) and ((((Matching unit) is an illusion) Equal to False) and ((Unit-type of (Matching unit)) Equal and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Neutral Extra and Retain color
          • Unit - Remove (Picked unit) from the game
 
Last edited:
I personaly would split this in 2 Triggers. Cause this "pick all Units on the Map"-triggers are in general inefficent and beeing well organized helps alot.
  1. Trigger multiply Illusions
  2. Trigger Remove the Fake Mirror Image casters

  • Multiply Illus
    • Events
      • Unit - A unit casts a spell
    • Bedingungen
      • (Ability being cast) = Multiply Illus
    • Aktionen
      • Custom script: set bj_wantDestroyGroup=true
      • Einheitengruppe - Pick every unit in (Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) Gleich (Unit-type of (Triggering unit))) and (((Matching unit) is an illusion) Gleich True))) and do (Actions)
        • Schleifen - Aktionen
          • Unit - Replace (Picked unit) with a (Unit-type of (Triggering unit)) using Alte Einheit: Rel. life and mana
          • Unit - Set mana of (Last replaced unit) to 100.00%
          • Unit - Add Spiegelbild to (Last replaced unit)
          • Unit - Set level of Spiegelbild for (Last replaced unit) to (Level of Spiegelbild for (Triggering unit))
          • Unit - Order (Last replaced unit) to Orc-Klingenmeister - 'Spiegelbild'
          • Trigger - Add to Remove Fake Caster <gen> the event (Unit - (Last replaced unit) gains order without target )
This Trigger "Removes" the Fake casters we created earlier. We have to do such a wierd "Remove" cause real Remove does Remove all Ilusions too.
Mirror Image triggers an "Stop" Order as soon the Caster lands, this trigger uses this behaviour to gain the correct Timing.
  • Remove Fake Caster
    • Ereignisse
    • Bedingungen
    • Aktionen
      • Unit - Set life of (Triggering unit) to 0.00
      • Unit - Change ownership of (Triggering unit) to Neutral passiv and Farbe wechseln
      • Unit - Hide (Triggering unit)


PS: I warn you this whole design has hard disadvantages and has to be used very limited.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
Not even sure what the trigger is meant to do... Having mirror images cast mirror image sounds kind of a dangerous idea. It could get out of control and the game could crash after the map is made a solid wall of Mirror images.

Or are you trying to recreate the level 20 Bladestorm talent from Heroes of the Storm? Where all active Mirror Images now cast Bladestorm when you cast Bladestorm?
 
Level 5
Joined
Jun 26, 2016
Messages
60
Not even sure what the trigger is meant to do... Having mirror images cast mirror image sounds kind of a dangerous idea. It could get out of control and the game could crash after the map is made a solid wall of Mirror images.

Or are you trying to recreate the level 20 Bladestorm talent from Heroes of the Storm? Where all active Mirror Images now cast Bladestorm when you cast Bladestorm?
Yeah thats what i meant to do, but i cant make that so i decided to make my mirror images to cast mirror image again instead as its easier to make, i have completed my spell arleady but it cast mirror image instead of bladestorm but i dont know how to make them cast bladestorn as illusions cant learn an ability
 
Level 3
Joined
Oct 27, 2016
Messages
34
EDIT: I'm replying to your attempts to have illusions cast Bladestorm, but the principle is the same.

This should be incredibly simple, but after experimenting, I've found that this is yet another example of the World Editor being broken as balls.

Illusions appear to be hardcoded to not us abilities, or at least this one. Maybe if you did the following trigger, but also replaced the actual illusions with a custom unit designed to look like illusions, it might work (but this would completely remove the summoned unit timer, sorry).

  • IlusionBladestorm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Ability being cast) Equal to Bladestorm
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is an illusion) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Add Bladestorm to (Picked unit)
          • Unit - Order (Picked unit) to Orc Blademaster - Bladestorm
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
I totaly forgot about that...
It occurs technically when the unit is detected. The player's illusions only looks coloured if the player has shared vision of himself so the units are automatically detected. Allies like wise also need shared vision for the illusions to be detected and appear tinted, otherwise they will need detection like enemies if there is no shared vision. Enemies can also have shared vision in which case everything is automatically detected as well.

EDIT: I dont know why Blizzard only has the trigger remove buff it should also has add buff don't you think?
They did add this feature to StarCraft II. In Warcraft III I am guessing adding buffs is not that simple due to how they are coded internally.
 
Level 6
Joined
Apr 20, 2016
Messages
215
Yep thats why I'm thanking it
  • Shadow Clone Jutsu
  • Events
    • Unit - A unit spawns a summoned unit
  • Conditions
    • (Summoned unit is an illusion) equal to true
  • Actions
    • Unit Group - Pick every unit 400 around Casting unit, matching condition (Summoned unit is an illusion) equal to true
      • Loop
        • Unit - Replace Matching unit to Blademaster using old units life and mana
    • Unit - Order Last replaced unit to Blademaster - Mirror Image
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
Yep thats why I'm thanking it
Blademaster does not start out with mirror image... Also if it did then that would create an infinite loop (game crash).

Just so it is clear, the replace unit action uses the following JASS internally.
JASS:
function ReplaceUnitBJ takes unit whichUnit,integer newUnitId,integer unitStateMethod returns unit
    local unit    oldUnit = whichUnit
    local unit    newUnit
    local boolean wasHidden
    local integer index
    local item    indexItem
    local real    oldRatio
    if (oldUnit == null) then
        set bj_lastReplacedUnit = oldUnit
        return oldUnit
    endif
    set wasHidden = IsUnitHidden(oldUnit)
    call ShowUnit(oldUnit, false)
    if (newUnitId == 'ugol') then
        set newUnit = CreateBlightedGoldmine(GetOwningPlayer(oldUnit), GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit))
    else
        set newUnit = CreateUnit(GetOwningPlayer(oldUnit), newUnitId, GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit))
    endif
    if (unitStateMethod == bj_UNIT_STATE_METHOD_RELATIVE) then
        if (GetUnitState(oldUnit, UNIT_STATE_MAX_LIFE) > 0) then
            set oldRatio = GetUnitState(oldUnit, UNIT_STATE_LIFE) / GetUnitState(oldUnit, UNIT_STATE_MAX_LIFE)
            call SetUnitState(newUnit, UNIT_STATE_LIFE, oldRatio * GetUnitState(newUnit, UNIT_STATE_MAX_LIFE))
        endif
        if (GetUnitState(oldUnit, UNIT_STATE_MAX_MANA) > 0) and (GetUnitState(newUnit, UNIT_STATE_MAX_MANA) > 0) then
            set oldRatio = GetUnitState(oldUnit, UNIT_STATE_MANA) / GetUnitState(oldUnit, UNIT_STATE_MAX_MANA)
            call SetUnitState(newUnit, UNIT_STATE_MANA, oldRatio * GetUnitState(newUnit, UNIT_STATE_MAX_MANA))
        endif
    elseif (unitStateMethod == bj_UNIT_STATE_METHOD_ABSOLUTE) then
        call SetUnitState(newUnit, UNIT_STATE_LIFE, GetUnitState(oldUnit, UNIT_STATE_LIFE))
        if (GetUnitState(newUnit, UNIT_STATE_MAX_MANA) > 0) then
            call SetUnitState(newUnit, UNIT_STATE_MANA, GetUnitState(oldUnit, UNIT_STATE_MANA))
        endif
    elseif (unitStateMethod == bj_UNIT_STATE_METHOD_DEFAULTS) then
    elseif (unitStateMethod == bj_UNIT_STATE_METHOD_MAXIMUM) then
        call SetUnitState(newUnit, UNIT_STATE_LIFE, GetUnitState(newUnit, UNIT_STATE_MAX_LIFE))
        call SetUnitState(newUnit, UNIT_STATE_MANA, GetUnitState(newUnit, UNIT_STATE_MAX_MANA))
    else
    endif
    call SetResourceAmount(newUnit, GetResourceAmount(oldUnit))
    if (IsUnitType(oldUnit, UNIT_TYPE_HERO) and IsUnitType(newUnit, UNIT_TYPE_HERO)) then
        call SetHeroXP(newUnit, GetHeroXP(oldUnit), false)
        set index = 0
        loop
            set indexItem = UnitItemInSlot(oldUnit, index)
            if (indexItem != null) then
                call UnitRemoveItem(oldUnit, indexItem)
                call UnitAddItem(newUnit, indexItem)
            endif
            set index = index + 1
            exitwhen index >= bj_MAX_INVENTORY
        endloop
    endif
    if wasHidden then
        call KillUnit(oldUnit)
        call RemoveUnit(oldUnit)
    else
        call RemoveUnit(oldUnit)
    endif
    set bj_lastReplacedUnit = newUnit
    return newUnit
endfunction
 
Level 6
Joined
Apr 20, 2016
Messages
215
Ill add config this was just an examle coz im GUI
  • Set SCJ_Max_Clones = 10
  • Set SCJ_Loop_Count = SCJ_Loop_Counnt + 1
EDIT: @Dr Super Good are there any other attachments on Blademaster's weapon coz when I was watching random videos on YouTube I saw a spell which was the effect is attachet to very top of the weapon and the middle part of the weapon.
 
Last edited:
Status
Not open for further replies.
Top