[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Spells


Reply
 
Thread Tools
The Hive Workshop Spells:
Guardian v1.2 [GUI]
Images
Highslide JS
Details
Uploaded:11:41, 28th Jun 2012
Last Updated:08:20, 27th Jul 2012
Keywords:guard, fly, eagle, hawk, air, anti, heal, priest, wave, elite, ultimate, healing, ally, dota
Type:Target Object
Category:GUI / Triggers

Full Description:
Summons an eagle guardian that will follow and heals the target when it takes damage. When the eagle heals 5 times, it will cast a healing wave which bounces to nearby friendly units, each wave deals less healing.
The main duty of the eagle is to heal the target and helps attack enemy units whenever applicable. Eagle lasts for 60 seconds.

|cffffcc00Level 1|r - Heals 5, Wave heals 100 to primary target and deals 60% less for 2 targets.
|cffffcc00Level 2|r - Heals 7, Wave heals 150 to primary target and deals 50% less for 3 targets.
|cffffcc00Level 3|r - Heals 9, Wave heals 200 to primary target and deals 40% less for 4 targets.
|cffffcc00Level 4|r - Heals 11, Wave heals 250 to primary target and deals 30% less for 5 targets.
|cffffcc00Level 5|r - Heals 13, Wave heals 300 to primary target and deals 20% less for 6 targets.

Instructions:
- Be sure to check the 'Automatically create unknown variables...', via File>Preferences>General tab.
- In the object editor, copy all the custom Unit and Abilities to your map.
- Copy all that is written from the 'Guardian' folder editor to your map.
- Be sure to input the right configutation from the 'Setup' trigger

Triggers (Yes in GUI!)

Setup
Events
Map initialization
Conditions
Actions
-------- These are the configurables, adjust when necessary --------
-------- The main ability of the hero --------
Set GU_AbilHero = Guardian
-------- The main ability of the Guardian, heals target --------
Set GU_AbilHealing = Guardian [Healing]
-------- The secondary ability of the Guardian, multi heal --------
Set GU_AbilMultiHealing = Guardian [Multi Healing - for dummy]
-------- The Guardian UnitType --------
Set GU_GuardianTy = Guardian (Level 2)
-------- The max distance to follow the caster hero --------
Set GU_DistMax = 300.00
-------- The effect of the eagle summoned --------
Set GU_Sfx = Abilities\Spells\Orc\FeralSpirit\feralspirittarget.mdl
-------- Setting the BASE damage multiplier and add --------
Set GU_DamageMultiplier = 3.00
Set GU_DamageAdd = 3.00
-------- The life duration of the eagle, set to ZERO if you wish to have unlimited life --------
Set GU_EaglesLife = 60.00
-------- Preloading; You may NEVER touch this! --------
Custom script: set bj_lastCreatedUnit = CreateUnit(Player(15), udg_GU_GuardianTy, 0,0,0)
Custom script: call UnitAddAbility(bj_lastCreatedUnit, udg_GU_AbilHealing)
Custom script: call UnitAddAbility(bj_lastCreatedUnit, udg_GU_AbilMultiHealing)
Custom script: call ShowUnit(bj_lastCreatedUnit, false)
Custom script: call RemoveUnit(bj_lastCreatedUnit)
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Trigger - Add to GuardianUnpick <gen> the event (Player - (Player((Integer A))) Selects a unit)
Guardian
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to GU_AbilHero
Actions
Custom script: call ExecuteFunc("GU_Cast")
Custom script: endfunction
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
Custom script: function GU_OrderId takes unit u returns boolean
Unit - Order GU_Guardian[GU_Index2] to Undead Necromancer - Unholy Frenzy GU_Target[GU_Index2]
Custom script: return GetUnitCurrentOrder(u)==852209
Custom script: endfunction
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
Custom script: function GU_Loop takes nothing returns nothing
For each (Integer GU_IndexL) from 1 to GU_Index1, do (Actions)
Loop - Actions
Set GU_Index2 = GU_IndexAr[GU_IndexL]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(GU_Target[GU_Index2] is alive) Equal to True
(GU_Guardian[GU_Index2] is alive) Equal to True
Then - Actions
Set GU_Loc1 = (Position of GU_Guardian[GU_Index2])
Set GU_Loc2 = (Position of GU_Target[GU_Index2])
Set GU_Distance = (Distance between GU_Loc1 and GU_Loc2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GU_Distance Greater than or equal to GU_DistMax
Then - Actions
Set GU_Loc3 = (GU_Loc2 offset by 250.00 towards (Random real number between 0.00 and 270.00) degrees)
Unit - Order GU_Guardian[GU_Index2] to Move To GU_Loc3
Custom script: call RemoveLocation(udg_GU_Loc3)
Else - Actions
Set GU_TargetMaxLife = (Max life of GU_Target[GU_Index2])
Set GU_TargetLife = (Life of GU_Target[GU_Index2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GU_TargetLife Less than GU_TargetMaxLife
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GU_Counter[GU_Index2] Greater than or equal to 5
Then - Actions
Unit - Order GU_Guardian[GU_Index2] to Orc Shadow Hunter - Healing Wave GU_Target[GU_Index2]
Set GU_Counter[GU_Index2] = 0
Else - Actions
-------- OrderID==852209 --------
Custom script: if GU_OrderId(udg_GU_Guardian[udg_GU_Index2]) then
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GU_Counter[GU_Index2] Less than 6
Then - Actions
Set GU_Counter[GU_Index2] = (GU_Counter[GU_Index2] + 1)
Unit - Set life of GU_Target[GU_Index2] to ((Life of GU_Target[GU_Index2]) + GU_Heal[GU_Index2])
Else - Actions
Custom script: endif
Else - Actions
Custom script: call RemoveLocation(udg_GU_Loc1)
Custom script: call RemoveLocation(udg_GU_Loc2)
Else - Actions
Unit Group - Remove GU_Guardian[GU_Index2] from GU_Grp
Unit - Kill GU_Guardian[GU_Index2]
Set GU_IndexAr[GU_IndexL] = GU_IndexAr[GU_Index1]
Set GU_IndexAr[GU_Index1] = GU_Index2
Set GU_Index1 = (GU_Index1 - 1)
Set GU_IndexL = (GU_IndexL - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GU_Index1 Equal to 0
Then - Actions
Custom script: call PauseTimer(udg_GU_Timer)
Else - Actions
Custom script: endfunction
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
Custom script: function GU_Cast takes nothing returns nothing
Custom script: if GetUnitTypeId(GetSpellTargetUnit())==udg_GU_GuardianTy then
Unit - Order (Triggering unit) to Stop
Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Triggering player))) the text: You cant cast this ...
Custom script: else
Set GU_Level = (Level of GU_AbilHero for (Triggering unit))
Set GU_Loc1 = (Position of (Target unit of ability being cast))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GU_Index1 Equal to 0
Then - Actions
Custom script: call TimerStart(udg_GU_Timer, 1.0, true, function GU_Loop)
Else - Actions
Set GU_Index1 = (GU_Index1 + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GU_Index1 Greater than GU_IndexMAX
Then - Actions
Set GU_IndexAr[GU_Index1] = GU_Index1
Set GU_IndexMAX = GU_Index1
Else - Actions
Set GU_Index2 = GU_IndexAr[GU_Index1]
Set GU_Target[GU_Index2] = (Target unit of ability being cast)
Set GU_Counter[GU_Index2] = 0
Set GU_Heal[GU_Index2] = (((Real(GU_Level)) x GU_DamageMultiplier) + GU_DamageAdd)
Unit - Create 1 GU_GuardianTy for (Triggering player) at GU_Loc1 facing Default building facing degrees
Set GU_Guardian[GU_Index2] = (Last created unit)
Unit Group - Add GU_Guardian[GU_Index2] to GU_Grp
Special Effect - Create a special effect attached to the origin of (Last created unit) using GU_Sfx
Special Effect - Destroy (Last created special effect)
-------- adding the 2 abilities --------
Unit - Add GU_AbilHealing to GU_Guardian[GU_Index2]
Unit - Set level of GU_AbilHealing for GU_Guardian[GU_Index2] to GU_Level
Unit - Add GU_AbilMultiHealing to GU_Guardian[GU_Index2]
Unit - Set level of GU_AbilMultiHealing for GU_Guardian[GU_Index2] to GU_Level
Unit - Add a GU_EaglesLife second Generic expiration timer to GU_Guardian[GU_Index2]
Custom script: call RemoveLocation(udg_GU_Loc1)
Custom script: endif
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
GuardianUnpick
Events
Conditions
((Triggering unit) is in GU_Grp) Equal to True
Actions
Selection - Remove (Triggering unit) from selection for (Triggering player)


Credits and Changelogs

CREDITS:
- Magtheridom96 (for suggesting GuardianUnpick event registration)

CHANGELOGS:
v1.2
- Description changed
- Code optimized as suggested by the moderator

v1.1
- Trigger loop replaced by TimerLoop
- Code and variables greatly reduced and optimized
- Description changes


YouTube Movie
Rating - 5.00 (3 votes)
(Hover and click)
Moderator Comments
Useful
22nd July 2012
Magtheridon96: Approved.

This is scripted well enough.

This spell is approved and works properly.


Download Guardian v1.2.w3x
(52.05 KB, 260 Downloads)

Old 06-28-2012, 11:49 AM   #2 (permalink)
Registered User Almia
Oh Data Structures <3
 
Almia's Avatar
 
Join Date: Apr 2012
Posts: 3,004
Almia is a name known to all (650)Almia is a name known to all (650)
Cant Find Any Leaks
Very MUI
i like the idea(can you change the name to Guardian Crow/Eagle/HawK?)
5/5
Almia is offline   Reply With Quote
Old 06-28-2012, 11:55 AM   #3 (permalink)
Registered User mckill2009
SSJ99999 Pinoy!
 
mckill2009's Avatar
 
Join Date: Mar 2009
Posts: 4,384
mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)
nahh, it's up to the user to edit the name, meanwhile, it's generic 'Guardian', thanks for the positive feedback coz now I rarely use GUI :)...
EDIT:
I had a small mistake though MU_DamageMultiplie whould be 2...
__________________
My Resources:
My Maps
My Systems/Spells

Your ideas tend to result in unnecessary violence so shut the F*** up!
mckill2009 is online now   Reply With Quote
Old 06-28-2012, 12:15 PM   #4 (permalink)
Registered User zv27
The real me RnR forever
 
zv27's Avatar
 
Join Date: Aug 2010
Posts: 236
zv27 has disabled reputation
5/5
except only one thing:
"food cost" is a bad idea for AOS maps
__________________
zv27 is offline   Reply With Quote
Old 06-28-2012, 12:34 PM   #5 (permalink)
Registered User Almia
Oh Data Structures <3
 
Almia's Avatar
 
Join Date: Apr 2012
Posts: 3,004
Almia is a name known to all (650)Almia is a name known to all (650)
Quote:
Originally Posted by zv27 View Post
5/5
except only one thing:
"food cost" is a bad idea for AOS maps
yeah thats right
this spell is good for campaigns
Almia is offline   Reply With Quote
Old 06-28-2012, 12:50 PM   #6 (permalink)
Registered User mckill2009
SSJ99999 Pinoy!
 
mckill2009's Avatar
 
Join Date: Mar 2009
Posts: 4,384
mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)
again guys, the user can adjust the food/mana/cooldown to 0 from the object editor, the
model can be changed as well, it maybe walking/running etc...it's all pretty much
configurable...
__________________
My Resources:
My Maps
My Systems/Spells

