So, I'm trying to make an MUI meteor spell. I've finished the trigger but the spell won't work as if the unit was only casting the dummy spell. Here's the trigger. Can anyone see what's wrong with it? I've checked everything else. The heroes have the right skill, dummy units have a model...etc.
WE also gives me errors when trying to save it saying that MR_Index is an undeclared variable so I couldn't use the usual custom scripts to some clear stuff up, making me resort to using that bj_wantDestroyGroup. Can anyone tell me how to write this trigger better? Oh and sorry if the spoiler tags don't work.
Trigger:
- Meteorain Setup
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Meteorain
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MR_Index Less than 1000
- Then - Actions
- Set MR_Index = (MR_Index + 1)
- Else - Actions
- Set MR_Index = 0
- If - Conditions
- Set MR_caster[MR_Index] = (Triggering unit)
- Set MR_loc[0] = (Target point of ability being cast)
- Set MR_Rect[MR_Index] = (Region centered at MR_loc[0] with size (400.00, 400.00))
- Set MR_damage[MR_Index] = (120.00 + ((Real((Level of Meteorain for MR_caster[MR_Index]))) x (Real((Strength of MR_caster[MR_Index] (Include bonuses))))))
- Trigger - Turn on Meteorain Periodic <gen>
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Trigger:
- Meteorain Periodic
- Events
- Time - Every 0.30 seconds of game time
- Conditions
- Actions
- Set MR_integer[MR_Index] = (MR_integer[MR_Index] + 1)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MR_integer[MR_Index] Equal to (Level of Meteorain for MR_caster[MR_Index])
- Then - Actions
- Custom script: call RemoveLocation(udg_MR_loc[0])
- Custom script: call RemoveLocation(udg_MR_loc[1])
- Custom script: call RemoveLocation(udg_MR_loc[2])
- Trigger - Turn off (This trigger)
- Else - Actions
- Set MR_loc[1] = (Random point in MR_Rect[MR_Index])
- Unit - Create 1 Meteors for (Owner of MR_caster[MR_Index]) at MR_loc[1] facing (Random angle) degrees
- Set MR_Meteor[MR_Index] = (Last created unit)
- Set MR_loc[2] = (Position of MR_Meteor[MR_Index])
- Unit - Add a 3.00 second Generic expiration timer to MR_Meteor[MR_Index]
- Special Effect - Create a special effect at MR_loc[2] using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
- Special Effect - Destroy (Last created special effect)
- Set MR_Group[MR_Index] = (Units within 150.00 of MR_loc[2] matching (((Matching unit) belongs to an enemy of (Owner of MR_caster[MR_Index])) Equal to True))
- Custom script: set bj_wantDestroyGroup = true
- Unit Group - Pick every unit in MR_Group[MR_Index] and do (Actions)
- Loop - Actions
- Unit - Cause MR_caster[MR_Index] to damage (Picked unit), dealing MR_damage[MR_Index] damage of attack type Chaos and damage type Normal
- Loop - Actions
- If - Conditions
- Events
WE also gives me errors when trying to save it saying that MR_Index is an undeclared variable so I couldn't use the usual custom scripts to some clear stuff up, making me resort to using that bj_wantDestroyGroup. Can anyone tell me how to write this trigger better? Oh and sorry if the spoiler tags don't work.