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

powering up spells

Status
Not open for further replies.
Level 8
Joined
Dec 29, 2006
Messages
359
Is there a way to make it so certain items will directly increase the effectiveness of a spell already owned by its owner? Like have an item called Gloves of Fire Mastery, and have it increase the damage of a Fireball spell by 15 when worn or anything similar?
 
Level 4
Joined
Feb 25, 2008
Messages
58
I think the best way to do this would be to manually code an ability.
For example..

  • Fireball
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Firebolt (Neutral Hostile)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Claws of Attack +15) Equal to True
        • Then - Actions
          • Set FireballDamage = ((50.00 + (30.00 x (Real((Level of Firebolt (Neutral Hostile) for (Triggering unit)))))) + 15.00)
        • Else - Actions
          • Set FireballDamage = ((50.00 + (30.00 x (Real((Level of Firebolt (Neutral Hostile) for (Triggering unit)))))) + 0.00)
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing FireballDamage damage of attack type Spells and damage type Normal
or an MUI version (i think)

JASS:
function Fireball_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'ANfb'
endfunction

function Trig_Fireball_Copy_Func001C takes nothing returns boolean
    return UnitHasItemOfTypeBJ(GetTriggerUnit(), 'ratf') == true
endfunction

function Trig_Fireball_Copy_Actions takes nothing returns nothing
    local real FireballDamage
    if ( Trig_Fireball_Copy_Func001C() ) then
        set FireballDamage = ( ( 50.00 + ( 30.00 * I2R(GetUnitAbilityLevelSwapped('ANfb', GetTriggerUnit())) ) ) + 15.00 )
    else
        set FireballDamage = ( ( 50.00 + ( 30.00 * I2R(GetUnitAbilityLevelSwapped('ANfb', GetTriggerUnit())) ) ) + 0.00 )
    endif
    call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), FireballDamage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction

//===========================================================================
function Fireball takes nothing returns nothing
    set gg_trg_Fireball_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Fireball_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Fireball_Copy, Condition( function Fireball_Conditions ) )
    call TriggerAddAction( gg_trg_Fireball_Copy, function Fireball_Actions )
endfunction
 
Status
Not open for further replies.
Top