1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. 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
  3. 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
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    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.

Synergy - Fireshield & Sunburst

Submitted by Reaper2008
This bundle is marked as approved. It works and satisfies the submission rules.
Planned to submit to the mini spell contest, but i missed the deadline. Left it lying around, finally decided to upload it.

Fireshield - Forms a shield of fire around a target unit. The shield blocks incoming damage, most effectively ranged.

Sunburst - Summons a mighty sunray to devastate all nearby enemies. During daytime it is so strong that fireshields hit by this spell burst, dealing moderate damage to all enemies around them.

First spell submission, don't flame me too much.

Changelog

v 1.00: Uploaded.

v 1.10: Followed hvo-busterkomo's and -JonNny's suggestions, neatened code, also replaced locs with coordinates and replaced gg_trg_ with lt_ .

v 1.11: Replaced BJs with natives.


Realized I had uploaded the wrong version, anyone who has this please redownload.

Code

SunBurst(Synergy)

Code (vJASS):

function Damage takes unit z, group x returns nothing    
    local unit v
    local group x2 = CreateGroup()
    local player dp = GetOwningPlayer(z)
   
    loop
        set v = FirstOfGroup(x)
       
    // Clearing out all allied units from the valid targets
       
        if IsUnitAlly(v,dp) == false then
            call GroupRemoveUnit(x,v)
            call GroupAddUnit(x2,v)
        else
            call GroupRemoveUnit(x,v)
        endif
       
        exitwhen v == null
    endloop
     
    loop
        set v = FirstOfGroup(x2)
       
    // Creating an effect and damaging all units left to damage
       
        call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Incinerate\\IncinerateBuff.mdl",v,"head"))
        call UnitDamageTarget(z,v,(50.00 * (I2R(GetUnitUserData(z)))),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FIRE,WEAPON_TYPE_WHOKNOWS)
       
    // Dealing the damage. The Custom Value is set by the Shield Trigger, changing that "50" changes the damage
       
        exitwhen v == null                                                                                    
        call GroupRemoveUnit(x2,v)
    endloop
   
    call DestroyGroup(x)
   
    // Cleaning memory leaks
   
    call DestroyGroup(x2)
    set x = null
    set x2 = null
    set dp = null
    set v = null
    set z = null
endfunction

function ShieldBurst takes nothing returns nothing
    local group g = CreateGroup()
    local group s = CreateGroup()
    local group d = CreateGroup()
    local group f = CreateGroup()
    local unit c = GetSpellAbilityUnit()
    local player p = GetOwningPlayer(c)
    local unit u
    local location l = GetUnitLoc(c)
    call GroupEnumUnitsInRangeOfLoc(g,l,375,null)
   
    loop
        set u = FirstOfGroup(g)
       
        if GetUnitAbilityLevel(u,'B000') > 0 then
       
    // Enumerating all units with Fireshield and the units around them
       
            call GroupRemoveUnit(g,u)
            call UnitAddAbility(u,'A008')
           
    //Adding a Spellbook that stops the effects of the Fireshield
           
            call GroupEnumUnitsInRangeOfLoc(d,GetUnitLoc(u),200,null)
            call Damage(u,d)
           
    // Calling the function to damage surrounding enemies
           
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",u,"origin")) // Creating the blast effect.
            call GroupAddUnit(s,u)
        else
            call GroupRemoveUnit(g,u)
        endif
       
        exitwhen u == null
    endloop
   
    call DestroyGroup(d)
     
    // Cleaning memory leaks
   
    set d = null
    call DestroyGroup(s)
    set s = null
    call DestroyGroup(g)
    set g = null
    call DestroyGroup(f)
    set f = null
    set c = null
    set u = null
    call RemoveLocation(l)
    set l = null
    set p = null
endfunction

function BurstCondition takes nothing returns boolean
    return GetSpellAbilityId() == 'A002' and GetTimeOfDay() > 6.00 and GetTimeOfDay() < 18.00
   
    // Condition, checking spell id and daytime
   
endfunction

