Warcraft III resources & community, 2003–2006 · archived

no attack

4 posts
#1

no attack

hey there are those games that, when your "bullets" (gold) is down to zero, your guy can't attack ppl, how do i do the no attacking part, i have the no gold part, but i can't figure out the no attacking part.
#2
This is in the tools section for what reason?.......
#3
This should be in the trigger forum!

Trigger 1

Event:
If your units is attacking

Conditions:
Attacking unit equal your units

Actions:
Set players gold: gold - 1

Trigger 2

Event:
If your gold is equal to 0

Actions:
Set your enemy to allies

I have not WE open, so go and find the triggers.
#4
ok Emergancy did not help you much so i will...





AntiAttack
Events
Unit - A unit Is attacked

Conditions
((Triggering player) Current lumber) Less than or equal to 0
(Unit-type of (Triggering unit)) Equal to Rpger (Ranger)
(Item-type of (Item being manipulated)) Equal to Bow
Actions
Unit - Order (Attacking unit) to Stop
Player - Make (Triggering player) treat Player 12 (Brown) as an Ally
__________________________________________

And heres a simple jass thing for the attacking
__________________________________________


function Trig_Attacking_Conditions takes nothing returns boolean
if ( not ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER) >= 1 ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'E005' ) ) then
return false
endif
return true
endfunction

function Trig_Attacking_Actions takes nothing returns nothing
call SetPlayerStateBJ( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER, -1 )
endfunction

//===========================================================================
function InitTrig_Attacking takes nothing returns nothing
set gg_trg_Attacking = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attacking, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attacking, Condition( function Trig_Attacking_Conditions ) )
call TriggerAddAction( gg_trg_Attacking, function Trig_Attacking_Actions )
endfunction


nuthin to it


[/img]