- Inscrit
- 23 Janvier 2019
- Messages
- 9
- Reactions
- 5
Dofus semble faire de l'analyse comportementale.
Un exemple qui se trouve dans le LuaFormulas
Un exemple qui se trouve dans le LuaFormulas
Code:
{
"id": 18,
"formulaName": "antibot_money_transfer_limitation",
"luaFormula": ""
},
Code:
function params()
return
end
function main()
return getLimitation(no_limit_flag, 10, 3000000, 4, 10, 2, best_character_level, played_time, subscribed_once)
end
function getLimitation( no_limit_flag, level_range, level_range_boost, level_max_ratio, played_time_expectation, subscription_boost_ratio, best_character_level, played_time, subscribed_once )
-- Compute level ratio based on the level range, for the best character of an account, on a specific server
assert(best_character_level > 0, "Best character level must be gt. 0");
assert(level_range > 0, "Level range must be gt. 0");
local raw_level_best_character_ratio = best_character_level / level_range;
-- Compute cross-server cumulated account played time ratio based on a defined played time reference
assert(played_time_expectation >= 0, "Cumulated played time must be ge. 0");
assert(played_time >= 0, "Played time must be ge. 0")
local raw_played_time_ratio = 0;\n
if played_time_expectation ~= 0 then
raw_played_time_ratio = played_time / played_time_expectation;
end\
-- Check whether the player should have money transfer limitation or not
assert(level_max_ratio >= 0, "Level max ratio must be ge. 0");
assert(subscribed_once ~= nil, "Subscription status can not be nil");
if (raw_level_best_character_ratio >= level_max_ratio ) and (raw_played_time_ratio >= 1) and subscribed_once then
return no_limit_flag;
end
-- Compute boost, for the best character of an account, on a specific server
local best_character_level_ratio = math.min(level_max_ratio, raw_level_best_character_ratio);
assert(best_character_level_ratio > 0 and best_character_level_ratio <= level_max_ratio);
assert(level_range_boost >= 0, "Level range boost must be ge. 0");
local raw_best_character_level_boost = best_character_level_ratio * level_range_boost;
local best_character_level_boost = math.max(0, raw_best_character_level_boost);
-- Compute money transfer limit
local raw_limit = level_range_boost + best_character_level_boost;
local played_time_ratio = 1 + math.min(1, raw_played_time_ratio);
raw_limit = raw_limit * played_time_ratio;
assert(subscription_boost_ratio >= 1, "Subscription boost ratio must be ge. 1");
if subscribed_once then
raw_limit = raw_limit * subscription_boost_ratio;
end
local limit = math.max(no_limit_flag, raw_limit);
assert(limit >= level_range_boost);
return limit;
end