1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  4. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  5. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  6. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  7. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  8. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Spells issues

Discussion in 'Triggers & Scripts' started by biHmapmaker, Aug 2, 2012.

  1. biHmapmaker

    biHmapmaker

    Joined:
    Oct 10, 2009
    Messages:
    99
    Resources:
    0
    Resources:
    0
    Spell1
    Life Leech Int
    • Life Leech
      • Events
        • Unit - A unit Begins channeling an ability
      • Conditions
        • (Ability being cast) Equal to Life Leech
      • Actions
        • Set LL_caster_target[0] = (Casting unit)
        • Set LL_caster_target[1] = (Target unit of ability being cast)
        • Set LL_damage_heal[0] = (80 + (Intelligence of LL_caster_target[0] (Include bonuses)))
        • Set LL_damage_heal[1] = (40 + (Intelligence of LL_caster_target[0] (Include bonuses)))
        • Set LL_points[0] = (Position of LL_caster_target[0])
        • Set LL_points[1] = (Position of LL_caster_target[1])
        • Trigger - Run Life Leech loop <gen> (checking conditions)


    Life Leech Loop
    • Life Leech loop
      • Events
        • Time - Every 0.50 seconds of game time
      • Conditions
        • (LL_caster_target[1] is alive) Equal to True
      • Actions
        • Special Effect - Create a special effect at LL_points[1] using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
        • Special Effect - Destroy (Last created special effect)
        • Special Effect - Create a special effect at LL_points[0] using Abilities\Spells\Items\AIem\AIemTarget.mdl
        • Special Effect - Destroy (Last created special effect)
        • Unit - Cause LL_caster_target[0] to damage LL_caster_target[1], dealing (Real(LL_damage_heal[0])) damage of attack type Spells and damage type Normal
        • Unit - Set life of LL_caster_target[0] to ((Life of LL_caster_target[0]) + (Real(LL_damage_heal[1])))
        • Custom script: call RemoveLocation(udg_LL_points[0])
        • Custom script: call RemoveLocation(udg_LL_points[1])



    This spell is based on "Life drain" spell. The issue is that it cannot target any sort of units (enemy, friendly, netural ...). it remained the same in the object editor as it's original "Life drain" ability. Any ideas how to fix it?

    Spell 2:

    Burning Cataclysm INT
    • Burning cataclysm int
      • Events
        • Map initialization
      • Conditions
        • (Ability being cast) Equal to Burning Cataclysm
      • Actions
        • -------- Setting basic Variables --------
        • Set BC_Caster = (Casting unit)
        • Set BC_BaseRadius = 650.00
        • Set BC_Angles[0] = 35.00
        • Set BC_Angles[1] = 60.00
        • Set BC_Angles[2] = 90.00
        • Set BC_Angles[3] = 150.00
        • Set BC_Angles[4] = 180.00
        • Set BC_Angles[5] = 240.00
        • Set BC_Angles[6] = 300.00
        • Set BC_Angles[7] = 359.00
        • Set BC_points[0] = (Target point of ability being cast)
        • Set BC_points[1] = ((Target point of ability being cast) offset by (BC_Distance, BC_Angles[1]))
        • Set BC_points[2] = (BC_points[1] offset by (BC_Distance, BC_Angles[2]))
        • Set BC_points[3] = (BC_points[2] offset by (BC_Distance, BC_Angles[3]))
        • Set BC_points[4] = (BC_points[3] offset by (BC_Distance, BC_Angles[4]))
        • Set BC_points[5] = (BC_points[4] offset by (BC_Distance, BC_Angles[5]))
        • Set BC_points[6] = (BC_points[5] offset by (BC_Distance, BC_Angles[6]))
        • Set BC_points[7] = (BC_points[6] offset by (BC_Distance, BC_Angles[7]))
        • Set BC_Distance = 150.00
        • Set BC_damage = (110 + (Intelligence of BC_Caster (Include bonuses)))



    Burning Cataclysm Loop
    • Burning cataclysm loop
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Burning Cataclysm
      • Actions
        • Set BC_Caster = (Triggering unit)
        • Set BC_points[0] = (Target point of ability being cast)
        • Unit - Create 1 bcata_dummy for Player 1 (Red) at BC_points[0] facing Default building facing degrees
        • Set BC_dummy2[0] = (Last created unit)
        • For each (Integer A) from 0 to (Integer(BC_Distance)), do (Actions)
          • Loop - Actions
            • Set BC_Angles[0] = ((Real((Integer A))) x BC_Distance)
            • Set BC_points[1] = (BC_points[0] offset by BC_BaseRadius towards BC_Angles[0] degrees)
            • Unit - Create 1 bcata_dummy for (Owner of BC_Caster) at BC_points[1] facing Default building facing degrees
            • Set BC_dummy2[(Integer A)] = (Last created unit)
            • Special Effect - Create a special effect attached to the origin of BC_dummy_Destroy[(Integer A)] using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
            • Set BC_sfx_store[0] = (Last created special effect)
            • Custom script: call RemoveLocation(udg_BC_points[1])
            • -------- If you want your spell to deal damage to more groups, you'll have to create line for each group or use Integer[A] for Unit Group variable. Below are just examples. --------
            • Set BC_unit_groups[2] = (Units in (Region centered at BC_points[(Integer A)] with size (650.00, 650.00)) owned by Neutral Hostile)
            • Set BC_unit_groups[3] = (Units in (Region centered at BC_points[(Integer A)] with size (650.00, 650.00)) owned by Player 2 (Blue))
            • Set BC_unit_groups[4] = (Units in (Region centered at BC_points[(Integer A)] with size (650.00, 650.00)) owned by Player 3 (Teal))
            • Unit Group - Pick every unit in BC_unit_groups[(Integer A)] and do (Actions)
              • Loop - Actions
                • Unit - Cause BC_Caster to damage (Picked unit), dealing (Real(BC_damage)) damage of attack type Spells and damage type Fire
                • Special Effect - Create a special effect at BC_points[0] using Abilities\Spells\Items\AIfb\AIfbTarget.mdl
                • Set BC_sfx_store[2] = (Last created special effect)
        • For each (Integer A) from 0 to 2, do (Actions)
          • Loop - Actions
            • Special Effect - Destroy BC_sfx_store[(Integer A)]
            • Unit - Remove BC_dummy2[(Integer A)] from the game



    The spell is based on the "Thunder clap" ablity. Issue? It does nothing :)
    I hope you guys can help me with at least one of these spells. Tnx :)
     
  2. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    If you can't target any unit, it's because you have to configure the "Availble Targets" for the ability and for the casting unit. Using "Air / Ground" should be enough to select most units.

    What do you exactly want to achieve with each one of these abilities? Describe them. I'm pretty sure they can be coded in a lot easier and efficient way than you did. I would even be available to create them for you if you give me a really good explanation about what you want.
     
  3. biHmapmaker

    biHmapmaker

    Joined:
    Oct 10, 2009
    Messages:
    99
    Resources:
    0
    Resources:
    0
    First spell:

    What I basically want is the modified Life drain spell. Everything basically the same except the damage scales off of caster's intelligence rather than the flat damage/healing (as you can see in the damage/leech variables).

    Second spell:

    The main idea for the spell is to be a extended flame strike. That is, one initial flame strike creates another one at the target point of created dummy and so in the distance of 650 (which is defined) of the original casting position (and dummies are positioned by angles). I'm aware that there probably is the easier way to do so, but I'm quite a new to the dummy usage in abilities so it's still rather confusing to use them.
    I'll be really thankful if you could help me :)
     
  4. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,855
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    the first one will work only once per cast because you dont run the loop trigger every 0,5 seconds but you run it once using function Run Trigger (aa) (checking condition)
    also burning cataclism, why do you set variables at map init, for instance your BC_damage will not change when your unit gains any inteligence.
    You should set:
    • Set BC_points[1] = ((Target point of ability being cast) offset by (BC_Distance, BC_Angles[1]))
    • Set BC_points[0] = (Target point of ability being cast)
    • Set BC_damage = (110 + (Intelligence of BC_Caster (Include bonuses)))

    The reason being is that all of those functions returns null with map init event.
    Also the condition in trigger Burning cataclysm int
    • (Ability being cast) Equal to Burning Cataclysm

    is useless, how can you cast something on map init? :D