Tom_Kazansky
<b><font color="RoyalBlue"><font face="Lucida Cons
- 28/12/06
- 3,454
- 462
- Thread starter
- #761
unit đầu tiên -> 1 unit thôi -> dùng loop làm gì thế?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
YAN[asian];18500877 nói:Quên mất, ý mình là bằng GUI, mình mù Jass >_<!
Bằng GUI thì cũng phải dùng bằng EGUI mới làm dễ,còn nếu không thì tạo từng cái Item Tăng damg ý!EGUI thì làm gần như ví dụ trên vậy!
ví dụ như thếđây là trigger Respawn còn về turn off thì cái này.Mã:Respawn Events Time - Every 15.00 seconds of game time Conditions Actions Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Mã:TurnOff Respawn Events Unit - Barracks 0000 <gen> Dies Conditions Actions Trigger - Turn off Respawn <gen>
@DylandKyo
tổng số check ra là như thếMã:(Line: 10) (Word: 3) Location Leak Set Points[16] = ((Position of Caster[16]) offset by 200.00 towards ((Real((Integer A))) x 36.00) degrees) Set Points[16] = ^Leak (Line: 10) (Word: 6) Location Leak Set Points[16] = ((Position of Caster[16]) offset by 200.00 towards ((Real((Integer A))) x 36.00) degrees) Set Points[16] = ((Position of Caster[16]) ^Leak Scan Complete Location leaks: 2 Special Effect leaks: 0 Lightning leaks: 0 Unit Group leaks: 0 Player Group leaks: 0 Variables UnitGroups[16] : (Line: 12) Unit Group - Removed: Yes Summary Total Leaks: 2 Unremoved Variables: 0 Scan duration: 0 seconds Total Lines Scanned: 17 Total Words Scanned: 159
UMSWE lỗi chẳng bằng EGUi đâu anh rex à
mình ví dụ như thế nhé
Mã:Move Events Unit - A unit Starts the effect of an ability Conditions (Ability being cast) Equal to Storm Bolt Actions Set Tmp_Cast = (Triggering unit) Set Tmp_Vitm = (Target unit of ability being cast) Unit - Order Tmp_Cast to Attack Tmp_Vitm Wait until ((Distance between (Position of Tmp_Cast) and (Position of Tmp_Vitm)) Less than or equal to 200.00), checking every 0.10 seconds If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Then - Actions Unit - Cause Tmp_Cast to damage Tmp_Vitm, dealing 500.00 damage of attack type Spells and damage type Normal Else - Actions
function Trig_Tree_Recreation_Func002002 takes nothing returns nothing
call DestructableRestoreLife( GetEnumDestructable(), GetDestructableMaxLife(GetEnumDestructable()), false )
endfunction
function Trig_Tree_Recreation_Actions takes nothing returns nothing
call TriggerSleepAction( 30.00 )
call EnumDestructablesInRectAll( GetEntireMapRect(), function Trig_Tree_Recreation_Func002002 )
endfunction
function InitTrig_Tree takes nothing returns nothing
set gg_trg_Tree = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Tree, 300.00 )
call TriggerAddAction( gg_trg_Tree, function Trig_Tree_Recreation_Actions )
endfunction
Event: Every 1 second game time
Condition:
Action: Player Group - Pick Every Player In (Play map able) and action
Loop - Action:
Give (Picked Player) 1 gold
thanks bạn nhiều lắm tiện thể bạn cho mình luôn cái trigger làm cho tree regrow và tiền của tất cả player tăng theo time giống như trong dota nhé
EverySec
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set Int_sec = (Int_sec + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 1 (Red) Food used) Equal to 59
Then - Actions
Set Int_sec = 0
Set Int_min = (Int_min + 1)
Else - Actions
For each (Integer [B]B[/B]) from 1 to 12, do (Actions)
Loop - Actions
Player - Set (Player((Integer [B]B[/B]))) Food used to Int_sec
Player - Add 1 to (Player((Integer [B]B[/B]))) Current gold
Player - Set (Player((Integer [B]B[/B]))) Current lumber to Int_min
Tree ReGrow :
Mã:function Trig_Tree_Recreation_Func002002 takes nothing returns nothing call DestructableRestoreLife( GetEnumDestructable(), GetDestructableMaxLife(GetEnumDestructable()), false ) endfunction function Trig_Tree_Recreation_Actions takes nothing returns nothing call TriggerSleepAction( 30.00 ) call EnumDestructablesInRectAll( GetEntireMapRect(), function Trig_Tree_Recreation_Func002002 ) endfunction function InitTrig_Tree takes nothing returns nothing set gg_trg_Tree = CreateTrigger( ) call TriggerRegisterTimerEventPeriodic( gg_trg_Tree, 300.00 ) call TriggerAddAction( gg_trg_Tree, function Trig_Tree_Recreation_Actions ) endfunction
Gold everytime:
Mã:Event: Every 1 second game time Condition: Action: Player Group - Pick Every Player In (Play map able) and action Loop - Action: Give (Picked Player) 1 gold
P/s: trigger tiền mình k nhớ rõ do k có WE nhưng cũng như trên bạn tự tìm lệnh nha (chỉ sai lệnh chút thui ^^)
Custom script: local unit c=GetTriggerUnit()
Custom script: local unit t=GetSpellTargetUnit()
Wait 0.50 seconds
custom script: call SetUnitPathing(t,false)
Unit - Move c to (Unit Position of (t)) facing (Facing of (t)) degree
Unit - Move t to (Unit Position of (c)) facing (Facing of (c)) degree
custom script: call SetUnitPathing(t,true)