Raised This Month: $51 Target: $400
 12% 

Points multiplier (happy hours)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 05-13-2016 , 11:22   Points multiplier (happy hours)
Reply With Quote #1

Hello, I'm trying to make a "happy hour" - a time frame, when all points scored are being multiplied. I looked into the ingame plugin, but I didn't find anything useful - I guess this whole stuff is handled by a daemon. Could you please help me and at least show me the way I should go?
__________________

Last edited by Wilczek; 05-13-2016 at 11:22.
Wilczek is offline
melkor217
Junior Member
Join Date: May 2016
Old 05-13-2016 , 13:26   Re: Points multiplier (happy hours)
Reply With Quote #2

Look at "sub calcSkill" (line ~390) in hlstats.pl

Just modify dis:

my $modifier = 1.00;
# Look up the weapon's skill modifier
if (defined($g_games{$g_servers{$s_addr}->{game}}{weapons}{$weapon})) {
$modifier = $g_games{$g_servers{$s_addr}->{game}}{weapons}{$weapon}{modifier};
}

to check current time.
melkor217 is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 05-15-2016 , 16:20   Re: Points multiplier (happy hours)
Reply With Quote #3

Thanks melkor217!

If anyone else finds this thread, this is what I've came up with.

hlstats.pl (lines 482 - 489):
PHP Code:
#$killerSkill += $killerSkillChange;
  
my $hour = (localtime)[2];
  if ( 
$hour >= $g_happystart or $hour $g_happyend ) {
      
$killerSkill += ($killerSkillChange $g_happymultiplier);
  } else {
      
$killerSkill += $killerSkillChange;
  }
  
$victimSkill -= $victimSkillChange
hlstats.pl (lines 1515 - 1518 ):
PHP Code:
$g_gi undef;
$g_happystart 22;
$g_happyend 6;
$g_happymultiplier 2
hlstats.pl (lines 1789 - 1792):
PHP Code:
        "Proxy_Key",                "proxy_key",
        
"HappyStart",                "g_happystart",
        
"HappyEnd",                    "g_happyend",
        
"HappyMultiplier",            "g_happymultiplier" 

web\pages\admintasks\options.php (lines 281 - 284):
PHP Code:
    $optiongroups[50]->options[] = new Option('SkillRatioCap''*Cap killer\'s gained skill with ratio using *XYZ*SaYnt\'s method "designed such that an excellent player will have to get about a 2:1 ratio against noobs to hold steady in points"''select');
    
$optiongroups[50]->options[] = new Option('HappyStart''*Time when Happy Hours should start. Default 22''text');
    
$optiongroups[50]->options[] = new Option('HappyEnd''*Time when Happy Hours should end. Default 6''text');
    
$optiongroups[50]->options[] = new Option('HappyMultiplier''*Points multiplier during Happy Hours. Default 2''text'); 
__________________
Wilczek is offline
micazoid
Veteran Member
Join Date: Oct 2010
Location: Munich - Germany
Old 05-17-2016 , 05:13   Re: Points multiplier (happy hours)
Reply With Quote #4

That is quite awesome =)

Thank you very much for sharing! Is this working well?
__________________
micazoid is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode