• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Customizing Fan of Knives

Status
Not open for further replies.
Level 3
Joined
Oct 10, 2019
Messages
42
I'm stuck on Fan of Knives which I have given missile art as frost arrows, but instead of hitting all targets surrounding my Hero it only attacks 3 random units. I also played around with maximum no. of targets allowed, still no avail..Also, is it possible to edit Fan of Knives effect? If yes, then how?
 
Last edited:

Uncle

Warcraft Moderator
Level 66
Joined
Aug 10, 2018
Messages
6,745
What do you mean by edit the Fan of Knives effect? Like in a Model Editing program?

Anyway, I tested Fan of Knives and it's working fine. You can change both the Art - Effect and Art - Missile.

These 2 fields are probably causing the problem:
Targets Allowed
Maximum Total Damage

Here's a picture of my working setup.
 

Attachments

  • fan.png
    fan.png
    54.3 KB · Views: 85
Last edited:
Level 3
Joined
Oct 10, 2019
Messages
42
What do you mean by edit the Fan of Knives effect? Like in a Model Editing program?

Anyway, I tested Fan of Knives and it's working fine. You can change both the Art - Effect and Art - Missile.

Targets Allowed -> 0 means that there is no limit to the number of targets.
Maximum Total Damage -> This is used to prevent the ability from dealing more than this much total damage. Blizzard added this to balance Fan of Knives since it would be too powerful if it could do full damage to each enemy unit in the area.

Here's a picture of what I did to it.
I know, Fan of Knives is working perfectly, but only when I customize it for my required spell, the targets hit are only three..
 

Uncle

Warcraft Moderator
Level 66
Joined
Aug 10, 2018
Messages
6,745
Not sure what you mean. Do you mean that you created a copy of the ability and the copy doesn't work? I've seen issues like that before where the original ability/buff works but copies of it do not.

In my picture I have a working example of it. Just copy that and you're good to go.
 
Last edited:
Level 7
Joined
Nov 17, 2019
Messages
224
@Khush352

Ok, if you want the ability to hit all the units surrounding the target leaves the maximum number of targets at 0 but set maximal total damage to 99,999

The way this ability works is that it will divide the maximal total damage by the damage per target to determine the amount of targets the ability will hit

For example if you set the damage per target to 100 while the maximal total damage is 500, it will hit 5 targets for 100 damage each, if the damage per target remains at 100 and you set the maximal total damage to 1000, it will hit 10 units for 100 damage each......etc.
 

EdgeOfChaos

E

EdgeOfChaos

If you want it to be completely customizable, Fan of Knives is one of the simplest spells in the game to code from scratch. You can make a dummy skill that does nothing, and when it's cast you create a Fan of Knives effect, then select every unit in range and deal damage. If you use dummy skills you can even do cool things like a Fan of Knives that slows or stuns or something.

Simple code for a Fan of Knives:
JASS:
scope FanOfKnives initializer onInit

    private function onFilter takes nothing returns boolean
        return GetSpellAbilityId() == 'A000' //custom id of spell
    endfunction

    private function onCast takes nothing returns nothing
        local group unitsInRangeGroup = CreateGroup()
        local unit casterUnit = GetTriggerUnit()
        local real x = GetUnitX(casterUnit)
        local real y = GetUnitY(casterUnit)
        local unit fog = null
        local effect spellEffect = AddSpecialEffect("Abilities\\Spells\\NightElf\\FanOfKnives\\FanOfKnivesCaster.mdl", x, y)

        // Select nearby units
        call GroupEnumUnitsInRange(unitsInRangeGroup, x, y, 500, null)
       
        // Deal damage to enemies
        loop
            set fog = FirstOfGroup(unitsInRangeGroup)
            exitwhen fog == null
            if(IsUnitEnemy(casterUnit, GetOwningPlayer(fog))) then
                call UnitDamageTarget(casterUnit, fog, 300, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_ENHANCED, WEAPON_TYPE_WHOKNOWS)
            endif
            call GroupRemoveUnit(unitsInRangeGroup, fog)
        endloop
       
        // Cleanup
        call DestroyEffect(spellEffect)
        set spellEffect = null
        call DestroyGroup(unitsInRangeGroup)
        set unitsInRangeGroup = null
        set casterUnit = null
    endfunction

    private function onInit takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddAction(t, function onCast)
        call TriggerAddCondition(t, Condition(function onFilter))
        set t = null
    endfunction
   
endscope
 
Last edited by a moderator:
Level 3
Joined
Oct 10, 2019
Messages
42
@Khush352

Ok, if you want the ability to hit all the units surrounding the target leaves the maximum number of targets at 0 but set maximal total damage to 99,999

The way this ability works is that it will divide the maximal total damage by the damage per target to determine the amount of targets the ability will hit

For example if you set the damage per target to 100 while the maximal total damage is 500, it will hit 5 targets for 100 damage each, if the damage per target remains at 100 and you set the maximal total damage to 1000, it will hit 10 units for 100 damage each......etc.
It worked! Thanks for your insight though.
Thread Closed!
 
Last edited:
Status
Not open for further replies.
Top