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

[Spell] Help!

Status
Not open for further replies.
Level 6
Joined
Mar 2, 2013
Messages
127
I looked at the code, did the math and it looks fine but for some reason it does a lot more damage than its supposed to. like 30* more(guess)

Heres what its supposed to do.
================================
Twin Sacred Return Shield. Orihime creates a barrier which reflects some damage back to enemies. Target unit reflects XX% of the damage they take in an AoE of 300. Lasts 5 seconds.
================================
Level 1 - 10% damage reflection.
Level 2 - 15% damage reflection.
Level 3 - 20% damage reflection.
Cooldown: 100/90/80

Here is the code.
  • Soten Kisshun Set Up
    • Events
      • Unit - A unit enters (Current camera bounds)
    • Conditions
      • ((Triggering unit) is A Hero) Equal to (==) True
    • Actions
      • Trigger - Add to Soten Kisshun Effect <gen> the event (Unit - (Triggering unit) Takes damage)
JASS:
function Trig_Soten_Kisshun_Effect_Conditions takes nothing returns boolean
    return GetUnitAbilityLevel(GetTriggerUnit(), 'B02K') > 0
endfunction

function Trig_Soten_Kisshun_Effect_Func003002003 takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction

function Trig_Soten_Kisshun_Effect_Func004A takes nothing returns nothing
    call SpellConstantDamage( udg_Orihime, GetEnumUnit(), udg_Temp_Real )
endfunction

function Trig_Soten_Kisshun_Effect_Actions takes nothing returns nothing
    local group g
    if (GetEventDamage() < 0.99) then // Safe action
        return
    endif
    if (IsUnitType(GetEventDamageSource(),UNIT_TYPE_STRUCTURE)==true) then
        return
    endif
    set udg_SotenLocation = GetUnitLoc(udg_Orihime)
    set udg_Temp_Real = ( 0.05 + ( 0.05 * I2R(GetUnitAbilityLevel(udg_Orihime,'A0B3')) ) ) * GetEventDamage()
    set g = GetUnitsInRangeOfLocMatching(300.00, udg_SotenLocation, Condition(function Trig_Soten_Kisshun_Effect_Func003002003))
    call ForGroup( g, function Trig_Soten_Kisshun_Effect_Func004A )
    call RemoveLocation(udg_SotenLocation)
    call DestroyGroup(g)
    set g = null
endfunction

//===========================================================================
function InitTrig_Soten_Kisshun_Effect takes nothing returns nothing
    set gg_trg_Soten_Kisshun_Effect = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_Soten_Kisshun_Effect, Condition( function Trig_Soten_Kisshun_Effect_Conditions ) )
    call TriggerAddAction( gg_trg_Soten_Kisshun_Effect, function Trig_Soten_Kisshun_Effect_Actions )
endfunction
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
sorry to say it but I would re-think on how you coded this. the event in the GUI trigger could maybe not work in multi player. To make it easy I would do this:

1. download a damage detection system
2. when ability is cast add unit to group x
3. when unit take damage check if he is in group x and reflect the damage
 
Level 6
Joined
Mar 2, 2013
Messages
127
I tried to install the system but it gives me an error.
 

Attachments

  • error.png
    error.png
    1.4 MB · Views: 131
Status
Not open for further replies.
Top