| 01-10-2007, 09:36 PM | #1 |
Ok, I have a spell, Crashing Claw. It's SUPPOSED to stun the target and slow the caster. Rather, for some reason, it slows the target and the stun never happens to anyone. Here is my script... I've checked it over a few times but it doesn't seem to want to work. And yes, I've checked Targets Allowed for the dummy spells used to stun/slow. JASS:function Crashing_Claw_Conditions takes nothing returns boolean return ( GetSpellAbilityId() == 'A00C' ) endfunction function MinusStrengthText takes nothing returns nothing local unit u = GetTriggerUnit() local texttag t = CreateTextTagUnitBJ("-1 strength!", u, 0.0, 12, 100.0, 0, 0, 0) local real x_velocity = TextTagSpeed2Velocity(50.) * Cos(90 * (3.1415 / 180)) local real y_velocity = TextTagSpeed2Velocity(50.) * Sin(90 * (3.1415 / 180)) call SetTextTagVelocity(t, x_velocity, y_velocity) call SetTextTagLifespan(t, 2) call SetTextTagFadepoint(t, 1.5) call SetTextTagPermanent(t, false) set u = null set t = null endfunction function Crashing_Claw_Actions takes nothing returns nothing local unit u = GetTriggerUnit() local unit u2 = GetSpellTargetUnit() local unit u3 = CreateUnit(GetOwningPlayer(u), 'e001', GetUnitX(u), GetUnitY(u), 270.0) local unit u4 = CreateUnit(GetOwningPlayer(u2), 'e001', GetUnitX(u), GetUnitY(u), 270.0) local integer lvl = GetUnitAbilityLevel(u, 'A00C') local integer str = GetHeroStr(u, true) * 3 local integer i = GetRandomInt(1, 100) local integer i2 = 8 + lvl*2 call UnitDamageTarget(u, u2, str, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null) call SetUnitAbilityLevel(u3, 'A00D', lvl) call SetUnitAbilityLevel(u4, 'A00L', lvl) call IssueTargetOrder(u3, "thunderbolt", u2) call IssueTargetOrder(u4, "cripple", u) if i < i2+1 then set str = GetHeroStr(u, true) call SetHeroStr(u, str - 1, true) call MinusStrengthText() endif call UnitApplyTimedLife(u3, 'BTLF', 2.0) call UnitApplyTimedLife(u4, 'BTLF', 2.0) set u = null set u2 = null set u3 = null set u4 = null endfunction //=========================================================================== function InitTrig_Crashing_Claw takes nothing returns nothing local trigger t = CreateTrigger() call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( t, Condition( function Crashing_Claw_Conditions ) ) call TriggerAddAction( t, function Crashing_Claw_Actions ) set t = null endfunction |
| 01-10-2007, 09:53 PM | #2 |
Ummm, maybe try using Storm Bolt as the base ability. -Av3n |
| 01-10-2007, 09:56 PM | #3 |
That would work, but this kind of thing has happened with a multitude of other abilities. Any idea why? I can't seem to make heads or tails of why the dummy units refuse to cast their abilities. Some work, other don't, and i can't figure out why. It is usually the negative spells that don't want to work on the caster. |
| 01-10-2007, 10:04 PM | #4 | ||
Make sure of a few things -- A) You're using the correct order string for the orders that correspond to your dummy abilities B) Your dummy abilities cost no mana C) Your dummy units have a 0.000 casting point and a 0.000 cast backswing Quote:
Quote:
I would bet you have them backwards. However, since the slow casts and the stun doesn't, I would be willing to bet your dummy units are okay and it's a problem with the dummy abilities. |
| 01-10-2007, 10:09 PM | #5 |
It might be an issue with the abilities being targeted on allies. If the unit stunning/slowing fails it might attempt to do so on it's enemy, but I don't really know for sure. Edit: Hmm... Oops... Looks like I've forgotten how to read... Ignore me... |
| 01-10-2007, 10:21 PM | #6 | |
Quote:
Check, check, and... nope. Hm. I'll check the last one out. I checked over my dummy abilities and all that. The dummy units target the right units; just check the script. It might be something else though, I'll check fully in a bit. |
| 01-10-2007, 10:53 PM | #7 |
Check also that the range on your dummy abilities is 99999 or that you spawn the dummy units next to their respective targets. Make sure your dummy units HAVE the dummy spells. I do notice you're not adding the abilities in-code, yet both of the dummies are the exact same unit type. So if the dummy doesn't have the ability, there's your issue. Also, like I said -- (Just want to make sure you didn't miss it) The targets for the dummy abilities are backwards. Creep Thunderbolt should be cast on u2, and Cripple on u. |
| 01-10-2007, 10:59 PM | #8 | |
Quote:
JASS:call IssueTargetOrder(u3, "thunderbolt", u2) call IssueTargetOrder(u4, "cripple", u) And yes, they have the ability. I checked. But I'll double check. Maybe I should start adding the ability through coding, to be 100% sure it's there. I might even set up a bunch of function for the purpose of adding dummies with the abilities and all that. Hm. |
| 01-10-2007, 11:21 PM | #9 |
Well if it's casting it on the wrong unit, then it's a targeting issue or a point of creation issue. JASS:local unit u3 = CreateUnit(GetOwningPlayer(u), 'e001', GetUnitX(u), GetUnitY(u), 270.0) local unit u4 = CreateUnit(GetOwningPlayer(u2), 'e001', GetUnitX(u), GetUnitY(u), 270.0) Make sure the range on the stun & slow is large enough to reach their respective units. Also, you create the abilities for the owner of the unit that dummy is targeting. So triple check targeting, and then if it still fails, do this -- JASS:set BoolOne = IssueTargetOrder(u3, "thunderbolt", u2) set BoolTwo = IssueTargetOrder(u4, "cripple", u) If either returns false, then it is 100% a problem with dummy abils/units. There really isn't much else to say. If you've checked everything and everything is perfect, then it will work. That's how it is. |
| 01-10-2007, 11:28 PM | #10 |
Alright, thanks. I'll triple check everything and see what could be causing it. |
