• 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.

AoE Ability based on stats??

Status
Not open for further replies.
Level 2
Joined
Jul 1, 2007
Messages
2
Im very sorry if someone posted this already but ive been searching for a week and i cant find one >.<

So how do i do it? I mean i dont understand cant someone show me the entire process. A long time ago i got the damage part done but it just damaged everything including allies which i dont want xD but i forgot all that and i lost the map >.< so if anyone is kind enuff to show me plz do

-hobolord
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
This is too abstract. By AoE ability we can understand a lot of things: from Warstomp to Cloud. The idea is that basic the effect on the stats will require that you fully enhance the spell using GUI/JASS. That's all I can tell you! You no longer use the native spell, you create it in the environment using other spells and native functions.

-Mihai
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Well you have to firstly generate a group of all the units around the point you want to be affected. Then you need to use an if then else to check if they are not allies of the caster and then use the unit action to cause the caster to damage the picked unit and deal damage that is culculated using an formula.

The get hero stat is an integer action and so you may need to do a lot of real to integer and integer to real actions in the formula as well.

Good luck.
 
Level 3
Joined
Jul 29, 2006
Messages
61
Im very sorry if someone posted this already but ive been searching for a week and i cant find one >.<

So how do i do it? I mean i dont understand cant someone show me the entire process. A long time ago i got the damage part done but it just damaged everything including allies which i dont want xD but i forgot all that and i lost the map >.< so if anyone is kind enuff to show me plz do

-hobolord

What you want is a script that looks something like this:

JASS:
//=================================
//AOE STAT BASED ATTACK
//by Gralamin
//
//To implement, Copy the script
//into a converted trigger
//named AoEStatAttack
//
//Give credit if you use this spell
//==================================

function Trig_AoEStatAttack_Conditions takes nothing returns boolean
    // Replace A000 with the effects Raw code.
    return GetUnitAbilityLevel(GetSpellAbilityUnit() , 'A000') > 0
endfunction

function Trig_AoEStatAttack_Actions takes nothing returns nothing
    local unit c = GetSpellAbilityUnit()
    local unit f
    local location loc = GetSpellTargetLoc()
    local group g
    local real dmg
     
    set g = GetUnitsInRangeOfLocAll(200.00, loc) // Use this if Its like Earthquake;
    // If its like warstomp, Simply change loc to GetUnitLoc(c).
    // 200.00 is the radius, change as needed.
    
    set dmg = I2R(GetHeroAgi(c,true)) * 5.00 // This line gets a heroes agi, Including
    //Bonuses. It then converts it to a real, and and is multipled by 5, or however much
    //you wish to increase it. (change 5 to change it)
    //If you want Strength, change the Agi to Str
    //If you want INT, change Agi to Int
    
    set f = FirstOfGroup(g) // this chooses the first member of the group
    
    loop
        exitwhen f==null
        set f = FirstOfGroup(g) // Repeated for loops sake
        if IsUnitEnemy(f, GetOwningPlayer(a))==true then // Detects if its an enemy
            call UnitDamageTarget(c,f,dmg,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
            // This tells the Caster to deal damage to the first member of group
            // equal to the dmg variable. It then saids this is not an attack
            // And not a ranged attack.
            // The ATTACK_TYPE_NORMAL means its spell damage
            // and the DAMAGE_TYPE_MAGIC means it Deals magic damage, that ignores armor
            // And detects if they are magic immune.
            // the null just elminates an unused part.
        endif
        call GroupRemoveUnit(g,f)  // At the end of this loop, the current unit is removed
        // because of this, when it loops, it'll be a different unit
    endloop
    
    set c = null
    set f = null
    set g = null
    // These prevent leaks, making your map work better.
endfunction
//===========================================================================
function InitTrig_AoEStatAttack takes nothing returns nothing
    set gg_trg_AoEStatAttack = CreateTrigger( )  // This is how it Creates the Trigger
    call TriggerRegisterAnyUnitEventBJ( gg_trg_AoEStatAttack, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_AoEStatAttack, Condition( function Trig_AoEStatAttack_Conditions ) )
    call TriggerAddAction( gg_trg_AoEStatAttack, function Trig_AoEStatAttack_Actions )
endfunction
// To rename the Trigger, Simply Replace ALL Instances of AoEStatAttack with Whatever name you wish
// Spaces should be Underscores ( _ )
// I would reccomend using the replace feature to do this easily.
 
Level 2
Joined
Feb 3, 2007
Messages
12
Meh

If your like me and was too lazy to read that stuff or didnt understand, you could base it off like thunder clap or rain of fire, make the buff something and then make the trigger like
Every .01 seconds

Pick units on map with buff __ and do 3x agi of ___ to picked unit.

Or something like that if you need help with it just message me, but my way is probabaly nubbish so you won't need... :bored: :sad: :sad:

like this maybe...
eee
  • Events
    • Time - Every 0.01 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Rain of Fire) Equal to True)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) is alive) Equal to True
            • ((Picked unit) is A ground unit) Equal to True
          • Then - Actions
            • Unit - Cause (Last created unit) to damage (Picked unit), dealing (Real(((Agility of (Last created unit) (Include bonuses)) x 8))) damage of attack type Spells and damage type Normal
          • Else - Actions
            • Do nothing
 
Last edited by a moderator:
Level 7
Joined
Jun 10, 2007
Messages
225
(Written freehand, without world editor)
  • Events
  • Unit - A unit starts the effect of an ability
  • Conditions
  • (Ability Being Cast) equal to Warstomp
  • Actions
  • Pick every unit within 400 of (Target point of (Ability Being Cast)) and do
  • -----Unit - Make Triggering unit damage Picked unit dealing (Agility of (Triggering Unit) x 5 )
Warning: This will leak a point and unit group.
 
Level 11
Joined
Jun 13, 2007
Messages
570
all you gotta do for that GUI is set your location (point) and unit group to a variable, use those variables in your code, then make sure you destroy / remove them at the end, then your trigger will be okay

Spells based on stats are very easy to do, you just have to "think out side of the box". The RPG I am currently designing is 100% stat based (1 of 3 stats + hero lvl) and 0% spell level based

the 2 functions posted above are great examples of how you can start learning how to do it
 
Status
Not open for further replies.
Top