• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Passive doesnt work

Status
Not open for further replies.
Level 7
Joined
Aug 15, 2012
Messages
318
I added Replicate from the spellpack made by Losam to my rpg and so far I havnt got it to work once I did everything right that your supposed to do for imports but nothing any ideas?




  • PAS Replicate
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Attacking unit)) Equal to Assassin
          • (Level of Replicate for (Attacking unit)) Greater than 0
    • Actions
      • -------- ######################### --------
      • -------- ### --- HashTable --- ### --------
      • Hashtable - Create a hashtable
      • Set HashTable[12] = (Last created hashtable)
      • -------- ######################### --------
      • -------- ### --- Salvando Coisas no HashTable --- ### --------
      • Hashtable - Save Handle Of(Attacking unit) as 1 of (Key (Attacking unit)) in HashTable[12]
      • Hashtable - Save Handle Of(Position of (Load 1 of (Key (Attacking unit)) in HashTable[12])) as 2 of (Key (Triggering unit)) in HashTable[12]
      • -------- ######################### --------
      • -------- Configurando Algumas Variáveis: --------
      • -------- Ilusionista: --------
      • Set Unit[20] = (Load 1 of (Key (Attacking unit)) in HashTable[12])
      • Set ABI_Point_Position[35] = (Load 2 of (Key (Triggering unit)) in HashTable[12])
      • -------- ######################### --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit[20] is an illusion) Equal to False
          • (Random integer number between 1 and (10 - (Level of Replicate for Unit[20]))) Equal to 1
        • Then - Actions
          • -------- ######################### --------
          • -------- ### --- Criando a Unidade --- ### --------
          • Unit - Create 1 Unit (Casting 1) for (Owner of Unit[20]) at ABI_Point_Position[35] facing Default building facing degrees
          • -------- ######################### --------
          • -------- ### --- Salvando Coisas no HashTable --- ### --------
          • Hashtable - Save Handle Of(Last created unit) as 3 of (Key (Last created unit)) in HashTable[12]
          • Set Unit[21] = (Load 3 of (Key (Last created unit)) in HashTable[12])
          • -------- ######################### --------
          • Unit - Add a 1.00 second Generic expiration timer to Unit[21]
          • Hero - Create Replicate and give it to Unit[21]
          • Unit - Set level of Illusions for Unit[21] to (Level of Replicate for Unit[20])
          • Hero - Order Unit[21] to use (Last created item) on Unit[20]
          • -------- ######################### --------
        • Else - Actions
      • -------- ######################### --------
      • Set Unit[20] = No unit
      • Set Unit[21] = No unit
      • -------- ######################### --------
      • Custom script: call RemoveLocation (udg_ABI_Point_Position[35])
      • -------- ######################### --------
      • -------- ### --- Clear The HashTable --- ### --------
      • Custom script: call FlushParentHashtableBJ( udg_HashTable[12] )
      • -------- ######################### --------
 
Last edited:
Level 12
Joined
Mar 24, 2011
Messages
1,082
I am not sure what this spell realy is intended to do but I assume something like this would work.

Care to explain what those do ?
  • Hero - Create Replicate and give it to Unit[21]
  • Unit - Set level of Illusions for Unit[21] to (Level of Replicate for Unit[20])
  • Hero - Order Unit[21] to use (Last created item) on Unit[20]
  • Substitution
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of PassiveSpell for (Triggering unit)) Greater than 0
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempInt = (10 x (Level of PassiveSpell for TempUnit)
      • Set TempInt2 = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Greater than or equal to TempInt2
        • Then - Actions
          • Set TempUnit2 = (Attacking unit)
          • Set TempPoint = (Position of TempUnit)
          • Set TempPlayer = (Owner of TempUnit)
          • Unit - Create 1 DummyCast for TempPlayer at TempPoint facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Invisibility TempUnit
          • Unit - Create 1 DummyUnit for TempPlayer at TempPoint facing (Facing of TempUnit) degrees
          • Set TempUnit = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to TempUnit
          • Unit - Order TempUnit2 to Attack TempUnit
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
DummyCast is a dummy unit which casts edited invisibility (duration 2 and no requitrements) at the atacked unit
DummyUnit is a dummy unit which is not invulnerable and has litte hp like for 1 hit. It is good to be a copy of the atacked unit (the unit with the passive ability)


What this does is making the atacked unit invisible for 2 seconds,creating a substitution unit which takes the atack and allows the atacked unit to escape. You cant escape very far for 2 sek but that could save you from fatal kills.
The cahnce is 10 per level of ability.
You could remove the invisibility part so it won't interupt the atacked unit too but only the atacker.
 
Level 7
Joined
Aug 15, 2012
Messages
318
  • Hero - Create Replicate and give it to Unit[21]
  • Unit - Set level of Illusions for Unit[21] to (Level of Replicate for Unit[20])
  • Hero - Order Unit[21] to use (Last created item) on Unit[20]
there is a unit spell and a item that hero create uses the item illusions is the unit spell
 
Status
Not open for further replies.
Top