Solu9
You can change this now in User CP.
- Reaction score
- 216
I think I know the answer to this question but as the title says, I'm growing more paranoid and insecure.
I'll post an ability trigger and the actual damage calculation trigger:
Cleave:
Damage calculation:
As you can see I was in the middle of changing all conditions/actions arrays from [1] to [(Player number of (Owner of uDMGUnit))].
The reason was because I thought I was being clever by storing all data in arrays linked to the casting player. That way, I thought, I was completely sure that when another player used an ability at the same time nothing would overlap.
So far so good.
Then I to think, if I just use the array number of the owner of "uDMGUnit" in all of my spells it would be redundant to make arrays in the first place since they would all be linked to uDMGUnit through the trigger.
Suddenly the paranoia stoke again. So if two players use two different abilities, both of which refers back to uDMGUnit, can they possibly overlap if cast almost at the same time?
My initial answer is no. Everything happens in orders. Nothing can happen at the exact same time.
But I'm paranoid so I would like to have this confirmed.
Furthermore. If it is indeed true that I'm just freaking out and even though every spell refers back to uDMGUnit, can I just scratch all of my arrays and make them none arrays?
Sorry for the long post.
The paranoid.
P.s. Thanks for a great magazine.
I'll post an ability trigger and the actual damage calculation trigger:
Cleave:
Trigger:
- Cleave
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Cleaving Strike
- Actions
- Set uDMGUnit = (Triggering unit)
- Set pCleave = (Position of uDMGUnit)
- -------- ---------- --------
- -------- Set Ability used --------
- Set abilAbilityCasted[(Player number of (Owner of uDMGUnit))] = (Ability being cast)
- -------- ---------- --------
- -------- Set Ability multiplier --------
- Set rAbilityMultiplier[(Player number of (Owner of uDMGUnit))] = 0.25
- -------- ---------- --------
- -------- Set damage type --------
- Set booDmgType_Physical[(Player number of (Owner of uDMGUnit))] = True
- Set booDmgType_Fire[(Player number of (Owner of uDMGUnit))] = False
- Set booDmgType_Ice[(Player number of (Owner of uDMGUnit))] = False
- Set booDmgType_Light[(Player number of (Owner of uDMGUnit))] = False
- Set booDmgType_Poison[(Player number of (Owner of uDMGUnit))] = False
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of Cleaving Strike for uDMGUnit) Greater than or equal to 10
- Then - Actions
- Unit - Create 1 Dummy Unit Cleave - Armor Break for (Owner of uDMGUnit) at pCleave facing Default building facing degrees
- Unit - Set level of Dummy Cleave - Armor Break for (Last created unit) to (Level of Cleaving Strike for uDMGUnit)
- Unit - Order (Last created unit) to Night Elf Druid Of The Claw - Roar
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Else - Actions
- If - Conditions
- Set ugCleave = (Units within 200.00 of pCleave matching ((((Matching unit) belongs to an enemy of (Owner of uDMGUnit)) Equal to True) and (((Matching unit) is alive) Equal to True)))
- Unit Group - Pick every unit in ugCleave and do (Actions)
- Loop - Actions
- Set uAttackedUnit[(Player number of (Owner of uDMGUnit))] = (Picked unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of Cleaving Strike for uDMGUnit) Greater than or equal to 20
- (Percentage life of uAttackedUnit[(Player number of (Owner of uDMGUnit))]) Less than or equal to 20.00
- Then - Actions
- Unit - Kill uAttackedUnit[(Player number of (Owner of uDMGUnit))]
- Special Effect - Create a special effect attached to the origin of uAttackedUnit[(Player number of (Owner of uDMGUnit))] using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
- Special Effect - Destroy (Last created special effect)
- Unit Group - Remove uAttackedUnit[(Player number of (Owner of uDMGUnit))] from ugCleave
- Else - Actions
- Trigger - Run Damage Calculation <gen> (checking conditions)
- Trigger - Run Damage Calculation Copy <gen> (checking conditions)
- Unit - Cause uDMGUnit to damage uAttackedUnit[(Player number of (Owner of uDMGUnit))], dealing (Real(iAttackDamage[(Player number of (Owner of uDMGUnit))])) damage of attack type Chaos and damage type Normal
- Special Effect - Create a special effect attached to the origin of uAttackedUnit[(Player number of (Owner of uDMGUnit))] using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
- Special Effect - Destroy (Last created special effect)
- If - Conditions
- Loop - Actions
- Custom script: call DestroyGroup (udg_ugCleave)
- Custom script: call RemoveLocation (udg_pCleave)
- Events
Damage calculation:
Trigger:
- Damage Calculation
- Events
- Conditions
- Actions
- -------- Check Dodge --------
- Set booDodge[(Player number of (Owner of uDMGUnit))] = False
- Set iGameVari_Dodge_Enemy[(Player number of (Owner of uDMGUnit))] = (Level of Dodge for uAttackedUnit[(Player number of (Owner of uDMGUnit))])
- Set iRandomNumber[(Player number of (Owner of uDMGUnit))] = (Random integer number between 1 and 100)
- Trigger - Run Check Dodge <gen> (checking conditions)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- booDodge[(Player number of (Owner of uDMGUnit))] Equal to True
- Then - Actions
- Skip remaining actions
- Else - Actions
- If - Conditions
- -------- ---------- --------
- -------- ---------- --------
- -------- Set Stat based damage --------
- Set iGameVari_Strength[1] = (Strength of uDamagingUnit[1] (Include bonuses))
- -------- ---------- --------
- -------- ---------- --------
- -------- Set Weapon based damage --------
- Set iWeaponDamage_Random[1] = (Random integer number between iGameVari_Damage_Min[1] and iGameVari_Damage_Max[1])
- -------- ---------- --------
- -------- ---------- --------
- -------- Calculate raw damage --------
- Set iGameVari_ActualDamage[1] = (iGameVari_Strength[1] + iWeaponDamage_Random[1])
- -------- ---------- --------
- -------- ---------- --------
- -------- Set standard damage calculation --------
- Set rAttackDamage[1] = ((Real(iGameVari_ActualDamage[1])) x (1.00 + ((Real((Level of abilAbilityCasted[1] for uDamagingUnit[1]))) x rAbilityMultiplier[1])))
- -------- ---------- --------
- -------- ---------- --------
- -------- Apply resistance (hvis "Enemy Resistance - XXXX" er level 1 gives der 0 skade, altså immunitet) --------
- Trigger - Run Check Physical Resistance <gen> (checking conditions)
- Trigger - Run Check Fire Resistance <gen> (checking conditions)
- Trigger - Run Check Ice Resistance <gen> (checking conditions)
- Trigger - Run Check Lightning Resistance <gen> (checking conditions)
- Trigger - Run Check Poison Resistance <gen> (checking conditions)
- -------- ---------- --------
- -------- ---------- --------
- -------- Check Critical Strike --------
- Set booCriticalStrike[1] = False
- Set iRandomNumber[1] = (Random integer number between 1 and 100)
- Trigger - Run Check Critical Strike <gen> (checking conditions)
- -------- ---------- --------
- -------- ---------- --------
- -------- Convert damage to integer --------
- Set iAttackDamage[1] = (Integer(rAttackDamage[1]))
- -------- ---------- --------
- -------- Apply damage --------
- -------- ---------- --------
As you can see I was in the middle of changing all conditions/actions arrays from [1] to [(Player number of (Owner of uDMGUnit))].
The reason was because I thought I was being clever by storing all data in arrays linked to the casting player. That way, I thought, I was completely sure that when another player used an ability at the same time nothing would overlap.
So far so good.
Then I to think, if I just use the array number of the owner of "uDMGUnit" in all of my spells it would be redundant to make arrays in the first place since they would all be linked to uDMGUnit through the trigger.
Suddenly the paranoia stoke again. So if two players use two different abilities, both of which refers back to uDMGUnit, can they possibly overlap if cast almost at the same time?
My initial answer is no. Everything happens in orders. Nothing can happen at the exact same time.
But I'm paranoid so I would like to have this confirmed.
Furthermore. If it is indeed true that I'm just freaking out and even though every spell refers back to uDMGUnit, can I just scratch all of my arrays and make them none arrays?
Sorry for the long post.
The paranoid.
P.s. Thanks for a great magazine.