Your ideas tend to result in unnecessary violence so shut the F*** up!
mckill2009 is online now   Reply With Quote
Old 06-28-2012, 01:13 PM   #7 (permalink)
Registered User zv27
The real me RnR forever
 
zv27's Avatar
 
Join Date: Aug 2010
Posts: 236
zv27 has disabled reputation
Quote:
Originally Posted by mckill2009 View Post
again guys, the user can adjust the food/mana/cooldown to 0 from the object editor, the
model can be changed as well, it maybe walking/running etc...it's all pretty much
configurable...
As for configuration, all is fine.
Comments related to that in general it is not good for AOS maps,and not the configuration.
Which means that there is no question about that configuration is not good.

As for me this is not a problem
I already rewrote the code in the JASS version and throw that part

Otherwise my map use the SLK files and not the OE,so I hate to bother with it.
__________________
zv27 is offline   Reply With Quote
Old 06-28-2012, 04:48 PM   #8 (permalink)
Registered User KnnO
I like everything
 
KnnO's Avatar
 
Join Date: Sep 2011
Posts: 167
KnnO has little to show at this moment (54)
So...
  • Why do you use <GU_IndexAr>? and not directly <GU_Index1>? in the loop trigger, why GU_Index2 = GU_IndexAr[GU_IndexL]? why not directly use <GU_IndexL> from the for loop?
  • Also, why don't you add to the dummy unit <locust> ability instead of making a <GuardianUnpick> trigger?
