永发信息网

求仙境传说人工生命体脚本

答案:1  悬赏:10  手机版
解决时间 2021-02-11 13:00
飞里乐的,要求全文本,可直接复制粘贴的那种。设置为自动攻击,SP不够普通攻击,打完立即回到主人身边,优先护卫主人的那种。有的请直接贴出,谢谢~~
最佳答案
function OnSKILL_AREA_CMD_ST () TraceAI ("OnSKILL_AREA_CMD_ST") local x , y = GetV (V_POSITION,MyID)
if (GetDistance(x,y,MyDestX,MyDestY) <= GetV(V_SKILLATTACKRANGE,MyID,MySkill)) then -- DESTARRIVED_IN
SkillGround (MyID,MySkillLevel,MySkill,MyDestX,MyDestY)
MyState = IDLE_ST
MySkill = 8009
endend function OnFOLLOW_CMD_ST () TraceAI ("OnFOLLOW_CMD_ST") local ownerX, ownerY, myX, myY
ownerX, ownerY = GetV (V_POSITION,GetV(V_OWNER,MyID)) -- 林牢
myX, myY = GetV (V_POSITION,MyID) -- 唱

local d = GetDistance (ownerX,ownerY,myX,myY) if ( d <= 3) then -- 3伎 捞窍 芭府搁
return
end local motion = GetV (V_MOTION,MyID)
if (motion == MOTION_MOVE) then -- 捞悼吝
d = GetDistance (ownerX, ownerY, MyDestX, MyDestY)
if ( d > 3) then -- 格利瘤 函版 ?
MoveToOwner (MyID)
MyDestX = ownerX
MyDestY = ownerY
return
end
else -- 促弗 悼累
MoveToOwner (MyID)
MyDestX = ownerX
MyDestY = ownerY
return
end

end
function GetOwnerEnemy (myid)
local result = 0
local owner = GetV (V_OWNER,myid)
local actors = GetActors ()
local enemys = {}
local index = 1
local target
for i,v in ipairs(actors) do
if (v ~= owner and v ~= myid) then
target = GetV (V_TARGET,v)
if (target == owner) then
if (IsMonster(v) == 1) then
enemys[index] = v
index = index+1
else
local motion = GetV(V_MOTION,i)
if (motion == MOTION_ATTACK or motion == MOTION_ATTACK2) then
enemys[index] = v
index = index+1
end
end
end
end
end local min_dis = 100
local dis
for i,v in ipairs(enemys) do
dis = GetDistance2 (myid,v)
if (dis < min_dis) then
result = v
min_dis = dis
end
end

return result
end function GetMyEnemy (myid)
local result = 0 local type = GetV (V_HOMUNTYPE,myid)
if (type == LIF or type == LIF_H or type == AMISTR or type == AMISTR_H or type == LIF2 or type == LIF_H2 or type == AMISTR2 or type == AMISTR_H2) then
result = GetMyEnemyA (myid)
elseif (type == FILIR or type == FILIR_H or type == VANILMIRTH or type == VANILMIRTH_H or type == FILIR2 or type == FILIR_H2 or type == VANILMIRTH2 or type == VANILMIRTH_H2) then
result = GetMyEnemyB (myid)
end
return result
end
-------------------------------------------
-- 厚急傍屈 GetMyEnemy
-------------------------------------------
function GetMyEnemyA (myid)
local result = 0
local owner = GetV (V_OWNER,myid)
local actors = GetActors ()
local enemys = {}
local index = 1
local target
for i,v in ipairs(actors) do
if (v ~= owner and v ~= myid) then
target = GetV (V_TARGET,v)
if (target == myid) then
enemys[index] = v
index = index+1
end
end
end local min_dis = 100
local dis
for i,v in ipairs(enemys) do
dis = GetDistance2 (myid,v)
if (dis < min_dis) then
result = v
min_dis = dis
end
end return result
end -------------------------------------------
-- 急傍屈 GetMyEnemy
-------------------------------------------
function GetMyEnemyB (myid)
local result = 0
local owner = GetV (V_OWNER,myid)
local actors = GetActors ()
local enemys = {}
local index = 1
local type
for i,v in ipairs(actors) do
if (v ~= owner and v ~= myid) then
if (1 == IsMonster(v)) then
enemys[index] = v
index = index+1
end
end
end local min_dis = 100
local dis
for i,v in ipairs(enemys) do
dis = GetDistance2 (myid,v)
if (dis < min_dis) then
result = v
min_dis = dis
end
end return result
end function AI(myid) MyID = myid
local msg = GetMsg (myid) -- command
local rmsg = GetResMsg (myid) -- reserved command
if msg[1] == NONE_CMD then
if rmsg[1] ~= NONE_CMD then
if List.size(ResCmdList) < 10 then
List.pushright (ResCmdList,rmsg) -- 抗距 疙飞 历厘
end
end
else
List.clear (ResCmdList) -- 货肺款 疙飞捞 涝仿登搁 抗距 疙飞甸篮 昏力茄促.
ProcessCommand (msg) -- 疙飞绢 贸府
end
-- 惑怕 贸府
if (MyState == IDLE_ST) then
OnIDLE_ST ()
elseif (MyState == CHASE_ST) then
OnCHASE_ST ()
elseif (MyState == ATTACK_ST) then
OnATTACK_ST ()
elseif (MyState == FOLLOW_ST) then
OnFOLLOW_ST ()
elseif (MyState == MOVE_CMD_ST) then
OnMOVE_CMD_ST ()
elseif (MyState == STOP_CMD_ST) then
OnSTOP_CMD_ST ()
elseif (MyState == ATTACK_OBJECT_CMD_ST) then
OnATTACK_OBJECT_CMD_ST ()
elseif (MyState == ATTACK_AREA_CMD_ST) then
OnATTACK_AREA_CMD_ST ()
elseif (MyState == PATROL_CMD_ST) then
OnPATROL_CMD_ST ()
elseif (MyState == HOLD_CMD_ST) then
OnHOLD_CMD_ST ()
elseif (MyState == SKILL_OBJECT_CMD_ST) then
OnSKILL_OBJECT_CMD_ST ()
elseif (MyState == SKILL_AREA_CMD_ST) then
OnSKILL_AREA_CMD_ST ()
elseif (MyState == FOLLOW_CMD_ST) then
OnFOLLOW_CMD_ST ()
endend
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
莱州有直接学B证的驾校吗
东阳市亚联工具有限公司我想知道这个在什么地
自已做相册怎么做?
我女朋友在公共场合都像不在乎我,从来这是什
秋葵的干种子可以做什么
【财务管理目标】企业财务管理目标最重要的观
兰州清汤牛肉面怎么去啊,有知道地址的么
五分之七比二分之三的倒数多几分之几
苹果贷绑定id真的 可以贷款吗
东宝冰箱 运行时噪音很大
8元流量包怎么要自己流量!
汉字国标码(GB2312—80)把汉字分成2个等级。
海雾形成的原因地理
精确到0.002的游标卡尺怎么读
兼怀子由 的兼怀是什么啊?
推荐资讯
某工程单代号搭接网络计划如下图所示,其中B
“肉头”什么意思
吊柜和操作台之间的距离应该是多少?
‘白’用韩语怎样拼、写?
邮寄地毯的问题
云峰红豆杉(河源专卖店)怎么去啊,有知道地址
药石罔顾什么意思
邯郸604路车,路过元宝山和北响堂吗?
溢香缘地址在什么地方,想过去办事
日本摄影师荒木经惟爱用什么相机
陕西宇龙工程机械有限责任公司地址在什么地方
家用节能灯钨丝灯泡一般是多少瓦
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?