Unholy Blade - Spell Help

Archideas

Active Member
Reaction score
32
This is probably a more odd request if anything, but I found this spell on Hive Workshop that I took a very strong liking to, but unfortunately it's rather old and therefor bugged and some changes are needed.

This is where the problem rises. I'm not capable of Jass, vJass, Zinc or any other coding language that the World Editor uses except for GUI. The spell is in Jass and does not utilize a damage detection system so it's rather poor in that aspect, but the idea is what makes me want to perfect it for my benefit. Here's the description of the spell itself.

Enhances Kelendor's blade with the power to steal souls, allowing him to store his victim's souls in his weapon. Kelendor can at any time unleash all the stored souls, allowing the next attack to unleash an incredible blow, throwing the enemy away and dealing 20 damage per soul.

Level 1 - Max 4 souls.
Level 2 - Max 6 souls.
Level 3 - Max 8 souls.

This in turn gives the hero another ability which allows him to enhance his blade with the souls, dealing extra damage on the next attack.

Enchants Kelendor's blade with the power of his stored souls, allowing the next attack to deal 20 times the current souls as extra damage and throwing the enemy backwards.

In the Spellpack I found this ability in, this ability uses a Jump system to throw the enemy backwards by about 350 units, which I want changed to nothing more than a simple attack, followed up by a modified thunderclap.

The way the spell works now is that whenever you kill an enemy unit, it adds 1 "soul" to the integer and when you activate the second ability given to you, the next attack made will unleash the souls and throw the enemy backwards.

The other effect I'm looking for is that instead of simply dealing the damage via a trigger, I'd prefer if for each soul unleashed into the blade before attacking, his attack damage would increase by 20 for each soul.

These are the Jass triggers themselves. If anyone has a solution to this dilemma, I'd be more than thankful for a helping hand.

Unholy Blade
JASS:
function Trig_UnholyBladeCheck takes nothing returns boolean
    return GetUnitAbilityLevel(GetKillingUnit(), 'A004') > 0
endfunction

function Trig_Unholy_Blade_Actions takes nothing returns nothing
    local unit U = GetKillingUnit()
    local player p = GetOwningPlayer(U)
    local integer maxsouls = 2 + (2*GetUnitAbilityLevel(U, 'A004'))
    if udg_KR_KillCount[GetPlayerId(p) + 1] < (maxsouls + 1) then
        set udg_KR_KillCount[GetPlayerId(p) + 1] = udg_KR_KillCount[GetPlayerId(p) + 1] + 1
        call CreateTextTagUnit( I2S(udg_KR_KillCount[GetPlayerId(p) + 1]) + "/" + I2S(maxsouls) + " Souls!", U, 0.00, 10.00, 200, 200, 200, 255, 0, 0.03, 3.00, false, true)
    endif
endfunction

//===========================================================================
function InitTrig_UnholyBlade takes nothing returns nothing
    local integer index
    set gg_trg_UnholyBlade = CreateTrigger(  )
    

    set index = 0
    loop
        call TriggerRegisterPlayerUnitEvent(gg_trg_UnholyBlade, Player(index), EVENT_PLAYER_UNIT_DEATH, Filter(function AntiLeak))

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
    call TriggerAddCondition( gg_trg_UnholyBlade, Condition( function Trig_UnholyBladeCheck ) )
    call TriggerAddAction( gg_trg_UnholyBlade, function Trig_Unholy_Blade_Actions )
endfunction


Unholy Blade Attack
JASS:
function Trig_UnholyBladeAttackCheck takes nothing returns boolean
    local player P = GetOwningPlayer(GetAttacker())
    return GetUnitAbilityLevel(GetAttacker(), 'A004') > 0 and udg_KR_HitOrNo[GetPlayerId(P) + 1]
endfunction

