hey guys 
i got really interested in mapping and now i have a problem
i'm doing a vampirism map, maybe you know them. and i want to make an admin tower. there is a gold supplier that must be killed by the humans to get gold. my problem is that the admin tower always attacks the gold supplier and i want to stop that.
first of all, the tower is no tower. its a unit that cant be moved and has a attack with 20k range.
thats my script. why is it not working?
npn2 = ID of my admin unit
n000 = ID of the gold supplier
i have to say that the script itself works. i dont get errors when saving the map. but my tower (or unit) still attacks the gold supplier.
or is there a easier way with the object-editor in the WE?
i want the tower just to attack friendly buildings.
i got really interested in mapping and now i have a problem
i'm doing a vampirism map, maybe you know them. and i want to make an admin tower. there is a gold supplier that must be killed by the humans to get gold. my problem is that the admin tower always attacks the gold supplier and i want to stop that.
first of all, the tower is no tower. its a unit that cant be moved and has a attack with 20k range.
thats my script. why is it not working?
npn2 = ID of my admin unit
n000 = ID of the gold supplier
JASS:
function Trig_AdminSupplier_Conditions takes nothing returns boolean
if (not (GetUnitTypeId(GetAttacker())=='npn2')) then
return false
endif
return true
endfunction
function Trig_AdminSupplier_Actions takes nothing returns nothing
if (GetUnitTypeId(GetAttackedUnitBJ())=='n000') then
call DisplayTimedTextToForce(GetPlayersAll(),30,"|cFFCC0000You can't attack the Gold Supplier!|r")
call IssueImmediateOrderBJ(GetAttacker(),"stop")
endif
endfunction
call TriggerRegisterAnyUnitEventBJ(udg_trigger98,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(udg_trigger98,Condition(function Trig_AdminSupplier_Conditions))
call TriggerAddAction(udg_trigger98,function Trig_AdminSupplier_Actions)
set udg_trigger98=CreateTrigger()
i have to say that the script itself works. i dont get errors when saving the map. but my tower (or unit) still attacks the gold supplier.
or is there a easier way with the object-editor in the WE?
i want the tower just to attack friendly buildings.