- Joined
- Jan 26, 2007
- Messages
- 4,789
Hey,
I was working on a completely triggered chain lightning, where you can upgrade the number of targets, damage, damage reduction and mana cost, but it doesn't work.
I'm a JASS-noob and still willing to learn more, but I need your help for that
This is my code:
(I know there is a BJ, but I don't know how to do it else).
The damage also isn't correct, it does 50 damage at level 2, while it should be at least 300 (Ability Level * 150 + Int + Variable).
This is probably a crappy code... but it would help if you say what's wrong ^^
Is there a problem with the hive's JASS script code?
The array indicators have become the ASCII-codes of the square brackets...
Thanks in advance.
I was working on a completely triggered chain lightning, where you can upgrade the number of targets, damage, damage reduction and mana cost, but it doesn't work.
I'm a JASS-noob and still willing to learn more, but I need your help for that
This is my code:
JASS:
function ChainLightning takes nothing returns nothing
local location p = (GetUnitLoc(GetTriggerUnit()))
local group g = CreateGroup()
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local unit dummy
local integer i = 0
call SetUnitManaBJ(caster, GetUnitState(caster, UNIT_STATE_MANA) - ((GetUnitAbilityLevel(caster, 'A016')*100) - (udg_Mana[1]*30)))
set dummy = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h000', p, 270.)
call UnitApplyTimedLife(dummy, 'BTLF', 2.00)
call IssueTargetOrder(dummy, "chainlightning", target)
call GroupEnumUnitsInRangeOfLoc(g, GetUnitLoc(target), 500, null)
call GroupRemoveUnit(g, target)
call UnitDamageTarget(caster, target, ((GetUnitAbilityLevel(caster, 'A001') * 150) + I2R(GetHeroInt(caster, true)) + udg_Damage[1]), true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
set p = null
set g = null
set dummy = null
loop
exitwhen i >= 1 + (GetUnitAbilityLevel(caster, 'A001') + (udg_Targets[1]))
set i = i + 1
call GroupEnumUnitsInRangeOfLoc(g, GetUnitLoc(target), 500, null)
set p = GetUnitLoc(target)
set dummy = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h000', p, 270.)
set target = FirstOfGroup(g)
call IssueTargetOrder(dummy, "chainlightning", target)
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call UnitDamageTarget(caster, target, ((GetUnitAbilityLevel(caster, 'A016') * 150) + I2R(GetHeroInt(caster, true)) + udg_Damage[1]), true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
set p = null
set g = null
set dummy = null
endloop
set dummy = null
set target = null
set caster = null
endfunction
What does it do at the moment?
Well, it creates 1 chain lightning to the targetted unit, but that's it... it stops after that, even if I increase the exitwhen amount.The damage also isn't correct, it does 50 damage at level 2, while it should be at least 300 (Ability Level * 150 + Int + Variable).
This is probably a crappy code... but it would help if you say what's wrong ^^
Notes
If there are some things not efficient, feel free to say so - if I (you) get this to work, I will probably trigger other abilities and I need all information I can get for that.Is there a problem with the hive's JASS script code?
The array indicators have become the ASCII-codes of the square brackets...
Thanks in advance.