Magentix
if (OP.statement == false) postCount++;
- Reaction score
- 107
This code gives me errors, as in:
Doesn't run any function/group-action based on target/triggering unit locations from that point on since it seems to think they (target and triggering unit) are positioned at the center of the map.
Removing the small part with abilityIDs suddenyl makes it work :/
(trigger with "buggy part" removed below)
What's going on? As I do -need- to base my "integer a" and the to-remove/to-add abilities off of the used ability :/
Doesn't run any function/group-action based on target/triggering unit locations from that point on since it seems to think they (target and triggering unit) are positioned at the center of the map.
JASS:
function Trig_Hook_Up_Actions takes nothing returns nothing
local boolexpr b = Condition(function OOTU2F)
local string s = "Must target a Famous DJ039;s tower that you own."
local string s2 = "This Speaker System is already hooked up to that DJ."
local location l
local group g
local integer a = 0
if (Hook_Up_VT()) then
if(AlreadyHookedUp()) then
call DisplayTextToForce( GetPlayersMatching(b),s2)
else
if (GetSpellAbilityId() == 039;A00R039;) then
call UnitRemoveAbility(GetTriggerUnit(),039;A00R039;)
call UnitAddAbility(GetTriggerUnit(),039;A00U039;)
endif
if (GetSpellAbilityId() == 039;A00S039;) then
set a = 1
call UnitRemoveAbility(GetTriggerUnit(),039;A00S039;)
call UnitAddAbility(GetTriggerUnit(),039;A00W039;)
endif
if (GetSpellAbilityId() == 039;A00T039;) then
set a = 2
call UnitRemoveAbility(GetTriggerUnit(),039;A00T039;)
call UnitAddAbility(GetTriggerUnit(),039;A00X039;)
endif
call CreateSpeakerEffect(GetSpellTargetUnit(),GetUnitUserData(GetTriggerUnit())+a)
set l = GetUnitLoc(GetSpellTargetUnit())
call CreateNUnitsAtLoc( 1, 039;n003039;, GetOwningPlayer(GetTriggerUnit()), l, bj_UNIT_FACING )
call RemoveLocation (l)
set l = null
call SetUnitUserData( GetLastCreatedUnit(), (GetUnitUserData(GetTriggerUnit())+a) )
call SetUnitUserData( GetSpellTargetUnit(), ( GetUnitUserData(GetSpellTargetUnit()) + 1 ) )
set l = GetUnitLoc(GetTriggerUnit())
set g = GetUnitsInRangeOfLocMatching(24.00, l, Condition(function AddAbilitiesToDummy_VT))
call ForGroup( g, function AddAbilitiesToDummy )
call RemoveLocation (l)
call DestroyGroup (g)
set l = null
set g = null
endif
else
call DisplayTextToForce( GetPlayersMatching(b),s)
endif
endfunction
Removing the small part with abilityIDs suddenyl makes it work :/
(trigger with "buggy part" removed below)
JASS:
function Trig_Hook_Up_Actions takes nothing returns nothing
local boolexpr b = Condition(function OOTU2F)
local string s = "Must target a Famous DJ039;s tower that you own."
local string s2 = "This Speaker System is already hooked up to that DJ."
local location l
local group g
local integer a = 0
if (Hook_Up_VT()) then
if(AlreadyHookedUp()) then
call DisplayTextToForce( GetPlayersMatching(b),s2)
else
call CreateSpeakerEffect(GetSpellTargetUnit(),GetUnitUserData(GetTriggerUnit())+a)
set l = GetUnitLoc(GetSpellTargetUnit())
call CreateNUnitsAtLoc( 1, 039;n003039;, GetOwningPlayer(GetTriggerUnit()), l, bj_UNIT_FACING )
call RemoveLocation (l)
set l = null
call SetUnitUserData( GetLastCreatedUnit(), (GetUnitUserData(GetTriggerUnit())+a) )
call SetUnitUserData( GetSpellTargetUnit(), ( GetUnitUserData(GetSpellTargetUnit()) + 1 ) )
set l = GetUnitLoc(GetTriggerUnit())
set g = GetUnitsInRangeOfLocMatching(24.00, l, Condition(function AddAbilitiesToDummy_VT))
call ForGroup( g, function AddAbilitiesToDummy )
call RemoveLocation (l)
call DestroyGroup (g)
set l = null
set g = null
endif
else
call DisplayTextToForce( GetPlayersMatching(b),s)
endif
endfunction
What's going on? As I do -need- to base my "integer a" and the to-remove/to-add abilities off of the used ability :/