Projectile that drains experience

Level 3
Joined
Jul 22, 2011
Messages
37
So, the title said it.
I've a projectile that deals damage but I also want it to make any hero that touches the flying projectile to lose experience. It also would be pretty nice to tweak the value depending on the level of this ability (I got 10 levels in my map). This is my current ability
  • function Trig_DaggersOfOblivion_Copy_Conditions takes nothing returns boolean
    • if ( not ( GetSpellAbilityId() == 'A01W' ) ) then
      • return false
    • endif
    • return true
  • endfunction
  • function Trig_DaggersOfOblivion_Copy_Actions takes nothing returns nothing
    • set bj_forLoopAIndex = 1
    • set bj_forLoopAIndexEnd = 2
    • loop
      • exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
      • set udg_MS_dmg_source = GetSpellAbilityUnit()
      • set udg_MS_owner = GetOwningPlayer(GetSpellAbilityUnit())
      • set udg_MS_create_point = GetUnitLoc(GetSpellAbilityUnit())
      • set udg_MS_target_point = GetSpellTargetLoc()
      • set udg_MS_damage = 20.00
      • set udg_MS_seconds_to_reach = 1.00
      • set udg_MS_angle = AngleBetweenPoints(udg_MS_create_point, udg_MS_target_point)
      • set udg_MS_distance = DistanceBetweenPoints(udg_MS_create_point, udg_MS_target_point)
      • set udg_MS_missile_gfx = "DaggersOfOblivion.mdx"
      • set udg_MS_impact_gfx = "Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl"
      • set udg_MS_unit_hit_eff = "Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodFootman.mdl"
      • set udg_MS_arcs = true
      • // If MS_arc = true aply the following settings
      • set udg_MS_arc_dist = 200.00
      • set udg_MS_arc_type = GetForLoopIndexA()
      • // ---
      • set udg_MS_parabola = true
      • // If MS_parabola = true aply the following settings
      • set udg_MS_parabola_height = 450.00
      • // ---
      • call TriggerExecute( gg_trg_MS_init )
      • call RemoveLocation(udg_MS_create_point)
      • call RemoveLocation(udg_MS_target_point)
      • set bj_forLoopAIndex = bj_forLoopAIndex + 1
    • endloop
  • endfunction
  • //===========================================================================
  • function InitTrig_DaggersOfOblivion_Copy takes nothing returns nothing
    • set gg_trg_DaggersOfOblivion_Copy = CreateTrigger( )
    • call TriggerRegisterAnyUnitEventBJ( gg_trg_DaggersOfOblivion_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    • call TriggerAddCondition( gg_trg_DaggersOfOblivion_Copy, Condition( function Trig_DaggersOfOblivion_Copy_Conditions ) )
    • call TriggerAddAction( gg_trg_DaggersOfOblivion_Copy, function Trig_DaggersOfOblivion_Copy_Actions )
  • endfunction

Thank you in advance.
 
Last edited:
Level 1
Joined
Jul 26, 2011
Messages
2
Lol

That is friggen awesome! Made a map with it as a secret spell. My friends went insane and kept yelling at me to quit doing that, Thanx a lot! LOL!:grin:
 
Level 5
Joined
Jun 30, 2004
Messages
170
I'm not so sure since I haven't tried this doing similar in a long time, but I am pretty sure that if you want heroes to lose experience and also lose levels, you're going to have to find out what values of experience a hero needs to level up. Warcraft 3 acts a little different when you want experience and levels removed instead of the opposite. Every time this ability activates and a unit loses experience, I think you have to use the function UnitStripHeroLevel, too.

Eeeeh, I really don't know too much about this since in my test map all I did was remove levels, not experience. Take my advice with a grain of salt. What I DO know is that if you want heroes to lose levels you must use UnitStripHeroLevel since SetUnitHeroLevel refuses to take negative values.
 
Level 3
Joined
Jul 22, 2011
Messages
37
This...?
  • Hero - Add -100 experience to (Triggering unit), Show level-up graphics

Why Add? I want to remove experience, not add. Either I misunderstood you or you misunderstood me...
I want a projectile that kills exp... like = -100 xp
 
Top