1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The long-awaited results for Concept Art Contest #11 have finally been released!
    Dismiss Notice
  3. The mythological era has spawned some interesting characters around. Check them out and be sure to vote for them in the 30th Poll of the Texturing Contest.
    Dismiss Notice
  4. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  5. Hivers united and created a bunch of 2v2 melee maps. Vote for the best in our Melee Mapping Contest #4 - Poll!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice

Trigger Viewer

Bloodstone 1.4.w3x
Variables
Test
Starting Gold
Bloodstone
Bloodstone Initialization
Bloodstone Death Effect
Bloodstone Activation
Bloodstone Acquire Item
Bloodstone Lose Item
Bloodstone Mana Regeneration
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
//TESH.scrollpos=0
//TESH.alwaysfold=0
Name Type Is Array Initial Value
Bloodstone itemcode No
Bloodstone_Dummy_Hero unitcode No
Bloodstone_Param_Heal_Base real No
Bloodstone_Param_Heal_Increase real No
Bloodstone_Param_Heal_Radius real No
Bloodstone_Param_Mana_Gain real No
Bloodstone_Param_Stack_Lose real No
Bloodstone_Param_Stack_Radius real No
Bloodstone_Param_Visual_Radius real No
BloodstoneUnitGroup group No
TempBoolean boolean No
TempInteger integer No
TempInteger2 integer No
TempItem item No
TempItem2 item No
TempLocation location No
TempPlayer player No
TempReal real No
TempSpecialEffect effect No
TempUnit unit No
TempUnit2 unit No
TempUnitGroup group No
TempVisibilityModifier fogmodifier No
Starting Gold
  Events
    Map initialization
  Conditions
  Actions
    -------- Sorry but heroes cost money. --------
    Player - Set Player 1 (Red) Current gold to 1000000000
Bloodstone Initialization
  Events
    Map initialization
  Conditions
  Actions
    Set Bloodstone = Bloodstone
    Set Bloodstone_Dummy_Hero = Dummy Hero
    Set Bloodstone_Param_Heal_Base = 500.00
    Set Bloodstone_Param_Heal_Increase = 30.00
    Set Bloodstone_Param_Heal_Radius = 1675.00
    Set Bloodstone_Param_Stack_Radius = 1675.00
    Set Bloodstone_Param_Stack_Lose = 0.67
    Set Bloodstone_Param_Visual_Radius = 1800.00
    Set Bloodstone_Param_Mana_Gain = 1.00
Bloodstone Death Effect
  Events
    Unit - A unit Dies
  Conditions
  Actions
    -------- ------------------------------------ --------
    -------- Local Variables --------
    -------- ------------------------------------ --------
    Custom script: local unit udg_TempUnit
    Custom script: local unit udg_TempUnit2
    Custom script: local fogmodifier udg_TempVisibilityModifier
    Custom script: local effect udg_TempSpecialEffect
    Custom script: local integer udg_TempInteger2
    -------- ------------------------------------ --------
    -------- A hero dies in range of an enemy hero with bloodstone --------
    -------- ------------------------------------ --------
    Set TempUnit = (Triggering unit)
    Set TempPlayer = (Owner of TempUnit)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (TempUnit is A Hero) Equal to True
      Then - Actions
        Set TempLocation = (Position of TempUnit)
        Set TempUnitGroup = (Units within Bloodstone_Param_Stack_Radius of TempLocation)
        Custom script: call RemoveLocation(udg_TempLocation)
        Unit Group - Pick every unit in TempUnitGroup and do (Actions)
          Loop - Actions
            Set TempUnit2 = (Picked unit)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (TempUnit2 is alive) Equal to True
                (TempUnit2 belongs to an enemy of TempPlayer) Equal to True
                (TempUnit2 has an item of type Bloodstone) Equal to True
              Then - Actions
                For each (Integer TempInteger) from 1 to 6, do (Actions)
                  Loop - Actions
                    Set TempItem = (Item carried by TempUnit2 in slot TempInteger)
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Item-type of TempItem) Equal to Bloodstone
                      Then - Actions
                        Item - Set charges remaining in TempItem to ((Charges remaining in TempItem) + 1)
                      Else - Actions
              Else - Actions
        Custom script: call DestroyGroup(udg_TempUnitGroup)
        Custom script: set udg_TempUnit2 = null
      Else - Actions
    -------- ------------------------------------ --------
    -------- Condition for bloodstone effect --------
    -------- ------------------------------------ --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (TempUnit has an item of type Bloodstone) Equal to False
      Then - Actions
        Custom script: set udg_TempUnit = null
        Skip remaining actions
      Else - Actions
    -------- ------------------------------------ --------
    -------- Heal Allies --------
    -------- ------------------------------------ --------
    Set TempItem = (Item carried by TempUnit of type Bloodstone)
    Set TempInteger = (Charges remaining in TempItem)
    Set TempReal = (Bloodstone_Param_Heal_Base + (Bloodstone_Param_Heal_Increase x (Real(TempInteger))))
    Set TempLocation = (Position of TempUnit)
    Special Effect - Create a special effect at TempLocation using Abilities\Spells\NightElf\Tranquility\Tranquility.mdl
    Set TempSpecialEffect = (Last created special effect)
    Set TempUnitGroup = (Units within Bloodstone_Param_Heal_Radius of TempLocation)
    Unit Group - Pick every unit in TempUnitGroup and do (Actions)
      Loop - Actions
        Set TempUnit2 = (Picked unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (TempUnit2 is alive) Equal to True
            (TempUnit2 is A structure) Equal to False
            (TempUnit2 belongs to an ally of TempPlayer) Equal to True
          Then - Actions
            Unit - Set life of TempUnit2 to ((Life of TempUnit2) + TempReal)
          Else - Actions
    Custom script: call DestroyGroup(udg_TempUnitGroup)
    -------- ------------------------------------ --------
    -------- Remove Charges --------
    -------- ------------------------------------ --------
    For each (Integer TempInteger) from 1 to 6, do (Actions)
      Loop - Actions
        Set TempItem = (Item carried by TempUnit in slot TempInteger)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Item-type of TempItem) Equal to Bloodstone
          Then - Actions
            Set TempReal = ((Real((Charges remaining in TempItem))) x Bloodstone_Param_Stack_Lose)
            Item - Set charges remaining in TempItem to (Integer(TempReal))
          Else - Actions
    -------- ------------------------------------ --------
    -------- Add Vision --------
    -------- ------------------------------------ --------
    Set TempLocation = (Position of TempUnit)
    Visibility - Create an initially Enabled visibility modifier for TempPlayer emitting Visibility from TempLocation to a radius of Bloodstone_Param_Visual_Radius
    Set TempVisibilityModifier = (Last created visibility modifier)
    -------- ------------------------------------ --------
    -------- Keep Track Of Experience --------
    -------- ------------------------------------ --------
    Unit - Create 1 Bloodstone_Dummy_Hero for TempPlayer at TempLocation facing (Facing of TempUnit) degrees
    Set TempUnit2 = (Last created unit)
    Hero - Set TempUnit2 experience to (Hero experience of TempUnit), Hide level-up graphics
    Unit - Make TempUnit2 Invulnerable
    Custom script: call RemoveLocation(udg_TempLocation)
    -------- ------------------------------------ --------
    -------- Remove Heal Special Effect --------
    -------- ------------------------------------ --------
    Wait 3.67 game-time seconds
    Special Effect - Destroy TempSpecialEffect
    -------- ------------------------------------ --------
    -------- Wait until hero revives --------
    -------- ------------------------------------ --------
    Custom script: loop
    Custom script: exitwhen GetWidgetLife(udg_TempUnit) > 0
    Custom script: call TriggerSleepAction(1)
    Custom script: endloop
    -------- ------------------------------------ --------
    -------- Remove Vision --------
    -------- ------------------------------------ --------
    Visibility - Disable TempVisibilityModifier
    Visibility - Destroy TempVisibilityModifier
    -------- ------------------------------------ --------
    -------- Add Experience --------
    -------- ------------------------------------ --------
    Set TempInteger = (Hero experience of TempUnit2)
    Hero - Add TempInteger experience to TempUnit, Show level-up graphics
    Unit - Remove TempUnit2 from the game
    Custom script: set udg_TempUnit = null
    Custom script: set udg_TempUnit2 = null
    Custom script: set udg_TempVisibilityModifier = null
    Custom script: set udg_TempSpecialEffect = null
Bloodstone Activation
  Events
    Unit - A unit Uses an item
  Conditions
    (Item-type of (Item being manipulated)) Equal to Bloodstone
  Actions
    Set TempItem = (Item being manipulated)
    Item - Set charges remaining in TempItem to ((Charges remaining in TempItem) + 1)
    Unit - Kill (Triggering unit)
Bloodstone Acquire Item
  Events
    Unit - A unit Acquires an item
  Conditions
    (Item-type of (Item being manipulated)) Equal to Bloodstone
  Actions
    Set TempUnit = (Triggering unit)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (TempUnit is in BloodstoneUnitGroup) Equal to False
      Then - Actions
        Unit Group - Add TempUnit to BloodstoneUnitGroup
        Trigger - Turn on Bloodstone_Mana_Regeneration <gen>
      Else - Actions
    For each (Integer TempInteger) from 1 to 6, do (Actions)
      Loop - Actions
        Set TempItem = (Item carried by TempUnit in slot TempInteger)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            TempItem Not equal to (Item being manipulated)
            (Item-type of TempItem) Equal to Bloodstone
          Then - Actions
            Item - Set charges remaining in (Item being manipulated) to (Charges remaining in TempItem)
            Skip remaining actions
          Else - Actions
Bloodstone Lose Item
  Events
    Unit - A unit Loses an item
  Conditions
    (Item-type of (Item being manipulated)) Equal to Bloodstone
  Actions
    Set TempUnit = (Triggering unit)
    Set TempItem = (Item being manipulated)
    For each (Integer TempInteger) from 1 to 6, do (Actions)
      Loop - Actions
        Set TempItem2 = (Item carried by TempUnit in slot TempInteger)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            TempItem2 Not equal to TempItem
            (Item-type of TempItem2) Equal to Bloodstone
          Then - Actions
            Skip remaining actions
          Else - Actions
    Unit Group - Remove TempUnit from BloodstoneUnitGroup
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in BloodstoneUnitGroup) Equal to 0
      Then - Actions
        Trigger - Turn off Bloodstone_Mana_Regeneration <gen>
      Else - Actions
Bloodstone Mana Regeneration
  Events
    Time - Every 1.00 seconds of game time
  Conditions
  Actions
    Unit Group - Pick every unit in BloodstoneUnitGroup and do (Actions)
      Loop - Actions
        Set TempUnit = (Picked unit)
        Set TempInteger = (Charges remaining in (Item carried by TempUnit of type Bloodstone))
        Set TempReal = ((Real(TempInteger)) x Bloodstone_Param_Mana_Gain)
        Unit - Set mana of TempUnit to ((Mana of TempUnit) + TempReal)