• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

i need help with the triggers...

Status
Not open for further replies.
Level 9
Joined
Jun 26, 2005
Messages
511
EDIT:r integer A stuff r random numbers?? cuz i use these for random nubmer





i was trying to make fishing for my rpg but it turn out bad...it keeps doing it til it catchs all the fish

this is the trigger my image shack dont work so ill type it....(poor me)

-----------------------------------------------------
events
-unit-a unit uses an item
conditions
-[item-type of [item being manipulated]] equal to fishing rod
actions
-for each [integer a] from 1 to 20, do [actions]
-loop - actions
-if [all conditions are true] then do [then actions] else do [else actions]
-if - conditions
[integer a] equal to 5
-then - actions
hero - create small fish and give it to [hero manipulated item]
game - display to [all players] for 5.00 seconds the text: you could a small fish.
-else - actions
game - display to [all players for 5.00 seconds the text: you failed to catch a fish.
-----------------------------------------------------

ok this is how it goes i have like 5 of these in the same trigger just to make it catch different fish...like integer a equal to 17 equal to true create blue fish in hero invtory.

plz help thx for reading.
 
Level 9
Joined
Jun 26, 2005
Messages
511
just another post for those who can read jass

i want this answer as soon as possible so plz help

=====================================================
function Trig_fishingx_Copy_Copy_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00V' ) ) then
return false
endif
return true
endfunction

function Trig_fishingx_Copy_Copy_Func001Func001C takes nothing returns boolean
if ( not ( GetForLoopIndexA() == 5 ) ) then
return false
endif
return true
endfunction

function Trig_fishingx_Copy_Copy_Func002Func001C takes nothing returns boolean
if ( not ( GetForLoopIndexA() == 17 ) ) then
return false
endif
return true
endfunction

function Trig_fishingx_Copy_Copy_Func003Func001C takes nothing returns boolean
if ( not ( GetForLoopIndexA() == 10 ) ) then
return false
endif
return true
endfunction

function Trig_fishingx_Copy_Copy_Func004Func001C takes nothing returns boolean
if ( not ( GetForLoopIndexA() == 14 ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetManipulatingUnit(), 'I00W') == true ) ) then
return false
endif
return true
endfunction

function Trig_fishingx_Copy_Copy_Func005Func001C takes nothing returns boolean
if ( not ( GetForLoopIndexA() == 15 ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetManipulatingUnit(), 'I00X') == true ) ) then
return false
endif
return true
endfunction

function Trig_fishingx_Copy_Copy_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_fishingx_Copy_Copy_Func001Func001C() ) then
call UnitAddItemByIdSwapped( 'I010', GetManipulatingUnit() )
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_436" )
else
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_435" )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_fishingx_Copy_Copy_Func002Func001C() ) then
call UnitAddItemByIdSwapped( 'I011', GetManipulatingUnit() )
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_438" )
else
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_437" )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_fishingx_Copy_Copy_Func003Func001C() ) then
call UnitAddItemByIdSwapped( 'I012', GetManipulatingUnit() )
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_440" )
else
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_439" )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_fishingx_Copy_Copy_Func004Func001C() ) then
call UnitAddItemByIdSwapped( 'I014', GetManipulatingUnit() )
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_442" )
call RemoveItem( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), 'I00W') )
else
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_441" )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_fishingx_Copy_Copy_Func005Func001C() ) then
call UnitAddItemByIdSwapped( 'I013', GetManipulatingUnit() )
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_444" )
call RemoveItem( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), 'I00X') )
else
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_443" )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction

//===========================================================================
function InitTrig_fishingx_Copy_Copy takes nothing returns nothing
set gg_trg_fishingx_Copy_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_fishingx_Copy_Copy, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_fishingx_Copy_Copy, Condition( function Trig_fishingx_Copy_Copy_Conditions ) )
call TriggerAddAction( gg_trg_fishingx_Copy_Copy, function Trig_fishingx_Copy_Copy_Actions )
endfunction
 
Status
Not open for further replies.
Top