Merge pull request #22 from ItsStev/roleplay-experience
Roleplay experience
This commit is contained in:
commit
f14dfe8951
@ -171,6 +171,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid )
|
||||
//SendServerMessage( playerid, "You've made "COL_GOLD"%s"COL_WHITE" from exporting. Go and pick another box up!" );
|
||||
GivePlayerCash( playerid, cash );
|
||||
GivePlayerScore( playerid, 5 );
|
||||
GivePlayerExperience( playerid, E_ROLEPLAY );
|
||||
|
||||
DestroyDynamicMapIcon( p_LumberjackMapIcon[ playerid ] );
|
||||
p_LumberjackMapIcon[ playerid ] = CreateDynamicMapIconEx( -2330.8535, -113.9084, 34.00, 51, 0, MAPICON_GLOBAL, 6000.0, { -1 }, { -1 }, aPlayer );
|
||||
|
@ -155,22 +155,17 @@ hook OnProgressCompleted( playerid, progressid, params )
|
||||
if ( progressid == PROGRESS_MINING )
|
||||
{
|
||||
new m = p_MiningOre{ playerid };
|
||||
new iRandom = random( 101 );
|
||||
new iRandom = random( 100 );
|
||||
|
||||
p_isMining{ playerid } = false;
|
||||
g_miningData[ m ] [ E_MINING ] = INVALID_PLAYER_ID;
|
||||
|
||||
if ( ( g_miningData[ m ] [ E_ORE ] == ORE_IRON && iRandom > 80 ) ||
|
||||
( g_miningData[ m ] [ E_ORE ] == ORE_BAUXITE && iRandom > 85 ) ||
|
||||
( g_miningData[ m ] [ E_ORE ] == ORE_GOLD && iRandom > 45 ) ||
|
||||
( g_miningData[ m ] [ E_ORE ] == ORE_COAL && iRandom > 90 ||
|
||||
( g_miningData[ m ] [ E_ORE ] == ORE_DIAMOND && iRandom > 30 ) ||
|
||||
( g_miningData[ m ] [ E_ORE ] == ORE_RUBY && iRandom > 35 ) ||
|
||||
( g_miningData[ m ] [ E_ORE ] == ORE_SAPHHIRE && iRandom > 30 ) ||
|
||||
( g_miningData[ m ] [ E_ORE ] == ORE_EMERALD && iRandom > 52 ) ||
|
||||
( g_miningData[ m ] [ E_ORE ] == ORE_PLATINUM && iRandom > 25 ) ||
|
||||
( g_miningData[ m ] [ E_ORE ] == ORE_AMETHYST && iRandom > 75 ) )
|
||||
)
|
||||
new Float: random_chance = fRandomEx( 0.0, 101.0 );
|
||||
|
||||
random_chance += GetPlayerLevel( playerid, E_ROLEPLAY ) * 0.2;
|
||||
|
||||
// potential for a 20% success rate
|
||||
if ( random_chance < 20.0 )
|
||||
{
|
||||
SetPlayerMineOre( playerid, m );
|
||||
return SendError( playerid, "You did not find any ore. Mining again." );
|
||||
@ -209,6 +204,7 @@ hook OnPlayerEnterDynamicCP( playerid, checkpointid )
|
||||
|
||||
new earned_money = floatround( float( g_orePrices[ g_miningData[ ore ] [ E_ORE ] ] ) * 0.5 );
|
||||
|
||||
GivePlayerExperience( playerid, E_ROLEPLAY );
|
||||
GivePlayerCash( playerid, earned_money );
|
||||
StockMarket_UpdateEarnings( E_STOCK_MINING_COMPANY, earned_money, 0.5 );
|
||||
SendServerMessage( playerid, "You have crushed a "COL_GREY"%s"COL_WHITE" Ore and earned "COL_GOLD"%s"COL_WHITE".", getOreName( g_miningData[ ore ] [ E_ORE ] ), cash_format( earned_money ) );
|
||||
@ -383,7 +379,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid )
|
||||
GivePlayerCash( playerid, cashEarned );
|
||||
StockMarket_UpdateEarnings( E_STOCK_MINING_COMPANY, cashEarned, 0.5 );
|
||||
GivePlayerScore( playerid, floatround( oresExported / 2 ) ); // 16 score is a bit too much for ore... so half that = 8
|
||||
//GivePlayerExperience( playerid, E_MINING, float( oresExported ) * 0.2 );
|
||||
GivePlayerExperience( playerid, E_ROLEPLAY, float( oresExported ) * 0.2 );
|
||||
SendServerMessage( playerid, "You have exported %d rock ore(s) to an industry, earning you "COL_GOLD"%s"COL_WHITE".", oresExported, cash_format( cashEarned ) );
|
||||
}
|
||||
return Y_HOOKS_BREAK_RETURN_1;
|
||||
|
@ -185,6 +185,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid )
|
||||
GivePlayerScore( playerid, 1 + floatround( p_PilotDistance[ playerid ] / 1000.0 ) );
|
||||
StockMarket_UpdateEarnings( E_STOCK_AVIATION, cash_earned, stock_dividend_allocation );
|
||||
GivePlayerCash( playerid, cash_earned );
|
||||
GivePlayerExperience( playerid, E_ROLEPLAY );
|
||||
|
||||
ShowPlayerHelpDialog( playerid, 5000, "You have earned ~y~%s ~w~for exporting %s!", cash_format( cash_earned ), g_CargoName[ p_PilotCargo[ playerid ] ] );
|
||||
StopPlayerPilotWork( playerid );
|
||||
|
@ -134,6 +134,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid )
|
||||
|
||||
GivePlayerScore( playerid, 1 + floatround( p_TrainDistance[ playerid ] / 1000.0 ) );
|
||||
GivePlayerCash( playerid, iCashEarned );
|
||||
GivePlayerExperience( playerid, E_ROLEPLAY );
|
||||
|
||||
ach_HandleTrainMissions( playerid );
|
||||
|
||||
|
@ -181,6 +181,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid )
|
||||
GivePlayerScore( playerid, 1 + floatround( p_TruckingDistance[ playerid ] / 1000.0 ) );
|
||||
StockMarket_UpdateEarnings( E_STOCK_TRUCKING_COMPANY, iCashEarned, .factor = 1.0 );
|
||||
GivePlayerCash( playerid, iCashEarned );
|
||||
GivePlayerExperience( playerid, E_ROLEPLAY );
|
||||
|
||||
p_TruckingDistance [ playerid ] = 0.0;
|
||||
p_hasTruckingJob { playerid } = false;
|
||||
|
@ -19,6 +19,7 @@ enum E_LEVELS {
|
||||
E_POLICE,
|
||||
E_ROBBERY,
|
||||
E_DEATHMATCH,
|
||||
E_ROLEPLAY
|
||||
|
||||
/*E_FIREMAN,
|
||||
E_PARAMEDIC,
|
||||
@ -51,8 +52,10 @@ static const
|
||||
{
|
||||
// Level Name Bar Color Level 100 Req. XP Dilation Sell Value
|
||||
{ "Police", 0x3E7EFFFF, 7500.0, 20.0, 10.0 }, // 7.5k arrests
|
||||
{ "Robbery", 0xF83245FF, 30000.0, 15.0, 10.0 }, // 30K robberies
|
||||
{ "Deathmatch", 0xFF9233FF, 75000.0, 10.0, 5.0 } // 75K kills
|
||||
{ "Robbery", 0xF83245FF, 30000.0, 15.0, 10.0 }, // 30k robberies
|
||||
{ "Deathmatch", 0xFF9233FF, 75000.0, 10.0, 5.0 }, // 75k kills
|
||||
{ "Roleplay", 0x33FF50FF, 75000.0, 10.0, 12.0 } // 75k minijob
|
||||
|
||||
/*
|
||||
{ "Fireman", 10000.0, 9.0 }, // 10k fires
|
||||
{ "Hitman", 1500.0, 4.5 }, // 1.5k contracts
|
||||
|
Loading…
Reference in New Issue
Block a user