1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Melee spell request....

Discussion in 'Requests' started by cheesdude, Nov 2, 2006.

  1. cheesdude

    cheesdude

    Joined:
    Apr 2, 2005
    Messages:
    480
    Resources:
    0
    Resources:
    0
    Well i'm looking for a simple melee spell and since i'm terrible at spell making i guess i'll put in a request.


    Caled great strike or something where the hero attacks and charges forward slashing everything in an area and moving....

    Please reply or PM me if you thinking of doing this favor. Also if you need further explanations.
     
  2. LordZsar1

    LordZsar1

    Joined:
    May 22, 2006
    Messages:
    150
    Resources:
    0
    Resources:
    0
    This is a prerelease. ^^
    The burning after being hit is not yet implemented, but will follow.
    (additionally damaging the target would be not much more work, so you may rethink this...)
    Just in case you want something to be changed:

    Code (vJASS):
    function Trig_Foescythe_Unitfilter takes nothing returns boolean
      return GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE) > 0 and IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()),GetOwningPlayer(GetFilterUnit()))
    endfunction

    function Trig_Foescythe_Actions takes nothing returns nothing
      local effect fireStart
      local effect fireHit1
      local effect fireHit2
      local group targets
      local filterfunc unitfilter
      local integer strikes
      local integer strikesMax
      local lightning bolt
      local real modificator
      local real scytherX
      local real scytherY
      local real targetX
      local real targetY
      local timer iLoopOverride
      local unit scyther
      local unit target
      if GetSpellAbilityId() == <Name of Ability> then
        set targets = CreateGroup()
        set unitfilter = Filter(function Trig_Foescythe_Unitfilter)
        set scyther = GetTriggerUnit()
        set strikes = 0
        set strikesMax = GetUnitAbilityLevel(scyther, <Name of Ability> )
        set iLoopOverride = CreateTimer()
        set target = null
        loop
          set scytherX = GetUnitX(scyther)
          set scytherY = GetUnitY(scyther)
          call GroupEnumUnitsInRange(targets,scytherX,scytherY,600,unitfilter)
          call TimerStart(iLoopOverride,1,false,null)
          loop
            call TriggerSleepAction(0.003)
            exitwhen FirstOfGroup(targets) != null or TimerGetRemaining(iLoopOverride) <= 0
          endloop
          call GroupRemoveUnit(targets,target)
          if FirstOfGroup(targets) != null then
            set bj_groupRandomConsidered = 0
            set target = bj_groupRandomCurrentPick
            call ForGroup(targets,function GroupPickRandomUnitEnum)
            call TimerStart(iLoopOverride,0.5,false,null)
            loop
              call TriggerSleepAction(0.003)
              exitwhen bj_groupRandomCurrentPick != target or TimerGetRemaining(iLoopOverride) <= 0
            endloop
            set target = bj_groupRandomCurrentPick
            call GroupClear(targets)
            set targetX = GetUnitX(target)
            set targetY = GetUnitY(target)
            set fireStart = AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",scytherX,scytherY)
            set bolt = AddLightning("AFOD",true,scytherX,scytherY,targetX,targetY)
            set modificator = (targetX + targetY - 50) / (targetX + targetY)
            call SetUnitFacing(scyther,180 * Atan2(targetY - scytherY,targetX - scytherX) / 3.14159)
            call SetUnitPosition(scyther,targetX * modificator,targetY * modificator)
            call SetUnitAnimation(scyther,"attack")
            call UnitDamageTarget(scyther,target,GetHeroAgi(scyther,true) + 0.5 * GetHeroAgi(scyther,true) * GetUnitAbilityLevel(scyther,'A002'),true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_FIRE,WEAPON_TYPE_METAL_HEAVY_SLICE)
            set fireHit1 = AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",targetX,targetY)
            set fireHit2 = AddSpecialEffect("Objects\\Spawnmodels\\Human\\SmallFlameSpawn\\SmallFlameSpawn.mdl",targetX,targetY)
            set strikes = strikes + 1
            call TriggerSleepAction(0.01)
            call DestroyEffect(fireStart)
            call DestroyEffect(fireHit1)
            call DestroyEffect(fireHit2)
            call DestroyLightning(bolt)
          else
            set strikes = strikesMax
          endif
          exitwhen strikes >= strikesMax
        endloop
        call DestroyGroup(targets)
        call DestroyFilter(unitfilter)
        call DestroyTimer(iLoopOverride)
      endif
      set targets = null
      set unitfilter = null
      set iLoopOverride = null
      set scyther = null
      set target = null
    endfunction

    function InitTrig_Foescythe takes nothing returns nothing
      set gg_trg_Foescythe = CreateTrigger()
      call TriggerRegisterPlayerUnitEvent(gg_trg_Foescythe,Player(0),EVENT_PLAYER_UNIT_SPELL_CAST,null)
      call TriggerAddAction(gg_trg_Foescythe,function Trig_Foescythe_Actions)
    endfunction


    Just create a new trigger, call it "Foescythe", convert it into custom script and copy this stuff into.
    Then you need a hero ability, which does not need a specified target (I used a modified 'Aroa') and a hero to cast it of course.