Difference between revisions of "ConflictSystem"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
(GetConflictTable)
(SetConflictTable)
Line 37: Line 37:
  
 
=== SetConflictTable ===
 
=== SetConflictTable ===
 +
''
 +
  -- Set the conflict table for a mobile
 +
  -- @param mobile(mobileObj)
 +
  -- @param data(luaTable)
 +
  -- @return none
 +
 +
  function SetConflictTable(mobile, data)
 +
    mobile:SetObjVar("Conflicts", data)
 +
  end
 +
''
 +
 
=== FreezeConflictTable ===
 
=== FreezeConflictTable ===
 
=== GetConflictRelation ===
 
=== GetConflictRelation ===

Revision as of 07:50, 27 January 2018

welcome this will discuss the contents of the globals\helpers\conflict.lua

ConflictRelations Table

Conflict Functions

GetConflictTable

 -- Get the conflict table for a mobile
 -- @param mobile(mobileObj)
 -- @return luaTable containing all conflicts for this mobile
 function GetConflictTable(mobile)
   if ( mobile == nil or not mobile ) then
       LuaDebugCallStack("[Conflict] Invalid mobile provided.")
       return {}
   end
   return mobile:GetObjVar("Conflicts") or {}
 end

ClearConflictTable

 -- Clear the conflict table of a mobile
 -- @param mobile(mobileObj)
 -- @return none
 function ClearConflictTable(mobile, isPlayer)
   if ( mobile == nil or not mobile ) then
       LuaDebugCallStack("[Conflict] Invalid mobile provided.")
       return
   end
   if ( mobile:HasObjVar("Conflicts") ) then
       mobile:DelObjVar("Conflicts")
   end
   if ( isPlayer == true ) then
       InitializeClientConflicts(mobile)
   end
 end

SetConflictTable

 -- Set the conflict table for a mobile
 -- @param mobile(mobileObj)
 -- @param data(luaTable)
 -- @return none
 function SetConflictTable(mobile, data)
   mobile:SetObjVar("Conflicts", data)
 end

FreezeConflictTable

GetConflictRelation

ValidConflictRelationTable

UpdateConflictRelation

ConflictEquals

AdvanceConflictRelation

ForeachAggressor

IsAggressor

IsMobTaggedBy

TagMob

InheritAggressivePlayerConflicts

GetNearbyTaggedMobiles

InitializeClientConflicts