//以下写在globals下面

trigger gg_trg_Manager_List=null

 //以下写在function InitCustomTriggers下面

call InitTrig_Manager_List()

//以下写在endglobals下面

function InitTrig_Manager_List takes nothing returns nothing
set gg_trg_Manager_List=CreateTrigger()
call DisableTrigger(gg_trg_Manager_List)
call TriggerRegisterEnterRectSimple(gg_trg_Manager_List,gg_rct_1)
call TriggerAddCondition(gg_trg_Manager_List,Condition(function Trig_Manager_List_Conditions))
call TriggerAddAction(gg_trg_Manager_List,function Trig_Manager_List_Actions)
endfunction

//注意以上是个任意单位进入矩形区域的事件。

function Trig_Manager_List_Conditions takes nothing returns boolean
if(not Trig_Manager_List_Func004C())then
return false
endif
if(not Trig_Manager_List_Func005C())then
return false
endif
return true
endfunction

//以上是触发的条件,需要满足 Trig_Manager_List_Func004C和Trig_Manager_List_Func005C。

function Trig_Manager_List_Func004C takes nothing returns boolean
if(not(GetPlayerController(GetOwningPlayer(GetEnteringUnit()))==MAP_CONTROL_USER))then
return false
endif
if(not(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)==true))then
return false
endif
if(not(GetHeroLevel(GetTriggerUnit())>=120))then
return false
endif
return true
endfunction

//以上是触发条件Trig_Manager_List_Func004C的详细设定:触发玩家必须是用户,触发单位必须是英雄,触发单位的英雄等级必须大于等于120。

function Trig_Manager_List_Func005C takes nothing returns boolean
if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="DarkSheep"))then
return true
endif
if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="chenqwq"))then
return true
endif
return false
endfunction

//以上是触发条件Trig_Manager_List_Func005C的详细设定:触发单位的所有者的玩家名字必须是DarkSheepchenqwq。

function Trig_Manager_List_Func002C takes nothing returns boolean
if(not(UnitHasBuffBJ(GetTriggerUnit(),'B02Y')!=true))then
return false
endif
return true
endfunction

//以上是执行过程时判断触发单位是否已经有了B02Y这个特效,不是的话继续做动作,是的话停止。

function Trig_Manager_List_Actions takes nothing returns nothing
call CreateNUnitsAtLoc(1,'n03U',GetOwningPlayer(GetTriggerUnit()),GetRectCenter(gg_rct_Point_1),bj_UNIT_FACING)
if(Trig_Manager_List_Func002C())then
call UnitAddAbilityBJ('A0O3',GetTriggerUnit())
else
endif
endfunction

//以上第一步:创建1个单位n03U给触发单位在gg_rct_Point_1区域面向默认建筑朝向角度。

第二步:判断触发单位是否已经有了B02Y这个特效,是的话停止,否则给触发单位增加1个A0O3的技能。

触发结束。






这个触发所有门道都在物编的设置:n03U是单位  <重点>、A00O是单位技能、B02Y 是光环特效、A0O3是英雄技能

1、触发中创建的n03U单位是一个不可见的、飞行的、没有触碰体积的单位,它有两个技能:A0O4技能和蝗虫技能。蝗虫技能是为了使它不可见,完全隐藏起来,用显影也看不到它。而A0O4技能是一个光环技能。




2、A0O4技能是一个光环技能。唯一不同的地方是它影响区域的是999999(全图范围)。




3、B02Y 光环特效没什么特别之处,只是给英雄面板下方加上1个小图标。




4、A0O3是触发给英雄加上的技能。因为是给英雄加属性,所以这里直接是对国王之冠进行自定义修改,且选择的是物品技能。这样就不会技能面板上出现。




到这里一切的谜团就解开了。游戏中的奖励光环,其属性加成是附加给英雄的,但是技能效果(光环图标)则不是直接附加的,而是通过创建了1个看不见的、属于玩家的单位,由这个单位来提供全图光环。

最后送上研究后的一份礼物。稍微改改就能用:

附上触发转JASS:

function Trig_SXJLConditions takes nothing returns boolean
return ((IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true) and (GetPlayerController(GetOwningPlayer(GetTriggerUnit())) == MAP_CONTROL_USER) and (GetHeroLevel(GetTriggerUnit()) >= 10) and (UnitHasBuffBJ(GetTriggerUnit(), 'B000') == false) and ((GetPlayerName(GetOwningPlayer(GetTriggerUnit())) == "DarkSheep") or (GetPlayerName(GetOwningPlayer(GetTriggerUnit())) == "WorldEdit") or (GetPlayerName(GetOwningPlayer(GetTriggerUnit())) == "123")))
endfunction

function Trig_SXJLActions takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'n000', GetOwningPlayer(GetTriggerUnit()), GetRectCenter(gg_rct______________001), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A000', GetTriggerUnit() )
endfunction

//===========================================================================
function InitTrig_SXJL takes nothing returns nothing
set gg_trg_SXJL = CreateTrigger()
#ifdef DEBUG
call YDWESaveTriggerName(gg_trg_SXJL, "SXJL")
#endif
call TriggerRegisterEnterRectSimple( gg_trg_SXJL, gg_rct______________000 )
call TriggerAddCondition(gg_trg_SXJL, Condition(function Trig_SXJLConditions))
call TriggerAddAction(gg_trg_SXJL, function Trig_SXJLActions)
endfunction

附上演示地图百度网盘链接:https://pan.baidu.com/s/1ecYr8gTEP2VJ31RpoI8UZg 密码:9cho







《被遗忘的肥羊传说》

globals
// Generated
rect gg_rct_vimportant = null
rect gg_rct_imasheep = null
endglobals

function CreateRegions takes nothing returns nothing

set gg_rct_vimportant = Rect( -3680.0, 26048.0, -3360.0, 26688.0 )
set gg_rct_imasheep = Rect( -224.0, -480.0, 480.0, 128.0 )

endfunction