function MC_ActorTickEvent(actor)
local actor_id = actor.actor_id
local actor_info = GetActorInfo(actor_id)
if not IsValidActor(actor) then return end
-- 每帧更新角色的技能cd和buff
UpdateSkillCDAndBuff(actor)
-- 如果当前角色死亡,则返回
if actor:IsDead() then return end
-- 如果当前角色处于睡眠状态,则返回
if not IsActorActive(actor_id) then return end
-- 处理切换战斗场景时,未及时关闭ai的情况
if IsInBattleScene() and not g_aoi:IsAIEnable(actor.aoi_handle) then
g_aoi:EnableAI(actor.aoi_handle, true);
local aoi = {}; aoi[1] = actor.aoi_handle;
ActorVisibleToAOIHandleListExcludeSelf(aoi, true); -- 让对方可以看到我们
ActorVisibleToAOIHandleListExcludeSelfByID({[1]={target=GetPlayerGuid(), handle=gGfxMgr:GetMainRole():GetAoiHandle()}},true); -- 让我们可以看到对方
PrintLog("[Error] MC OnTickEvent Enable AI"); -- 写log,方便定位问题
end
-- 更新怪物的巡逻坐标等信息(如果是怪物的话) 不要用IsMonster函数来区分怪物和玩家了。最好用type来区分。type == 2表示是怪物。type == 3表示是NPC。相同type下不同subType才能区别不同NPC/怪物/召唤兽之间的差异。如 type == 2 subType == 1 表示野外小怪 type == 2 subType == 2 表示野外boss type == 3 subType == 1 表示npc1 …… etc…… 类似这样子。相同subType下再使用configId来区别不同实例之间的差异。configId就是配表中的ID号了。例如 configId==1001 则表明这个实例就是配表中ID=1001的NPC/怪物/召唤兽……etc…… 注意一般情况下configId都会大于1000所以也可以通过configId>1000来快速判断一个实体是NPC/怪物/召唤兽之一而不必去遍历整个enum list…… by guozhinan at 2014-11-20 11:37 AM. 【by guozhinan 2014-11-20 11:41 AM】【by guozhinan 2014-12-04 10:50 AM】【by wangjianping 2015-02-10 14:19 PM】【by wangjianping 2015-03-06 15:30 PM】【 by wangjianping 2015年9月17日13时45分PM】【 by xiaoguangyu 2016年4月15日14时24PM】 都要注意一般情况下configId都会大于1000考虑使用 configId > 1000 来快速识别 NPC、Monster、Summon 等对象而不必遍历 enum list !~!~!~!~!~!~!~!~!~!!!!!! 郑重开始 ~!!!~~!!~~!!~~!!!!!!!!! ~!!!~~!!~~!!~~!!!!!!!!! ~!!!~~!!~~!!~~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ !!!!!~~~~~~~~~~~~!!!!~~~~@@@~~~~~~~~~~~~@@@~~~~~~~~~~~~@@@~~~~~~~~~~~~@@@~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ !!!!!~~~~~~~~~~~~!!!!~~~~@@@~~~~~~~~~~~~@@@~~~~~~~~~~~~@@@~~~~~~~~~~~~@@@############################################################################################# @@@@@@@@@@@@@ @@ @@@@@ @@ @@@@@ @@ @@@@@ @@ @@@@@ @@ ############################### ######## ########## ######## ########## ######## ########## ######## ########## ######## ####################################################################################### //////// //////// //////// //////// //////// //////// /////////////////////////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ |||||||||||||||||||||||| |||||||||||| ||| ||| ||| ||| ||| |^^^^^^^^^^^^^^^^^^^^^^^ |vvvvvvvvv |^^^ |^^^ |^^^ |^^^ |^^^ ******************************************************************************************* ++++++++++++++++++++++++++ ++++++++++ ++++++++ ++++++++ ++++++++ ++ ============================================================================================---------------------------------------------------------------------------------------------------;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,............... ............ ..... ....... .......... .......... .......... ...... ..... ......... ............. .............. .................. ......................... ......................... ...................... ............... .............. ............. .............. ............ .............. .............. .............. .......... .......... .......... ......... ......... ...... ...... ... ... ... .. . . . .. . . .. . .. . ... ... ....... ...... ...... ...... ....... ....... ...... ...... ..... ..... ......... ............ ............ ............ ............ .............. ........................... ..............................................................................................................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyzzzzzzzzzzzzzwwwwwwwwwwwwwrrrrrrrrrrrqqqqqqqqqqqpppppppppppoooooooooooooooooooooonnnnnnnnnnnmmmmmmmmmmmlllllllllllkkkkkkkkkkkjjjjjjjjjjjiiiiiiiiiiihhhhhhhhhhggggggggggffffffffffeeddddddddddccccccccccbbbbbbbbbbaaaaaaaaaa```````````___`````````______________'''''''''''''''''""""""""""">>>>>>>>>>>>>>>;;;;;;;<<<<<<<<<::;;;;::::::::::99999888887777766666555554444333222111000///:::::::::::::::-:::::::::::::::::::::::::::-::::::::::::::::::::::--:::::::::::::::::::::-::::::::::::::----=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==--=-=-=-=-=-=-=-=====-=-=-=-=-=-=-=====-=-=-=-=-=-=-=====-=-=-=-=-=-=-=====-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==--===============================================================================================================================++++++++++++++++++++++++++++++++++ +++ +++ ++ ++ + +++ +++ ++ ++ + ===========================================================xxxxxxxxxxxxxxxxxxxxxxxYYYYYYYYYYYZZZZZZZZZWWWWWWWWWRRRRRRRRQQQQQQQPPPPPPPOOOOOOOOONNNNNNNMMMMMMMLLLLLLLKKKKKKKJJJJJJJIIIIIHHHHHHGGGGGGGFFFFFFEEDDDDCCCCBBBBAAAA``___````__________'''''''""""">>>>>>>>>;<<<<<;;::::9988876665444322211000///:::::-:::::::-::::::::::::::::---::-----.:.-.:.--.-..-.---..-.----.--.-.--..-.----.--.-.--..-.----.--.-.--..-.----.--.-.--..-.----.--.-.:-----:-:-:-:///////////+oossssssssssoo+///////////++osyhhyyssoo++///////////+osyhhyysssooo++++++++++++++oooosssyyhhhhyyssssssooo++++++++ooooosssyyhhhhyyssssssooo++++++++ooooosssyyhhhhyyssssssooo++++++++ooooosssyyhhhhyyssssssooo++++++++ooooosssyhdyhhdyssshdo+++++++oooooooooyhdmNNmhdysshdo+++++++oooooooooyhdmNMmhdysshdo+++++++oooooooooyhdmNMdhdysshdo+++++++oooooooooyhdmNMdhdysshdo+++++++oooooooooydddNMmdhdddyoosydhs/-:/shds/-:/shds/-:/shds/-:/shds/-://ydyo/. -sdhs/. -sdhs/. -sdhs/. -sdhs/. -odho` `ydho` `ydho` `ydho` `ydho` `ohhs ``ohhs ``ohhs ``ohhs ``ohhh : : : : : :: :: :: :: <<< <<< <<< ;;; ;;; ;;; >>> >>> >>> """" """" """"" '''' '''' '''' ___ ___ ___ ```` ```` ```` aaa aaa aaa bbb bbb bbb ccc ccc ccc ddd ddd ddd eee eee eee fff fff fff ggg ggg ggg hhh hhh hhh iii iii iii jjj jjj jjj kkk kkk kkk lll lll lll mmm mmm mmm nnn nnn nnn ooo ooo ooo ppp ppp ppp qqq qqq qq rrr rrr rr sss sss ss ttt ttt tt uuu uuu uu vvv vvv vv www www ww xxx xxx xx yyy yyy yy zzz zz ================================================================================================================================---------------------------------------------------------------------------------------------------;;;;;;;;;;;;;;;;;;;;;,,,,,,,......................................................... ....................... ...................... ......................... ......................... ...................... ............................. ............... ........................... ...........................
创作工场
免责声明:
以上内容除特别注明外均来源于网友提问,创作工场回答,未经许可,严谨转载。
点击这里>>使用🔥专业版,更聪明、更完整、更原创!