| 04-07-2007, 07:03 PM | #1 | |
2 Triggers stopped working after implenting Castersystem and Attack Detection System The Spells have worked before, but after implenting the Castersystem and Vexorians AttackDetect Engine they stopped working... This is a Spell of a Paladin, which gives him a 15% chance to get a 150HP heal JASS://after this func stopped working i modified it, so that it can be called using the attack detect engine... //i just added the "takes unit Damager" instead of a local unit u=GetTriggerUnit() library PI function PalaIronheart takes unit Damager returns nothing local location l=GetUnitLoc(Damager) local unit u=CreateUnitAtLoc(GetOwningPlayer(Damager),'n003',l,0) call RemoveLocation(l) call UnitAddAbilityBJ( 'A00C', u) if (GetRandomReal(0, 100.00) <= 15.00) then call BJDebugMsg("test") call IssueTargetOrderById(u, 852092,Damager) //order id of holybolt ... else endif call KillUnit(u) call RemoveUnit(u) set u=null set l=null endfunction endlibrary //forced by WE -.- function InitTrig_H_PALA_Ironheart takes nothing returns nothing endfunction //here the function which calls the function above ...(this function is called instead of the DamageTest func in Vexs AttackDetect Engine) function UnitDamaged takes nothing returns nothing local unit u=GetTriggerUnit() local unit a=GetEventDamageSource() if (AttackDetect_DamageByAttack()) then if (a!=null) then if ( IsUnitType(a, UNIT_TYPE_HERO) == true and GetUnitAbilityLevelSwapped('A00B',a) >= 1) then call PalaIronheart(a) endif else endif endif set u=null set a=null endfunction This Spell should give the Paladin higher Attackdamage (it makes SENSE to use this trigger ! you can guess why -.-) JASS:function Trig_PALA_Divine_Blessing_Conditions takes nothing returns boolean if (GetSpellAbilityId() == 'A00A') then return true else return false endif endfunction function Divine_Blessing takes nothing returns nothing local location l=GetUnitLoc(GetTriggerUnit()) local unit u=CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),'n003',l,0) call RemoveLocation(l) call UnitAddAbility(u,'A009') call SetUnitAbilityLevelSwapped( 'A009', u, GetUnitAbilityLevelSwapped('A00A', GetTriggerUnit()) ) call IssueTargetOrderById(u, 852066,GetTriggerUnit()) call KillUnit(u) call RemoveUnit(u) set l=null set u=null endfunction //=========================================================================== function InitTrig_H_PALA_Divine_Blessing takes nothing returns nothing set gg_trg_H_PALA_Divine_Blessing = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_H_PALA_Divine_Blessing, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_H_PALA_Divine_Blessing, Condition( function Trig_PALA_Divine_Blessing_Conditions ) ) call TriggerAddAction( gg_trg_H_PALA_Divine_Blessing, function Divine_Blessing ) endfunction I think the lines with the orderids stopped working ... Even this simple trigger stopped working, where it works in any other map
|
| 04-07-2007, 08:21 PM | #2 |
It would have been much more helpful if we could actually see the events of those functions... |
| 04-08-2007, 09:21 AM | #3 |
added the "Events" The error is either produced by Castersystem/Attack Detect Engine or JassNewGen Pack v2 The things highlighted stopped working after implenting the CasterSystem / attack detect engine.. i have no clue why EDIT... i found the bug ..the reason was that i changed the maximum movement speed of my caster unit (it was 0 before and i changed it to 522 because the casterunit of the CS-System had this Speed and i tought ..well Vex surely knows whats best so i changed the movement speed of my unit aswell) ...but why does this caus my triggers to fail ?!?! -strange |
| 04-08-2007, 01:43 PM | #4 |
Units with zero move speed can't be repositioned I think, still it doesn't make sense that it caused stuff to fail. Also I don't think speed was 0 in any of the cs maps. |
| 04-08-2007, 02:42 PM | #5 | |
it wasnt the fault of the castersystem itself ...i had a dummyunit already when importing the CasterSystem..i imported the caster-unit of the CS-system aswell. Then i saw that the speed of your caster unit was 522 so i changed the speed of mine to 522 too (it was 0 be4 and i never repositioned dummies). After that my spells didnt work anymore.. No i set the speed back to 0 and everthing is working again (as additional information .. Additional information about my dummy unit:
|
| 04-08-2007, 07:03 PM | #6 |
The spell the unit casts costs mana and previously the dummy unit had no mana to cast it? |
