Tom_Kazansky
<b><font color="RoyalBlue"><font face="Lucida Cons
- 28/12/06
- 3,454
- 462
@Vua_Do_Hoa, về cái Multiboard, em xem lại cái biến Levels của em, em để giá trị khởi tạo( Initial Value) là bao nhiêu, anh chắc là 0 Vì level của hero lúc đầu là 1 nên em mà để giá trị 0 thì lúc hero level 8 -> biến Levels sẽ là 7.
-----
Còn cái HVS kia, nếu ko muốn select luôn hero đang view skill thì sửa:
Tạo thêm 1 biến (variable) có type là unit, tên là SelectedHero và có array
Và nên tạo thêm 1 variable có type là unit, tên là Hero và có array. Có biến Hero này thì việc "quản lý" (sak, chả nghĩ ra từ nào ::( ) các hero, ít nhất thì ta cũng biết đc player nào có hero hay chưa. (Thật ra tạo 1 biến boolean cũng ko sao, nhg nên dùng biến unit hơn)
Về thay cả trigger HVS Select bằng trigger trên, ko đc thì hỏi lại
----
Cái trigger item lên level, thật ra anh cũng ko thấy sai chỗ nào cả ::( vì đã có điều kiện kiểm tra level rồi, nếu level của hero đang là 9 thì ko thể nào lên quá Staff of Frenzy 3 đc
Nếu lên max luôn thì chỉ có thể hero level >= 12 (thỏa mãn điều kiện cuối cùng)
---
@god of the noob
Vua_Do_Hoa đang tạo 1 map gần giống DDay thì chỉ cho thuyvuong7 kìa. ::)
-----
Còn cái HVS kia, nếu ko muốn select luôn hero đang view skill thì sửa:
Tạo thêm 1 biến (variable) có type là unit, tên là SelectedHero và có array
Và nên tạo thêm 1 variable có type là unit, tên là Hero và có array. Có biến Hero này thì việc "quản lý" (sak, chả nghĩ ra từ nào ::( ) các hero, ít nhất thì ta cũng biết đc player nào có hero hay chưa. (Thật ra tạo 1 biến boolean cũng ko sao, nhg nên dùng biến unit hơn)
Mã:
function Trig_HVS_Select_Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_HeroViewingSkillGroup)
endfunction
function Trig_HVS_Select_Actions takes nothing returns nothing
local unit f = GetTriggerUnit()
local player own = GetTriggerPlayer()
local integer id = GetPlayerId( own )
local real x
local real y
local rect R = gg_rct_HeroSpawnRect // thay HeroSpawnRect = te^n cua? region ma` em muon' hero khi select xong dc tao. ra.
local unit h
if udg_Hero[id] != null then
if f != udg_SelectedHero[id] then
set udg_SelectedHero[id] = f
else
set udg_SelectedHero[id] = null
set x = GetRectCenterX(R)
set y = GetRectCenterY(R)
set h = CreateUnit( own, GetUnitTypeId(f), x , y , 270. )
if GetLocalPlayer() == own then
call ClearSelection()
call SetCameraPosition( x , y )
call SelectUnit( h , true )
endif
set h = null
endif
endif
set f = null
set R = null
endfunction
//===========================================================================
function InitTrig_HVS_Select takes nothing returns nothing
set gg_trg_HVS_Select = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_HVS_Select, Player(0), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_HVS_Select, Player(1), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_HVS_Select, Player(2), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_HVS_Select, Player(3), true )
call TriggerAddCondition( gg_trg_HVS_Select, Condition( function Trig_HVS_Select_Conditions ) )
call TriggerAddAction( gg_trg_HVS_Select, function Trig_HVS_Select_Actions )
endfunction
Về thay cả trigger HVS Select bằng trigger trên, ko đc thì hỏi lại
----
Cái trigger item lên level, thật ra anh cũng ko thấy sai chỗ nào cả ::( vì đã có điều kiện kiểm tra level rồi, nếu level của hero đang là 9 thì ko thể nào lên quá Staff of Frenzy 3 đc
Nếu lên max luôn thì chỉ có thể hero level >= 12 (thỏa mãn điều kiện cuối cùng)---
@god of the noob
Nếu event là a unit is attacked thì (Triggering unit) là unit bị đánh, nếu muốn unit attack làm unit bị attack mất máu thì:Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 500.00 damage of attack type Spells and damage type Normal
hoặcUnit - Cause (Attacking unit) to damage (Triggering unit), dealing 500.00 damage of attack type Spells and damage type Normal
----Unit - Cause (Attacking unit) to damage (Attacked unit), dealing 500.00 damage of attack type Spells and damage type Normal
Vua_Do_Hoa đang tạo 1 map gần giống DDay thì chỉ cho thuyvuong7 kìa. ::)

.mà