__________________
و ت ف
KnnO is offline   Reply With Quote
Old 06-29-2012, 12:33 AM   #9 (permalink)
Registered User mckill2009
SSJ99999 Pinoy!
 
mckill2009's Avatar
 
Join Date: Mar 2009
Posts: 4,384
mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)
The GU_Index1 is the MAX index, so it's changing everytime and the unit that will be recalled is only the LAST unit created, the rest, no...
Quote:
why GU_Index2 = GU_IndexAr[GU_IndexL]? why not directly use <GU_IndexL> from the for loop?
coz it will not be recycled properly if I derecly put GU_IndexL, GU_Index2 = GU_IndexAr[GU_IndexL] is there coz values are changing during the loop...

Quote:
Also, why don't you add to the dummy unit <locust> ability instead of making a <GuardianUnpick> trigger?
coz I want the enemy to attack the eagle also...
__________________
My Resources:
My Maps
My Systems/Spells

Your ideas tend to result in unnecessary violence so shut the F*** up!
mckill2009 is online now   Reply With Quote
Old 07-14-2012, 07:56 PM   #10 (permalink)
Forum Moderator Magtheridon96
JESUS MAN
 
Magtheridon96's Avatar
Resource Moderator
 
Join Date: Dec 2008
Posts: 5,700
Magtheridon96 has a brilliant future (1809)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. 
Bro-tip:

Instead of adding all those events to the trigger you could loop from 1 to 12 and register the Select event for each player to the GuardianUnpick trigger.
__________________
Magtheridon96 is offline   Reply With Quote
Old 07-14-2012, 11:48 PM   #11 (permalink)
Registered User mckill2009
SSJ99999 Pinoy!
 
mckill2009's Avatar
 
Join Date: Mar 2009
Posts: 4,384
mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)mckill2009 is a splendid one to behold (847)
thanks Mags, how could I ever forgot that I can set it up in the Setup part using TriggerRegisterPlayerUnitEvent...

Quote:
Originally Posted by Pharaoh_
The spell doesn't do what the tooltip says. The eagle attacks normally, not when the hero's life is full.
I dont get it as I've tested it many times, I used paladin as target, when takes damage, I use divine shield, now eagle attacks enemies...
__________________
My Resources:
My Maps
My Systems/Spells

Your ideas tend to result in unnecessary violence so shut the F*** up!
mckill2009 is online now   Reply With Quote
Old 07-27-2012, 10:30 AM   #12 (permalink)
Registered User yeohxin
User
 
yeohxin's Avatar
 
Join Date: Mar 2010
Posts: 616
yeohxin has little to show at this moment (55)
Looks like the one i requested long long ago. Nice one Mckill x)

5/5
__________________
What's New?
Currently Working on Temple of Furize Raid, beta is out here!
yeohxin is offline   Reply With Quote
Old 07-29-2012, 12:03 PM   #13 (permalink)
Forum Moderator Orcnet
HIVE WARCHIEF™
 
Orcnet's Avatar
Resource Moderator
 
Join Date: Jul 2010
Posts: 2,480
Orcnet is a splendid one to behold (844)Orcnet is a splendid one to behold (844)Orcnet is a splendid one to behold (844)Orcnet is a splendid one to behold (844)Orcnet is a splendid one to behold (844)
nice :)
__________________
Orcnet is offline   Reply With Quote
Old 08-08-2012, 01:34 PM   #14 (permalink)
Registered User AntyVirus
User
 
AntyVirus's Avatar
 
Join Date: Jul 2011
Posts: 22
AntyVirus has little to show at this moment (2)
where is the declared variable GU_Timer?
AntyVirus is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 05:14 AM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle