求仙境传说人工生命体脚本
答案:1 悬赏:10 手机版
解决时间 2021-02-11 13:00
- 提问者网友:鼻尖触碰
- 2021-02-11 07:49
飞里乐的,要求全文本,可直接复制粘贴的那种。设置为自动攻击,SP不够普通攻击,打完立即回到主人身边,优先护卫主人的那种。有的请直接贴出,谢谢~~
最佳答案
- 五星知识达人网友:人類模型
- 2021-02-11 08:09
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
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
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