KarmaSystem

From Legends of Aria Admin and Modding Wiki
Revision as of 09:10, 27 January 2018 by Gizmo (talk | contribs) (Created page with "'' welcome this will discuss the contents of the globals\helpers\conflict.lua this documentation is correct as of version 6.0 PRECB1 Release '' == Conflict Functions ==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

 welcome this will discuss the contents of the globals\helpers\conflict.lua
 this documentation is correct as of version 6.0 PRECB1 Release 

Conflict Functions

AdjustKarma

 -- Adjust the karma for a mobile, a system message pertaining to the change is sent.
 -- @param mobile(mobileObj)
 -- @param amount(number) The amount to adjust by.
 -- @return none
 function AdjustKarma(mobile, amount)
   if ( amount == 0 or amount == nil ) then return end
   local karma = GetKarma(mobile)
   -- cache the karma level so we can check if it changed.
   local karmaLevel = GetKarmaLevel(karma)
   karma = math.floor(karma + amount + 0.5)
   SetKarma(mobile, karma)
   if ( amount > 0 ) then
       mobile:SystemMessage("You have gained"..GetKarmaStringAmount(amount).."karma.", "info")
   else
       mobile:SystemMessage("You have lost"..GetKarmaStringAmount(math.abs(amount)).."karma.", "info")
   end
   if ( karmaLevel.Name ~= GetKarmaLevel(karma).Name ) then
       -- Karma was changed, update the name and whatever else, maybe a message?
       mobile:SendMessage("UpdateName")
   end
 end

AlterKarmaAction

CheckKarmaBeneficialAction

CheckKarmaLoot

ColorizeMobileName

ColorizePlayerName

DailyLogin

ExectueKarmaAction

GetKarma

GetKarmaLevel

GetKarmaStringAmount

KarmaPunishAllAggressorsForMurder

SetKarma

WithinKarmaArea