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

[vJASS] Arcane Bubble with Stat based damage

Status
Not open for further replies.
Level 9
Joined
Jul 10, 2011
Messages
562
hey guys...

i tried to implement this spell in my ORPG...it works like it should but at the moment i try to change the damage to be stat based it gives me several errors Oo

anyone can tell me what to change to make damage equal to 0.3 x INT of the caster x abilitylevel ?

+rep for sure^^and credits in my map^^

thanks in advance

greetz clapto
 
Level 17
Joined
Jul 17, 2011
Messages
1,863
damage is not made too cusomizable in this spell i dont know why however in this method:
JASS:
 method onDestroy takes nothing returns nothing

            call UnitRemoveAbility(.target,'Amrf')
            call PauseUnit(.target,false)
            call UnitDamageTarget(.caster,.target,GetImpactDamage(GetUnitAbilityLevel(.caster,SID)),false,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS)
            call DestroyEffect(AddSpecialEffect(IMPACT_SFX,GetUnitX(.target),GetUnitY(.target)))
            call TerrainDeformCrater(GetUnitX(.target),GetUnitY(.target),CRATER_RADIUS,CRATER_DEPTH,R2I(CRATER_DUR * 1000),false)
            call GroupRemoveUnit(SAFE_GROUP,.target)

        endmethod

where it says "GetImpactDamage(GetUnitAbilityLevel(.caster,SID))" can be replaced with any variable you want, for example you can use

Event - unit begins casting an ability

Condition - ability being cast = your ability

Actions
set a_real_variable = getabilitylevel(abilty being cast) * (0.3 X int(get casting unit, (include bonuses))

then just replace "GetImpactDamage(GetUnitAbilityLevel(.caster,SID))" with "udg_a_real_variable" and it should work
 
You have to edit the code again. You can either do what gorillabull said or change the code to this:
JASS:
    private constant function GetImpactDamage takes unit u, real level returns real
        return 0.3 * GetHeroInt(u) * level
    endfunction
Then change the input values in onDestroy accordingly:
JASS:
    method onDestroy takes nothing returns nothing
           call UnitRemoveAbility(.target,'Amrf')
           call PauseUnit(.target,false)
           call UnitDamageTarget(.caster,.target,GetImpactDamage(.caster, GetUnitAbilityLevel(.caster,SID)),false,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS)
           call DestroyEffect(AddSpecialEffect(IMPACT_SFX,GetUnitX(.target),GetUnitY(.target)))
           call TerrainDeformCrater(GetUnitX(.target),GetUnitY(.target),CRATER_RADIUS,CRATER_DEPTH,R2I(CRATER_DUR * 1000),false)
           call GroupRemoveUnit(SAFE_GROUP,.target)
    endmethod
 
Status
Not open for further replies.
Top