remy
11-18-2008, 12:58 PM
I'm currently using the MirAI+Mercenary AI by Miranda Blade w/ edits by Lamech that's hosted on the main AI page on the iROWiki. Just recently, I found a really old PvP Mod on Miranda's home page and I want to test it out. The problem here is that the AI I downloaded on the iROWiki doesn't have a GUI(is that the correct term?) for easy configuration and mod application.
My question here is, does the mod replace the whole function or just parts of it?
A little explanation.
--------------------------------------------------
function ModInit()
-- plugin initialization
--------------------------------------------------
-- Mir AI functions replacement
isKS = PvP_isKS
GetMyEnemy_AttackingMe = PvP_Def_Scan
GetMyEnemy_AnyNoKS = PvP_Atk_Scan
GetEnemyOf = PvP_GetEnemyOf
This part of the PvP Mod tells which functions to (partially?) replace I think. I will use the bolded line for an example.
--------------------------------------------------
function isKS()
-- used in OnCHASE_ST()
--------------------------------------------------
if 0 == IsMonster(MyEnemy) then return false; end -- for PvP mods
-- look at monster target
local mob_target = GetV(V_TARGET, MyEnemy)
if mob_target > 0 then
if not IsMonster2(mob_target) then
if (mob_target == MyID) or (mob_target == OwnerID) or (Friends[mob_target] ~= nil) then
return false
else
Log("MyEnemy was already in battle, action aborted (anti-KS)")
return true
end
end
end
-- look at (not friend) player targets
local actors = GetActors()
for i,v in ipairs(actors) do
if (v ~= OwnerID) and (v ~= MyID) then
if 0 == IsMonster(v) then -- if it is a player
if isNotFriend(v) then -- and not a friend
if GetV(V_TARGET, v) == MyEnemy then
Log("Another player is aiming at MyEnemy, action aborted (anti-KS)")
return true
end
end
end
end
end
return false
end
This is the function when I'm not using any mods.
--------------------------------------------------
function PvP_isKS()
--------------------------------------------------
return false -- there is no KS in PvP
end
This is the what the PvP Mod has.
Now, what usually happens when using a the Mod function on MirAI? Again, does it replace the whole thing or maybe just a part of it(looks like the first line if it is a partial rewrite)?
My question here is, does the mod replace the whole function or just parts of it?
A little explanation.
--------------------------------------------------
function ModInit()
-- plugin initialization
--------------------------------------------------
-- Mir AI functions replacement
isKS = PvP_isKS
GetMyEnemy_AttackingMe = PvP_Def_Scan
GetMyEnemy_AnyNoKS = PvP_Atk_Scan
GetEnemyOf = PvP_GetEnemyOf
This part of the PvP Mod tells which functions to (partially?) replace I think. I will use the bolded line for an example.
--------------------------------------------------
function isKS()
-- used in OnCHASE_ST()
--------------------------------------------------
if 0 == IsMonster(MyEnemy) then return false; end -- for PvP mods
-- look at monster target
local mob_target = GetV(V_TARGET, MyEnemy)
if mob_target > 0 then
if not IsMonster2(mob_target) then
if (mob_target == MyID) or (mob_target == OwnerID) or (Friends[mob_target] ~= nil) then
return false
else
Log("MyEnemy was already in battle, action aborted (anti-KS)")
return true
end
end
end
-- look at (not friend) player targets
local actors = GetActors()
for i,v in ipairs(actors) do
if (v ~= OwnerID) and (v ~= MyID) then
if 0 == IsMonster(v) then -- if it is a player
if isNotFriend(v) then -- and not a friend
if GetV(V_TARGET, v) == MyEnemy then
Log("Another player is aiming at MyEnemy, action aborted (anti-KS)")
return true
end
end
end
end
end
return false
end
This is the function when I'm not using any mods.
--------------------------------------------------
function PvP_isKS()
--------------------------------------------------
return false -- there is no KS in PvP
end
This is the what the PvP Mod has.
Now, what usually happens when using a the Mod function on MirAI? Again, does it replace the whole thing or maybe just a part of it(looks like the first line if it is a partial rewrite)?