• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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,864
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