function InitTrig_SunBurst takes nothing returns nothing
    local trigger lt_SunBurst = CreateTrigger(  )
    local integer iTrig2 = 0
   
    loop
        call TriggerRegisterPlayerUnitEvent( lt_SunBurst, Player(iTrig2),EVENT_PLAYER_UNIT_SPELL_CAST ,null)
        set iTrig2 = iTrig2 + 1
        exitwhen iTrig2 >= bj_MAX_PLAYER_SLOTS
    endloop
   
    call TriggerAddCondition( lt_SunBurst, Condition( function BurstCondition ) )
    call TriggerAddAction( lt_SunBurst, function ShieldBurst)
endfunction
 


Fireshield

Code (vJASS):

function Shield takes nothing returns nothing
    local unit j = GetSpellTargetUnit()
    local integer i = 0
    call UnitAddAbility(j,'A001')
   
    // Adding the Spellbook that contains the aura used for the bonus
   
    call SetUnitUserData(j,GetUnitAbilityLevel(GetSpellAbilityUnit(),'A003'))
   
    // Setting the unit's Custom Value, used to determine Sunburst damage
   
    loop
        call TriggerSleepAction(0.50)
       
        if GetUnitAbilityLevel(j,'B000') <= 0 then
            call UnitAddAbility(j,'A001')
        endif
       
        set i =  (i + 1)
       
        // Checking every half second, stops when the duration has expired, or unit no longer has the ability
       
        exitwhen i ==  4 + (8 * GetUnitAbilityLevel(GetSpellAbilityUnit(),'A003')) or GetUnitAbilityLevel(j,'B002') > 0  // To change duration change that "4".
    endloop
   
    call SetUnitUserData(j,0)
   
    // Cleaning memory leaks
   
    call UnitRemoveAbility(j,'A001')
    call UnitRemoveAbility(j,'A008')
    set i = 0
    set j = null
endfunction

function ShieldCondition takes nothing returns boolean
    return GetSpellAbilityId() == 'A003'
   
    // Condition, checking spell id
   
endfunction

function InitTrig_Shield takes nothing returns nothing
    local trigger lt_Shield = CreateTrigger()
    local integer iTrig1 = 0
   
    loop
        call TriggerRegisterPlayerUnitEvent( lt_Shield, Player(iTrig1),EVENT_PLAYER_UNIT_SPELL_CAST ,null)
        set iTrig1 = iTrig1 + 1
        exitwhen iTrig1 >= bj_MAX_PLAYER_SLOTS
    endloop
   
    call TriggerAddCondition( lt_Shield, Condition( function ShieldCondition ) )
    call TriggerAddAction( lt_Shield, function Shield)
endfunction
 


Effect

Code (vJASS):

function BurstEffect takes nothing returns nothing
    local real rX = GetUnitX(GetSpellAbilityUnit())
    local real rY = GetUnitY(GetSpellAbilityUnit())
    local real rX2 = rX + 300
    local real rY2 = rY + 75
    local integer el = 0
    local unit eu
    local group eg = CreateGroup()
    local boolean bX = false
    local boolean bY = false
   
    loop
        set el = (el + 1)
       
        // Creating 12 dummy units to create the effect
       
        call GroupAddUnit(eg,CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()),'o000',rX,rY,270))
        exitwhen el == 12
    endloop
   
    set el = 0
   
    loop
        set eu = FirstOfGroup(eg)
       
        // Actually casting the effect
               
        if bX == false then
            set rX2 = rX2 - 75
        else                                
            set rX2 = rX2 + 75
        endif
       
        if bY == false then
            set rY2 = rY2 - 75
        else
            set rY2 = rY2 + 75
        endif
       
        call IssuePointOrder(eu,"shockwave",rX2,rY2)
        call UnitApplyTimedLife(eu,'B001',0.50)
        call GroupRemoveUnit(eg,eu)
        set el = (el + 1)
       
        if rX2 == rX + -225 then
            set bX = true
        endif
       
        if rY2 == rY + -225 then
            set bY = true
        endif
       
        if rY2 == rY + 225 then
            set bY = false
        endif
       
        exitwhen el == 12
    endloop  
   
    // Cleaning memory leaks
       
    set eu = null
    call DestroyGroup(eg)
    set eg = null
endfunction

function EffectCondition takes nothing returns boolean
    return GetSpellAbilityId() == 'A002'
   
    // Condition, checking spell id
   
