• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Gui Spell

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,226
ok made a quick example spell. No configurations, nor effects. However it works :p

There's also a minor leak, but I was at school when I did it so I didn't have a lot of time.

  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set GD_hash = (Last created hashtable)
  • cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Custom script: local integer i = GetHandleId(GetSpellTargetUnit())
      • Custom script: call SaveReal(udg_GD_hash, i, 1, 0)
      • Unit Group - Add (Target unit of ability being cast) to gold_drain_group
  • loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in gold_drain_group and do (Actions)
        • Loop - Actions
          • Custom script: local integer i = GetHandleId(GetEnumUnit())
          • Custom script: local real counter = LoadReal(udg_GD_hash, i, 1) + 0.03
          • Custom script: if counter > 1 then
          • Neutral Building - Add -500 gold to (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Resource quantity contained in (Picked unit)) Equal to 0
            • Then - Actions
              • Unit Group - Remove (Picked unit) from gold_drain_group
            • Else - Actions
          • Custom script: set counter = 0
          • Custom script: endif
          • Custom script: call SaveReal(udg_GD_hash, i, 1, counter)
various (minor) flaws can be found in terms of efficiency, and I am aware of a few of them. However I wont update this unless there is some major bug in the code. So good trigger guys shouldn't bother pointing them out :p
 

Attachments

  • gold mine derp.w3x
    17.7 KB · Views: 86
Status
Not open for further replies.
Top