- Joined
- Dec 2, 2016
- Messages
- 733
JASS:
scope spawnHellHounds initializer activate
//initializer OnInit
globals
public trigger spawner
integer hellDamage = 5
endglobals
function checker takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A046' ) ) then
return false
endif
return true
endfunction
function spawnHell takes nothing returns nothing
if ( checker() ) then
call CreateNUnitsAtLocFacingLocBJ( 1, 'n008', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetSpellTargetLoc() )
call AddSpecialEffectTargetUnitBJ( "head", GetLastCreatedUnit(), "Environment\\LargeBuildingFire\\LargeBuildingFire2.mdl" )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", GetSpellTargetLoc() )
set udg_TempPoint = GetSpellTargetLoc()
call UnitApplyTimedLifeBJ( 5.00, 'BTLF', GetLastCreatedUnit() )
call SelectUnitAddForPlayer( GetLastCreatedUnit(), GetOwningPlayer(GetTriggerUnit()) )
call RemoveLocation(udg_TempPoint)
//call BlzSetUnitBaseDamage( GetLastCreatedUnit(), 1000*hellDamage, 0 )
else
endif
endfunction
function activate takes nothing returns nothing
set spawner = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(spawner, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddAction(spawner, function spawnHell)
endfunction
endscope
So this script creates a unit. I have another ability that creates a gold coin.
-
Spawn Gold Coin
-
Events
-
Unit - A unit Begins channeling an ability
-
-
Conditions
-
(Ability being cast) Equal to Exploding Gold Coin
-
-
Actions
-
Custom script: local item Coin = null
-
Item - Create Fake Gold Coin at (Target point of ability being cast)
-
Set TempPoint = (Target point of ability being cast)
-
Custom script: call RemoveLocation(udg_TempPoint)
-
Set TEMP_ITEM = (Last created item)
-
Custom script: set Coin = udg_TEMP_ITEM
-
Wait 60.00 seconds
-
Custom script: set udg_TEMP_ITEM = Coin
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TEMP_ITEM Not equal to No item
-
-
Then - Actions
-
Item - Remove TEMP_ITEM
-
-
Else - Actions
-
-
-
But if I research both abilties, the unit spawner will properly spawn the unit. Yet the gold coin ability will now spawn the unit instead of a gold coin.
The hotkey for the coin is G, the unit is L. Is there anything wrong with my code/trigger that would cause this that I've overlooked?