endfunction

function InitTrig_Effect takes nothing returns nothing
    local trigger lt_Effect = CreateTrigger()
    local integer iTrig3 = 0
   
    loop
        call TriggerRegisterPlayerUnitEvent( lt_Effect, Player(iTrig3),EVENT_PLAYER_UNIT_SPELL_CAST ,null)
        set iTrig3 = iTrig3 + 1
        exitwhen iTrig3 >= bj_MAX_PLAYER_SLOTS
    endloop

    call TriggerAddCondition( lt_Effect, Condition( function EffectCondition ) )
    call TriggerAddAction( lt_Effect, function BurstEffect)
endfunction
 




Keywords:
synergy, fire, shield, burst
Contents

Spell - Fireshield & Sunburst (Map)

Reviews
Moderator
18:24, 14th Jun 2009 hvo-busterkomo: Decent effects (although I'm not sure about the synergy). It's worthy of approval as it is now, but I'd like you to make some improvements. 1. Don't use the gg_trg prefix for local triggers. 2. You should...
  1. 18:24, 14th Jun 2009
    hvo-busterkomo:
    Review
    Decent effects (although I'm not sure about the synergy). It's worthy of approval as it is now, but I'd like you to make some improvements.
    1. Don't use the gg_trg prefix for local triggers.
    2. You should indent your code. It significantly improves readability.
    3. You could easily use coordinates instead of locations. In fact, it would improve your OffSetLocation() a lot.
    4. There's a lot of BJs you can easilly replace with natives.
     
  2. Thanathos

    Thanathos

    Joined:
    Aug 2, 2008
    Messages:
    202
    Resources:
    5
    Spells:
    5
    Resources:
    5
    The spells are not really creative but they seem to work, another thing is the fireshield is useless in this map, because the workers won´t attack so you may add some units who will attack.
    I diden´t find any leak in the code for now (remarkabel if this is your first spell), but you use some BJ´s so remove them. I also recommend to use gloabals for the rawcode, so the user of your spell dont need to go trough the whole code and check every rawcode is correct. The commets are ok so over all i would say 3.5/5.
     
  3. Reaper2008

    Reaper2008

    Joined:
    Jul 27, 2008
    Messages:
    1,117
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Alright, did as you said(as much i could) haven't done that rawcode thing yet. Also removed the Reset Cooldowns thingy cause it ruins fireshield somewhy.
     
  4. Thanathos

    Thanathos

    Joined:
    Aug 2, 2008
    Messages:
    202
    Resources:
    5
    Spells:
    5
    Resources:
    5
    Ok so it might be the easiest way for you to get JNGP it will turn the fontcolor of the BJ`s red so (by the default configuration) you can better find them. Well what i meant by using gloabals for the rawcodes is this:
    Example
    Code (vJASS):

    globals // Using the gloabals block in this way is only possible with JNGP
    integer SPELL_ID_A = '1234'
    endglobals

    function some_func takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID_A
    endfunction

    globals // Using the gloabals block in this way is only possible with JNGP
    integer SPELL_ID_B = '4321'
    endglobals
     

    If you have questions about JNGP please read the site from the link.
     
  5. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    lol does JNGP just mean that you can add more stuff and such or isnt it called "vJass"? ^^

    sry but I'm not a jasser
     
  6. Thanathos

    Thanathos

    Joined:
    Aug 2, 2008
    Messages:
    202
    Resources:
    5
    Spells:
    5
    Resources:
    5
    Features of JassNewGenPack:
    - Grimoire (1.5)
    - JassHelper (0.9.G.1) (This makes you able to use [v]JASS)
    - Grim Extension Pack (1.0b)
    - PJass (1.0k)
    - TESH 0.7.0.3 (Unofficial update by Van Damm and Zoxc)
    - Risc's Colorizer FINAL
    - UMSWE (5.0)
    - Reinventing the Craft (0.20)

    I dont really know but PJass could be the compiler/parser for [v]Jass.
    So this is what i think, but it also could be wrong:wink:
     
  7. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    wtf is PJass? never heard of it before, usally you use JNGP to make vJass spells
     
  8. Aspard

    Aspard

    Joined:
    Jul 2, 2008
    Messages:
    595
    Resources:
    1
    Spells:
    1
    Resources:
    1
    If I'm not mistaken, vJass stands for Vexorian Jass, isn't it? It's kinda a standard. JNPG - just a module for WE to work with jass more easily. JASS spells can be any kinds anyway. (So, it doesn't mean that spells created in JNPG are vJass)

    pJass... dunno... pGUI - Paladon's GUI, pJass - ? ;D
     
  9. Thanathos

    Thanathos

    Joined:
    Aug 2, 2008
    Messages:
    202
    Resources:
    5
    Spells:
    5
    Resources:
    5
    Well as far as i know PJASS is some kind of syntax checker ( or parser or a compiler for vjass… these things are of course very different but for me they are the same^^). Dont kill me if im wrong but i think pjass converts vjass into normal jass so for example it adds all variable in a globals block somwhere in the code to the one on top of the script and creates the struct and so on… But hey wait i think our nice talk is gettin off topic. We should help Reaper with his spell.
     
  10. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    sry but I never heard about pjass until now :)
     
  11. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    PJASS? :p haha that's new to me...

    However, about Fire Shiel:
    Since when does fire "block" damage? :p

    Well, ideas aren't much of creative ideas... but if altered i guess they would end up real nice ;)

    EDIT:

    i cant differ on whether how the spells work together work together or not :p

    however, it once bugged and shield stayed on for minutes...
     
    Last edited: May 14, 2009
  12. -JonNny

    -JonNny

    Joined:
    Jan 31, 2007
    Messages:
    486
    Resources:
    12
    Icons:
    3
    Maps:
    4
    Spells:
    4
    Tutorials:
    1
    Resources:
    12
    Hmm :p long ago that ive seen a Jass spell since i learned vJass
    good old times... nah ... if i look at the code they seem not to be that great

    your coding is not that bad :) its mui and leakless
    but its quite ugly, not easy to read and not that efficient
    e.g. i do not know why you check every half second if the unit got the shield buff to add an ability
    also the 13 k location variables you use in your SunBurst can be replaced by a loop

    to make things easier to read build in some spaces and some descriptions of important variables (which spell code is needed here ect

    heres one example of your code
    Hard 2 read
    Code (vJASS):
    loop
    call TriggerSleepAction(0.50)
    if UnitHasBuffBJ(j,'B000') == false then
    call UnitAddAbility(j,'A001')
    endif
    set i =  (i + 1)  // Checking every half second, stops when the duration has expired, or unit no longer has the ability.
    exitwhen i ==  8 + (8 * GetUnitAbilityLevelSwapped('A003',GetSpellAbilityUnit())) or UnitHasBuffBJ(j,'B002') == true  // To change duration change the integers.
    endloop


    Easier 2 read
    Code (vJASS):
    loop
        call TriggerSleepAction(0.50)
        if UnitHasBuffBJ(j,'B000') == false then
            call UnitAddAbility(j,'A001')
        endif
        set i =  (i + 1)  // Checking every half second, stops when the duration has expired, or unit no longer has the ability.
        exitwhen i ==  8 + (8 * GetUnitAbilityLevelSwapped('A003',GetSpellAbilityUnit())) or UnitHasBuffBJ(j,'B002') == true  // To change duration change the integers.
    endloop



    all in all i must say that they seem to work properly but these arent great idead and it could be done better [3/5]
     
  13. Reaper2008

    Reaper2008

    Joined:
    Jul 27, 2008
    Messages:
    1,117
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Alright, I'll get to fixing it somewhen this week, or maybe the next, I'm very busy with exams.

    EDIT: Found time to do it, updated.
     
    Last edited: Jun 16, 2009
  14. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,171
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Can you please Post the systems code?
     
  15. Reaper2008

    Reaper2008

    Joined:
    Jul 27, 2008
    Messages:
    1,117
    Resources:
    1
    Spells:
    1
    Resources:
    1
    It's 3 triggers.
     
  16. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,171
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    So post them here?^^
     
  17. Synthax Kisuke

    Synthax Kisuke

    Joined:
    Aug 2, 2009
    Messages:
    33
    Resources:
    0
    Resources:
    0
    Good Job! And my name is ther(Synergy)