Merge pull request #34 from donkeypunchepoch/master

Nice work! :)
This commit is contained in:
eraser1 2016-02-17 17:30:14 -06:00
commit 53b26e5ec0
2 changed files with 99 additions and 10 deletions

View File

@ -21,6 +21,12 @@ DMS_Use_Map_Config = true; // Whether or not to use config overwrites specific t
For any questions regarding map-specific configs, please leave a reply in the DMS thread on the Exile forums.
*/
DMS_Enable_RankChange = false; // Whether or not to use Rank Changes.
/*
I am sharing this upgrade to all. If you utilize GR8 Humanity(fully compatible) or a custom version of a ranking system(simple variable changes), this will allow your players to score +/- for Bandit and Hero kills as well as a custom Survivor Faction added to DMS as well. You can still utilize the HERO / BANDIT / SURVIVOR respect and poptab settings for gameplay :) ENJOY! DONKEYPUNCH.INFO!
*/
DMS_Add_AIKill2DB = false; // Adds killstat for player in the database ;)
/* Mission System Settings */
/*General settings for dynamic missions*/
@ -248,27 +254,78 @@ DMS_Use_Map_Config = true; // Whether or not to use config overwrites specific t
DMS_Show_Kill_Poptabs_Notification = true; // Whether or not to show the poptabs gained/lost message on the player's screen when killing an AI. (It will still change the player's money, it just won't show the "Money Received" notification)
DMS_Show_Kill_Respect_Notification = true; // Whether or not to show the "Frag Message" on the player's screen when killing an AI. (It will still change the player's respect, it just won't show the "AI Killed" frag message)
DMS_Show_Kill_Rank_Notification = true;
DMS_Show_Party_Kill_Notification = true; // Whether or not to show in chat when a party member kills an AI.
DMS_Bandit_Soldier_MoneyGain = 50; // The amount of Poptabs gained for killing a bandit soldier
DMS_Bandit_Soldier_RepGain = 10; // The amount of Respect gained for killing a bandit soldier
DMS_Bandit_Soldier_RankGain = 15;
DMS_Bandit_Static_MoneyGain = 75; // The amount of Poptabs gained for killing a bandit static gunner
DMS_Bandit_Static_RepGain = 15; // The amount of Respect gained for killing a bandit static gunner
DMS_Bandit_Static_RankGain = 30;
DMS_Bandit_Vehicle_MoneyGain = 100; // The amount of Poptabs gained for killing a bandit vehicle crew member
DMS_Bandit_Vehicle_RepGain = 25; // The amount of Respect gained for killing a bandit vehicle crew member
DMS_Bandit_Vehicle_RankGain = 50;
/* DonkeyPunchDMS Custom Settings for Hero AI*/
DMS_Hero_Soldier_MoneyGain = 100; // The amount of Poptabs gained for killing a hero soldier
DMS_Hero_Soldier_RepGain = 20; // The amount of Respect gained for killing a hero soldier
DMS_Hero_Soldier_RankGain = -30;
DMS_Hero_Static_MoneyGain = 120; // The amount of Poptabs gained for killing a hero static gunner
DMS_Hero_Static_RepGain = 30; // The amount of Respect gained for killing a hero static gunner
DMS_Hero_Static_RankGain = -60;
DMS_Hero_Vehicle_MoneyGain = 200; // The amount of Poptabs gained for killing a hero vehicle crew member
DMS_Hero_Vehicle_RepGain = 50; // The amount of Respect gained for killing a hero vehicle crew member
DMS_Hero_Vehicle_RankGain = -100;
/* DonkeyPunchDMS Custom Settings for Survivor AI*/
DMS_Survivor_Soldier_MoneyGain = -100; // The amount of Poptabs gained for killing a Survivor soldier
DMS_Survivor_Soldier_RepGain = -100; // The amount of Respect gained for killing a Survivor soldier
DMS_Survivor_Soldier_RankGain = -250;
DMS_Survivor_Static_MoneyGain = -100; // The amount of Poptabs gained for killing a Survivor static gunner
DMS_Survivor_Static_RepGain = -100; // The amount of Respect gained for killing a Survivor static gunner
DMS_Survivor_Static_RankGain = -400;
DMS_Survivor_Vehicle_MoneyGain = -500; // The amount of Poptabs gained for killing a Survivor vehicle crew member
DMS_Survivor_Vehicle_RepGain = -100; // The amount of Respect gained for killing a Survivor vehicle crew member
DMS_Survivor_Vehicle_RankGain = -600;
DMS_AIKill_DistanceBonusMinDistance = 100; // Minimum distance from the player to the AI to apply the distance bonus.
DMS_AIKill_DistanceBonusCoefficient = 0.05; // If the distance from the player to the killed unit is more than "DMS_AIKill_DistanceBonusMinDistance" meters then the player gets a respect bonus equivalent to the distance multiplied by this coefficient. For example, killing an AI from 400 meters will give 100 extra respect (when the coefficient is 0.25). Set to 0 to disable the bonus. This bonus will not be applied if there isn't a regular AI kill bonus.
DMS_Diff_RepOrTabs_on_roadkill = true; // Whether or not you want to use different values for giving respect/poptabs when you run an AI over. Default values are NEGATIVE. This means player will LOSE respect or poptabs.
DMS_Bandit_Soldier_RoadkillMoney = -10; // The amount of Poptabs gained/lost for running over a bandit soldier
DMS_Bandit_Soldier_RoadkillRep = -5; // The amount of Respect gained/lost for running over a bandit soldier
DMS_Bandit_Soldier_RoadkillRank = 20;
DMS_Bandit_Static_RoadkillMoney = -10; // The amount of Poptabs gained/lost for running over a bandit static gunner
DMS_Bandit_Static_RoadkillRep = -5; // The amount of Respect gained/lost for running over a bandit static gunner
DMS_Bandit_Static_RoadkillRank = 30;
DMS_Bandit_Vehicle_RoadkillMoney = -10; // The amount of Poptabs gained/lost for running over a bandit vehicle crew member
DMS_Bandit_Vehicle_RoadkillRep = -5; // The amount of Respect gained/lost for running over a bandit vehicle crew member
DMS_Bandit_Vehicle_RoadkillRank = 50;
/* DonkeyPunchDMS Custom RoadKill Settings for Hero AI*/
DMS_Hero_Soldier_RoadkillMoney = 20; // The amount of Poptabs gained/lost for running over a hero soldier
DMS_Hero_Soldier_RoadkillRep = 10; // The amount of Respect gained/lost for running over a hero soldier
DMS_Hero_Soldier_RoadkillRank = -40;
DMS_Hero_Static_RoadkillMoney = 20; // The amount of Poptabs gained/lost for running over a hero static gunner
DMS_Hero_Static_RoadkillRep = 10; // The amount of Respect gained/lost for running over a hero static gunner
DMS_Hero_Static_RoadkillRank = -60;
DMS_Hero_Vehicle_RoadkillMoney = 20; // The amount of Poptabs gained/lost for running over a hero vehicle crew member
DMS_Hero_Vehicle_RoadkillRep = 10; // The amount of Respect gained/lost for running over a hero vehicle crew member
DMS_Hero_Vehicle_RoadkillRank = -100;
/* DonkeyPunchDMS Custom Roadkill Settings for Survivor AI*/
DMS_Survivor_Soldier_RoadkillMoney = -200; // The amount of Poptabs gained/lost for running over a Survivor soldier
DMS_Survivor_Soldier_RoadkillRep = -200; // The amount of Respect gained/lost for running over a Survivor soldier
DMS_Survivor_Soldier_RoadkillRank = -200;
DMS_Survivor_Static_RoadkillMoney = -200; // The amount of Poptabs gained/lost for running over a Survivor static gunner
DMS_Survivor_Static_RoadkillRep = -200; // The amount of Respect gained/lost for running over a Survivor static gunner
DMS_Survivor_Static_RoadkillRank = -200;
DMS_Survivor_Vehicle_RoadkillMoney = -500; // The amount of Poptabs gained/lost for running over a Survivor vehicle crew member
DMS_Survivor_Vehicle_RoadkillRep = -100; // The amount of Respect gained/lost for running over a Survivor vehicle crew member
DMS_Survivor_Vehicle_RoadkillRank = -100;
DMS_banditSide = EAST; // The side (team) that AI Bandits will spawn on
/* DonkeyPunchDMS Custom Side Factions */
DMS_heroSide = WEST; // The side (team) that AI Heros will spawn on
DMS_survivorSide = CIV; // The side (team) that AI Survivor will spawn on
DMS_clear_AI_body = false; // Clear AI body as soon as they die
DMS_clear_AI_body_chance = 50; // Percentage chance that AI bodies will be cleared when they die
DMS_ai_disable_ramming_damage = true; // Disables damage due to ramming into AI. !!!NOTE: THIS WILL NOT BE RELIABLE WITH "DMS_ai_offload_to_client"!!!

View File

@ -38,12 +38,13 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U
{
_moneyChange = missionNamespace getVariable [format ["DMS_%1_%2_MoneyGain",_AISide,_AIType],0];
_repChange = missionNamespace getVariable [format ["DMS_%1_%2_RepGain",_AISide,_AIType],0];
// Check for individually defined AI money/respect.
_rankChange = missionNamespace getVariable [format ["DMS_%1_%2_RankGain",_AISide,_AIType],0];
// Check for individually defined AI money/respect/rank.
_unitMoney = _unit getVariable ["DMS_AI_Money",""];
_unitRespect = _unit getVariable ["DMS_AI_Respect",""];
_unitRank = _unit getVariable ["DMS_AI_Rank",""];
if !(_unitMoney isEqualTo "") then
{
_moneyChange = _unitMoney;
@ -53,25 +54,32 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U
{
_repChange = _unitRespect;
};
if !(_unitRank isEqualTo "") then
{
_rankChange = _unitRank;
};
if (_roadKilled && {_unit getVariable ["DMS_Diff_RepOrTabs_on_roadkill",DMS_Diff_RepOrTabs_on_roadkill]}) then
{
_moneyChange = missionNamespace getVariable [format ["DMS_%1_%2_RoadkillMoney",_AISide,_AIType],0];
_repChange = missionNamespace getVariable [format ["DMS_%1_%2_RoadkillRep",_AISide,_AIType],0];
_rankChange = missionNamespace getVariable [format ["DMS_%1_%2_RoadkillRank",_AISide,_AIType],0];
};
if ((_moneyChange!=0) || {_repChange!=0}) then
if ((_moneyChange!=0) || (_repChange!=0) || (_rankChange!=0)) then
{
_playerMoney = _playerObj getVariable ["ExileMoney", 0];
_playerRespect = _playerObj getVariable ["ExileScore", 0];
_playerRank = _playerObj getVariable ["ExileHumanity", 0];
_unitName = name _unit;
/*
if (DMS_DEBUG) then
{
format ["PlayerAwardOnAIKill :: Attempting to give %1 (%2) %3 poptabs and %4 respect. Player currently has %5 tabs and %6 respect.", name _playerObj, _playerUID, _moneyChange, _repChange, _playerMoney, _playerRespect] call DMS_fnc_DebugLog;
format ["PlayerAwardOnAIKill :: Attempting to give %1 (%2) %3 poptabs and %4 respect and %5 rank. Player currently has %6 tabs and %7 respect and &8 rank.", name _playerObj, _playerUID, _moneyChange, _repChange, _rankChange,_playerMoney, _playerRespect,_playerRank] call DMS_fnc_DebugLog;
};
*/
@ -148,7 +156,30 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U
(owner _playerObj) publicVariableClient "ExileClientPlayerScore";
ExileClientPlayerScore = nil;
};
//DONKEYPUNCH CUSTOM KILL STAT ADD FOR AI KILL
if (DMS_Add_AIKill2DB) then
{
_newKillerFrags = _killer getVariable ["ExileKills", 0];
_newKillerFrags = _newKillerFrags + 1;
_killer setVariable ["ExileKills", _newKillerFrags];
format["addAccountKill:%1", getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget;
ExileClientPlayerKills = _newKillerFrags;
(owner _playerObj) publicVariableClient "ExileClientPlayerKills";
ExileClientPlayerKills = nil;
};
//DONKEYPUNCH CUSTOM KILL RANK CHANGE FOR AI KILL
if (DMS_Enable_RankChange) then
{
if (_rankChange!=0) then
{
_playerRank = (_playerRank+_rankChange);
_killer setVariable ["ExileRank",_playerRank];
format["modifyAccountHumanity:%1:%2",_rankChange,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget;
ExileClientPlayerHumanity = _playerRank;
(owner _playerObj) publicVariableClient "ExileClientPlayerHumanity";
ExileClientPlayerHumanity = nil;
};
};
if (DMS_DEBUG) then
{
format ["PlayerAwardOnAIKill :: %1 (%2) awarded %3 poptabs and %4 respect for killing %5. Player's money is now %6, and respect is now %7. Roadkill: %8", name _playerObj, _playerUID, _moneyChange, _repChange, _unit, _playerMoney, _playerRespect, _roadKilled] call DMS_fnc_DebugLog;
@ -167,12 +198,13 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U
{
_msg = format
[
"%1 killed %2 from %3 meters away and received %4 poptabs and %5 respect.",
"%1 killed %2 from %3 meters away and received %4 poptabs, %5 respect and %6 rank.",
name _playerObj,
_unitName,
if !(isNil "_distance") then {_distance} else {floor(_unit distance _playerObj)},
_moneyChange,
_repChange
_repChange,
_rankChange
];
{
_msg remoteExecCall ["systemChat", _x];