|
|
@ -11,6 +11,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "../../stdafx.h"
|
|
|
|
#include "../../stdafx.h"
|
|
|
|
#include "script_base.hpp"
|
|
|
|
#include "script_base.hpp"
|
|
|
|
|
|
|
|
#include "script_error.hpp"
|
|
|
|
#include "../../network/network.h"
|
|
|
|
#include "../../network/network.h"
|
|
|
|
#include "../../core/random_func.hpp"
|
|
|
|
#include "../../core/random_func.hpp"
|
|
|
|
|
|
|
|
|
|
|
@ -42,7 +43,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
/* static */ bool ScriptBase::Chance(uint out, uint max)
|
|
|
|
/* static */ bool ScriptBase::Chance(uint out, uint max)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return (uint16)Rand() <= (uint16)((65536 * out) / max);
|
|
|
|
EnforcePrecondition(false, out <= max);
|
|
|
|
|
|
|
|
return (uint16)Rand() <= (uint16)((65535 * out) / max);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* static */ bool ScriptBase::ChanceItem(int unused_param, uint out, uint max)
|
|
|
|
/* static */ bool ScriptBase::ChanceItem(int unused_param, uint out, uint max)
|
|
|
|