function Trig_Unholy_Blade_Attack_Actions takes nothing returns nothing
    local unit U = GetAttacker()
    local unit u = GetTriggerUnit()
    local player p = GetOwningPlayer(U)
    local integer maxsouls = 2 + (2*GetUnitAbilityLevel(U, 'A004'))
    local real x = GetUnitX(U)
    local real y = GetUnitY(U)
    local real x1 = GetUnitX(u)
    local real y1 = GetUnitY(u) 
    local real d = Atan2(y1 - y, x1 - x)
    local real x2 = x1 + 350 * Cos(d)
    local real y2 = y1 + 350 * Sin(d)
    call QueueUnitAnimation(U, "attack slam")
    
    call CreateTextTagUnit( "Unleash! +" + I2S(R2I(20.00*udg_KR_KillCount[GetPlayerId(p) + 1])) + " Damage", U, 0.00, 10.00, 100, 100, 100, 255, 0, 0.03, 5.00, false, true)
    call DestroyEffect(udg_KR_Effect[GetPlayerId(p) + 1])
    call Jump(u, 0.50, x2, y2, 1.80, 100, "Abilities\\Weapons\\AvengerMissile\\AvengerMissile.mdl", "war3mapImported\\Desecrate.mdx")
    call UnitDamageTarget(U, u, 20.00*udg_KR_KillCount[GetPlayerId(p) + 1], true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
    set udg_KR_KillCount[GetPlayerId(p) + 1] = 0
    set udg_KR_HitOrNo[GetPlayerId(p) + 1] = false
    set U = null
    set u = null
endfunction

//===========================================================================
function InitTrig_UnholyBladeAttack takes nothing returns nothing
    local integer index
    call Preload("Abilities\\Weapons\\ZigguratMissile\\ZigguratMissile.mdl")
    set gg_trg_UnholyBladeAttack = CreateTrigger(  )
    

    set index = 0
    loop
        call TriggerRegisterPlayerUnitEvent(gg_trg_UnholyBladeAttack, Player(index), EVENT_PLAYER_UNIT_ATTACKED, Filter(function AntiLeak))

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
    call TriggerAddCondition( gg_trg_UnholyBladeAttack, Condition( function Trig_UnholyBladeAttackCheck ) )
    call TriggerAddAction( gg_trg_UnholyBladeAttack, function Trig_Unholy_Blade_Attack_Actions )
endfunction


Unholy Blade Activate
JASS:
function Trig_UnholyBladeActivate_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A006' 
endfunction

function Trig_UnholyBladeActivate_Actions takes nothing returns nothing
    local unit caster = GetSpellAbilityUnit()
    local player casterowner = GetOwningPlayer(caster)
    if udg_KR_KillCount[GetPlayerId(casterowner) + 1] > 0 then
        set udg_KR_HitOrNo[GetPlayerId(casterowner) + 1] = true
        set udg_KR_Effect[GetPlayerId(casterowner) + 1] = AddSpecialEffectTarget("Abilities\\Weapons\\AvengerMissile\\AvengerMissile.mdl", caster, "weapon")
    endif
    set caster = null
endfunction

//===========================================================================
function InitTrig_UnholyBladeActivate takes nothing returns nothing
    set gg_trg_UnholyBladeActivate = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_UnholyBladeActivate, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_UnholyBladeActivate, Condition( function Trig_UnholyBladeActivate_Conditions ) )
    call TriggerAddAction( gg_trg_UnholyBladeActivate, function Trig_UnholyBladeActivate_Actions )
endfunction


P.S

The Jump system itself is in the MapName.w3x so I didn't bother copying it as it would be deleted anyway.
 

hgkjfhfdsj

