- Joined
- Oct 31, 2009
- Messages
- 352
Simple Spell Problem (unsolved)
The following spell causes a fatal error when used and I can't for the life of me figure out why.
Heres what I have found:
- I THINK it only causes a fatal error at level 4
- It does not ALWAYS cause a fatal error (even if the ability is level 4)
Heres what it does:
Conjures a bolt of lightning that deals damage and then jumps to nearby enemy units. Each jump reduces damage dealt by 15%.
Level 1 - Deals 70-110 damage, jumps up to 3 times
Level 2 - Deals 160-200 damage, jumps up to 4 times
Level 3 - Deals 250-290 damage, jumps up to 5 times
Level 4 - Deals 340-380 damage, jumps up to 6 times
Heres the GUI code for it:
If anybody could please help I would greatly appreciate it. I really need this spell to work properly and cannot just use the basic chain lightning ability b/c I am planning to do some other things w/ it like give it the ability to crit and add to its damage.
Any useful help will be rewarded +rep
The following spell causes a fatal error when used and I can't for the life of me figure out why.
Heres what I have found:
- I THINK it only causes a fatal error at level 4
- It does not ALWAYS cause a fatal error (even if the ability is level 4)
Heres what it does:
Conjures a bolt of lightning that deals damage and then jumps to nearby enemy units. Each jump reduces damage dealt by 15%.
Level 1 - Deals 70-110 damage, jumps up to 3 times
Level 2 - Deals 160-200 damage, jumps up to 4 times
Level 3 - Deals 250-290 damage, jumps up to 5 times
Level 4 - Deals 340-380 damage, jumps up to 6 times
Heres the GUI code for it:
-
Chain Lightning Cast
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Chain Lightning (Ogre Magi)
-
-

Actions
-


Set ChainLight_Pos = (Position of (Target unit of ability being cast))
-


Set ChainLight_Caster = (Triggering unit)
-


Set ChainLight_Count = 0
-


Set ChainLight_AntiCount = (2 + (Level of Chain Lightning (Ogre Magi) for ChainLight_Caster))
-


Set ChainLight_Group = (Units within 650.00 of ChainLight_Pos matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of ChainLight_Caster)) Equal to True)))
-


Unit Group - Remove (Target unit of ability being cast) from ChainLight_Group
-


Set ChainLight_RL = (((90.00 x (Real((Level of Chain Lightning (Ogre Magi) for ChainLight_Caster)))) + ((Random real number between 0.00 and 40.00) - 20.00)))
-


Unit - Cause ChainLight_Caster to damage (Target unit of ability being cast), dealing ChainLight_RL damage of attack type Spells and damage type Normal
-


Trigger - Turn on Chain Lightning Tick <gen>
-
-
-
Chain Lightning Tick
-

Events
-


Time - Every 0.16 seconds of game time
-
-

Conditions
-

Actions
-


Set ChainLight_Count = (ChainLight_Count + 1)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




ChainLight_Count Less than ChainLight_AntiCount
-
-



Then - Actions
-




Unit Group - Pick every unit in ChainLight_Group and do (Actions)
-





Loop - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








Or - Any (Conditions) are true
-









Conditions
-










((Picked unit) is dead) Equal to True
-










(Owner of (Picked unit)) Equal to Neutral Passive
-
-
-
-







Then - Actions
-








Unit Group - Remove (Picked unit) from ChainLight_Group
-
-







Else - Actions
-
-
-
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Number of units in ChainLight_Group) Greater than 0
-
-





Then - Actions
-






Set ChainLight_TempGroup = (Random 1 units from ChainLight_Group)
-






Unit Group - Pick every unit in ChainLight_TempGroup and do (Actions)
-







Loop - Actions
-








Set ChainLight_Pos2 = (Position of (Picked unit))
-








Lightning - Create a Chain Lightning - Primary lightning effect from source ChainLight_Pos to target ChainLight_Pos2
-








Custom script: call RemoveLocation(udg_ChainLight_Pos2)
-








Custom script: call RemoveLocation(udg_ChainLight_Pos)
-








Set ChainLight_Pos = (Position of (Picked unit))
-








Set ChainLight_Lightning[ChainLight_Count] = (Last created lightning effect)
-








Unit Group - Remove (Picked unit) from ChainLight_Group
-








Set ChainLight_RL = (ChainLight_RL x 0.85)
-








Unit - Cause ChainLight_Caster to damage (Picked unit), dealing ChainLight_RL damage of attack type Spells and damage type Normal
-
-
-






Custom script: call DestroyGroup(udg_ChainLight_TempGroup)
-
-





Else - Actions
-
-
-



Else - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






ChainLight_Count Less than ((ChainLight_AntiCount x 2) - 1)
-
-





Then - Actions
-






Lightning - Destroy ChainLight_Lightning[(1 + (ChainLight_Count - ChainLight_AntiCount))]
-
-





Else - Actions
-






Custom script: call DestroyGroup(udg_ChainLight_Group)
-






Custom script: call RemoveLocation(udg_ChainLight_Pos)
-






Trigger - Turn off (This trigger)
-
-
-
-
-
-
If anybody could please help I would greatly appreciate it. I really need this spell to work properly and cannot just use the basic chain lightning ability b/c I am planning to do some other things w/ it like give it the ability to crit and add to its damage.
Any useful help will be rewarded +rep
Last edited:









