Cần giúp đỡ

thuytien16

Youtube Master Race
Mình muốn làm 1 map giống Mu nhưng mà cái vụ code ngu quá không thể nghĩ đc ... mình muốn mỗi khi hero lên lever sẽ được 5 gỗ, khi dùng các lệnh ví dụ như "-agi (số lương) thì số gỗ sẽ biến mất và cộng thêm một số chỉ số "agi" bằng vào số gỗ vừa mất.
 
[spoil]
Mã:
Untitled Trigger 001
    Events
        Unit - A unit Gains a level
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Triggering unit)) Equal to (Player((Integer A)))
                    Then - Actions
                        Player - Add 5 to (Player((Integer A))) Current lumber
                        Custom script:   exitwhen true
                    Else - Actions
Mã:
Untitled Trigger 002
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Trigger - Add to Untitled Trigger 003 <gen> the event (Player - (Picked player) types a chat message containing -agi as A substring)
                Trigger - Add to Untitled Trigger 003 <gen> the event (Player - (Picked player) types a chat message containing -str as A substring)
                Trigger - Add to Untitled Trigger 003 <gen> the event (Player - (Picked player) types a chat message containing -int as A substring)
Mã:
Untitled Trigger 003
    Events
    Conditions
    Actions
        Set TempPlayer = (Triggering player)
        Set TempString = (Entered chat string)
        Set TempUnitGroup = (Units owned by TempPlayer matching (((Matching unit) is A Hero) Equal to True))
        Set TempInteger = (Integer((Substring(TempString, 5, (Length of TempString)))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                TempInteger Greater than (TempPlayer Current lumber)
            Then - Actions
                Set TempInteger = (TempPlayer Current lumber)
            Else - Actions
        Player - Add (-1 x TempInteger) to TempPlayer Current lumber
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring(TempString, 1, 4)) Equal to -str
            Then - Actions
                Unit Group - Pick every unit in TempUnitGroup and do (Hero - Modify Strength of (Picked unit): Add TempInteger)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring(TempString, 1, 4)) Equal to -int
            Then - Actions
                Unit Group - Pick every unit in TempUnitGroup and do (Hero - Modify Intelligence of (Picked unit): Add TempInteger)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring(TempString, 1, 4)) Equal to -agi
            Then - Actions
                Unit Group - Pick every unit in TempUnitGroup and do (Hero - Modify Agility of (Picked unit): Add TempInteger)
            Else - Actions
        Custom script:   call DestroyGroup( udg_TempUnitGroup )
[/spoil]
Edit: Nếu có hỏi thắc mắc nhỏ thế này thì bạn nên vào topic hỏi đáp ở trên.
 
Chỉnh sửa cuối:
có thể cho mình hỏi cái nút thank nó ở đâu không , mình muốn thank nhưng mà không thấy nút để ấn cho bạn
 
Bạn ơi mình viết đến đoạn này thì không viết được nữa bạn chỉ dùm mình với

If - Conditions
TempInteger Greater than (TempPlayer Current lumber)

60eb33.jpg
 
Mình muốn khi hero của mình khi đủ lever (ví dụ lv 50) dùng lệnh "-move 1" thì nó được chuyển đến địa điểm chỉ định trước, nhưng nếu nếu nó không đủ level mà dùng lệnh đó thì nó không xảy ra, vậy phải viết thế nào vậy
 
Back
Top