Active Member
Reaction score
55
Trigger:
  • Unholy Blade
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Acid Bomb for (Killing unit)) Greater than 0
    • Actions
      • Set Max_Souls = (2 + (2 x (Level of Acid Bomb for (Killing unit))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Kill_Count[(Player number of (Triggering player))] Less than (Max_Souls + 1)
        • Then - Actions
          • Set Kill_Count[(Player number of (Triggering player))] = (Kill_Count[(Player number of (Triggering player))] + 1)
          • Floating Text - Create floating text that reads (((String(Kill_Count[(Player number of (Triggering player))])) + (/ + (String(Max_Souls)))) + Souls!) above (Killing unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Else - Actions

Trigger:
  • Unholy Blade Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Level of Acid Bomb for (Attacking unit)) Greater than 0) and (KR_HitOrNo[(Player number of (Triggering player))] Equal to True)
    • Actions
      • Set Max_Souls = (2 + (2 x (Level of Acid Bomb for (Killing unit))))
      • Animation - Queue (Attacking unit)'s attack slam animation
      • Floating Text - Create floating text that reads (Unleash! + ((String(Kill_Count[(Player number of (Triggering player))])) + Damage)) above (Attacking unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Unit - Cause (Attacking unit) to damage (Triggering unit), dealing (20.00 x (Real(Kill_Count[(Player number of (Triggering player))]))) damage of attack type Normal and damage type Normal
      • Special Effect - Destroy KR_Effect[(Player number of (Triggering player))]
      • Set Kill_Count[(Player number of (Triggering player))] = 0
      • Set KR_HitOrNo[(Player number of (Triggering player))] = False

Trigger:
  • Unholy Blade Activate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
      • Kill_Count[(Player number of (Triggering player))] Greater than 0
    • Actions
      • Set KR_HitOrNo[(Player number of (Triggering player))] = True
      • Special Effect - Create a special effect attached to the weapon of (Triggering unit) using Abilities\Weapons\AvengerMissile\AvengerMissile.mdl
      • Set KR_Effect[(Player number of (Triggering player))] = (Last created special effect)


- CreateTextTagUnit() seems like a custom function, not sure what the last few parameters are. (most likely lifespan, velocity, fade time etc)
- i may have made a mistake somewhere, but the general idea is there
- this spell is MPI (if you are not aware)

Variables
KR_Effect -- special effect array
Kill_Count -- integer array
Max_Souls -- integer
KR_HitOrNo -- Boolean array

The other effect I'm looking for is that instead of simply dealing the damage via a trigger, I'd prefer if for each soul unleashed into the blade before attacking, his attack damage would increase by 20 for each soul.
for this you can use the item damage bonus ability with the number of levels equal to the number of max soul, then add this on spell cast, setting the ability's level, and removing it on damage (damage detection) or when Unholy Blade Attack has fired.
 

Archideas

Active Member
Reaction score
32
Thanks alot for your GUI version of this. I'm experiencing some problems, though. When I activate Unleash Souls after I've killed a few units, there's no effect on the weapon and the "souls" aren't unleashed either. This is what my triggers look like so far.

Trigger:
  • Soul Snatcher
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Soul Snatcher for (Killing unit)) Greater than 0
    • Actions
      • Set Max_Souls = (2 + (2 x (Level of Soul Snatcher for (Killing unit))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KillCount[(Player number of (Triggering player))] Less than (Max_Souls + 1)
        • Then - Actions
          • Set KillCount[(Player number of (Triggering player))] = (KillCount[(Player number of (Triggering player))] + 1)
          • Floating Text - Create floating text that reads (((String(KillCount[(Player number of (Triggering player))])) + (/ + (String(Max_Souls)))) + Souls!) above (Killing unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        • Else - Actions


Trigger:
  • Soul Snatcher Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Level of Soul Snatcher for (Attacking unit)) Greater than 0) and (KR_HitOrNo[(Player number of (Triggering player))] Equal to True)
    • Actions
      • Set TempPoint = (Position of (Attacked unit))
      • Set Max_Souls = (2 + (2 x (Level of Soul Snatcher for (Killing unit))))
      • Animation - Queue (Attacking unit)'s attack 1 animation
      • Floating Text - Create floating text that reads (Unleash! + ((String(KillCount[(Player number of (Triggering player))])) + Damage)) above (Attacking unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Unit - Cause (Attacking unit) to damage (Triggering unit), dealing (20.00 x (Real(KillCount[(Player number of (Triggering player))]))) damage of attack type Normal and damage type Normal
      • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
      • Unit - Add Unleash Souls AoE Damage to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Special Effect - Destroy KR_Effect[(Player number of (Triggering player))]
      • Set KillCount[(Player number of (Triggering player))] = 0
      • Set KR_HitOrNo[(Player number of (Triggering player))] = False


Trigger:
  • Soul Snatcher Activate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Unleash Souls
      • KillCount[(Player number of (Triggering player))] Greater than 0
    • Actions
      • Set KR_HitOrNo[(Player number of (Triggering player))] = True
      • Special Effect - Create a special effect attached to the weapon of (Triggering unit) using Abilities\Weapons\AvengerMissile\AvengerMissile.mdl
      • Set KR_Effect[(Player number of (Triggering player))] = (Last created special effect)


I might've missed something very obvious but it happens. xP
 

Ayanami

칼리
Reaction score
288
Just made this spell, though didn't follow the above triggers. It's fully MUI. Only fault might be that the damage trigger is not 100% accurate. If the attacked unit takes damage before the the unit is actually hit, the damage will be removed. This won't really happen for melee units though. Posted the demo map too.

Trigger:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Base ability. --------
      • Set UBAbility[0] = Unholy Blade
      • -------- Skill that unleashes souls --------
      • Set UBAbility[1] = Unleash Souls
      • -------- Skill that acts as the number of souls. Displays number of souls in-game. --------
      • Set UBAbility[2] = Souls
      • -------- Skill that adds the damage. Damage amount and special effect is set here. --------
      • Set UBAbility[3] = Unholy Blade (Damage)
      • -------- The thunder clap skill. --------
      • Set UBAbility[4] = Unholy Blade (Thunder Clap)
      • -------- Dummy unit that casts Thunder Clap --------
      • Set CasterDummy = Caster Dummy


Trigger:
  • Unholy Blade Learned
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Unholy Blade
    • Actions
      • Unit - Add UBAbility[1] to (Triggering unit)
      • Unit - Add UBAbility[2] to (Triggering unit)


Trigger:
  • Unholy Blade
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of UBAbility[0] for (Killing unit)) Greater than 0
      • (Level of UBAbility[2] for (Killing unit)) Less than ((2 + (2 x (Level of UBAbility[0] for (Killing unit)))) + 1)
    • Actions
      • Set TempInt = ((Level of UBAbility[2] for (Killing unit)) + 1)
      • Unit - Remove UBAbility[2] from (Triggering unit)
      • Unit - Add UBAbility[2] to (Killing unit)
      • Unit - Set level of UBAbility[2] for (Killing unit) to TempInt


Trigger:
  • Unholy Blade Activate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to UBAbility[1]
      • (Level of UBAbility[2] for (Triggering unit)) Greater than 1
    • Actions
      • -------- Adding the damage and the visual effect. --------
      • Unit - Add UBAbility[3] to (Triggering unit)
      • Unit - Set level of UBAbility[3] for (Triggering unit) to ((Level of UBAbility[2] for (Triggering unit)) - 1)
      • -------- Set the soul count to 0, which is actually level 1 of the spell "Souls". --------
      • Unit - Set level of UBAbility[2] for (Triggering unit) to 1
      • -------- Visual cast effects. --------
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempReal = 0.00
      • For each (Integer A) from 1 to (Level of UBAbility[3] for (Triggering unit)), do (Actions)
        • Loop - Actions
          • Set TempOffset = (TempPoint offset by 200.00 towards TempReal degrees)
          • Special Effect - Create a special effect at TempOffset using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set TempReal = (TempReal + (360.00 / (Real((Level of UBAbility[3] for (Triggering unit))))))
          • Custom script: call RemoveLocation(udg_TempOffset)
      • Custom script: call RemoveLocation(udg_TempPoint)


Trigger:
  • Unholy Blade Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of UBAbility[3] for (Attacking unit)) Greater than 0
      • ((Triggering unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in UBUnitGroup) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit Group - Add (Triggering unit) to UBUnitGroup
          • Trigger - Add to Unholy Blade Damage <gen> the event (Unit - (Triggering unit) Takes damage)
      • Trigger - Turn on (This trigger)


Trigger:
  • Unholy Blade Damage
    • Events
    • Conditions
      • (Level of UBAbility[3] for (Damage source)) Greater than 0
    • Actions
      • Trigger - Turn off (This trigger)
      • Set TempPoint = (Position of (Triggering unit))
      • -------- Removing the damage. --------
      • Unit - Remove UBAbility[3] from (Damage source)
      • -------- Thunder Clap. --------
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Create 1 CasterDummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
      • Unit - Add UBAbility[4] to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Trigger - Turn on (This trigger)
 

Archideas

Active Member
Reaction score
32
This one works very nicely, Glenphir! Thanks alot for your help, both of you. One last thing, though. How and where should I add the special effect to his weapon when activating the Unleash Souls ability?
 

Ayanami

칼리
Reaction score
288
This one works very nicely, Glenphir! Thanks alot for your help, both of you. One last thing, though. How and where should I add the special effect to his weapon when activating the Unleash Souls ability?

The Special Effect should be there already. You can change it under the ability "Unholy Blade (Damage)". Should be in the "Art" section.
 

Archideas

Active Member
Reaction score
32
Oh, right. I made that ability myself and didn't notice you had put the special effect there. Thanks again for all your help.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top