BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => AoC 0.6.x Custom/Unofficial modules => Topic started by: heljeere on July 30, 2009, 02:42:44 pm

Title: AoC attribute trickle-down/stats calculator module
Post by: heljeere on July 30, 2009, 02:42:44 pm
Here's a little module I've made that calculates the actual gains from stat changes.

It's based on the information found here: http://community.ageofconan.com/wsp/conan/frontend.cgi?func=publish.show&template=content&func_id=2904&table=CONTENT

Usage:
Code: [Select]
!attribute <attribute name> <value>
Examples:
Code: [Select]
!attribute int 100
!attribute Wisdom 67

Module code:
Code: [Select]
<?php
  
/*
   * Attribute.php - An Age of Conan attribute calculator Module
   * For BeBot - An Anarchy Online & Age of Conan Chat Automaton Developed by Blondengy (RK1)
   * Copyright (C) 2009 Daniel Holmen
   *
   * As usual place this file in ./modules
   */
   
  /*
    Add a "_" at the beginning of the file (_Attribute.php) if you do not want it to be loaded.
  */

$attribute = new Attribute($bot);

class Attribute Extends BaseActiveModule
{
var $bot;
var $attribute;
var $returnstr;

/*
* Constructor:
* Hands over a referance to the "Bot" class.
*/
function __construct (&$bot)
{
parent::__construct(&$botget_class($this));

$this -> register_command("all""attribute""MEMBER");

$this -> help['description'] = 'Attribute trickle-down calculator';
$this -> help['command']['dummy'] = "";
}

function command_handler($name$msg$origin)
{
$output "";
if (strtolower($msg) == "attribute")
{
$output $this->generate_list();
}
else if (preg_match("/^attribute.*$/i"$msg))
{
// Handle arguments
$cmdparam explode(" "$msg);

$attr $this->get_attribute_name($cmdparam[1]);
if ($attr == "") return "No such attribute name";

$output $this->generate_list($attr$cmdparam[2]);
}
else $output "Invalid arguments";

return $output;
}

function get_attribute_name($name)
{
$aliases = array(
"int" => "Intelligence",
"con" => "Constitution",
"str" => "Strength",
"dex" => "Dexterity",
"wis" => "Wisdom"
);

$lowercasename trim(strtolower($name));
foreach($aliases as $key => $value)
{
if ($lowercasename == $key) return $value;
if ($lowercasename == strtolower($value)) return $value;


return "";
}

function generate_list($attr$value)
{
$output "<font face='HEADLINE' color=#c0c0c0>" $value " " $attr "</font><br>";
$linktitle "Calculated values for ".$value." ".$attr." (Click for info)";

$infolist $this->get_attribute($attr);

foreach ($infolist as $info) {
$output .= $info["Prefix"] . ($info["Factor"] * $value) . " " $info["Title"] ."<br>";
}
return "<a href=\"text://<div align=left>".$output."</div>\">".$linktitle."</a>";
}

function get_attribute($attr)
{
$attributelist = array(
"Strength" => array(
array("Factor" => 3, "Prefix" => "+""Title" => "Combat rating""Description" => "Increases Combat rating when using melee weapons (except daggers)"),
array("Factor" => 2, "Prefix" => "+""Title" => "Armor""Description" => "Increases Armor"),
array("Factor" => 0.05, "Prefix" => "+""Title" => "Natural Stamina regeneration""Description" => "Increases Natural Stamina regeneration"),
array("Factor" => 0.15, "Prefix" => "+""Title" => "OOC Stamina regeneration""Description" => "Increases Out of Combat Stamina regeneration"),
array("Factor" => 2, "Prefix" => "+""Title" => "Stamina""Description" => "Increases Stamina"),
array("Factor" => 0.15"Prefix" => "+""Title" => "OOC Health regeneration""Description" => "Increases Out of Combat Health regeneration")),
"Intelligence" => array(
array("Factor" => 0.6, "Prefix" => "+""Title" => "Spell damage (mage)""Description" => "Increases Spell damage for spells with Intelligence attribute (mage spells)"),
array("Factor" => 3, "Prefix" => "+""Title" => "Mana""Description" => "Increase Mana points"),
array("Factor" => 0.07, "Prefix" => "+""Title" => "Natural Mana regeneration""Description" => "Increases Natural Mana regeneration"),
array("Factor" => 0.5, "Prefix" => "+""Title" => "Protection from Electrical/Fire/Cold""Description" => "Increases protection from Electrical/Fire/Cold magic"),
array("Factor" => 0.38, "Prefix" => "+""Title" => "OOC Mana regeneration""Description" => "Increases Out of Combat Mana regeneration")),
"Constitution" => array(
array("Factor" => 8, "Prefix" => "+""Title" => "Health (Soldier)""Description" => "Increases Health points for Soldiers"),
array("Factor" => 6, "Prefix" => "+""Title" => "Health (Ranger, HoX, Assassin)""Description" => "Increases Health points for Ranger, HoX and Assassin"),
array("Factor" => 5, "Prefix" => "+""Title" => "Health (Other classes)""Description" => "Increases Health points for other classes"),
array("Factor" => 3, "Prefix" => "+""Title" => "Stamina""Description" => "Increase Stamina points"),
array("Factor" => 0.05, "Prefix" => "+""Title" => "Natural Stamina regeneration""Description" => "Increases Natural Stamina regeneration"),
array("Factor" => 0.15, "Prefix" => "+""Title" => "OOC Stamina regeneration""Description" => "Increase Out of Combat Stamina regeneration"),
array("Factor" => 0.15, "Prefix" => "+""Title" => "OOC Health regeneration""Description" => "Increases Out of Combat Health regeneration")),
"Dexterity" => array(
array("Factor" => 0.5, "Prefix" => "+""Title" => "Evade rating""Description" => "Increases Evade rating"),
array("Factor" => 2, "Prefix" => "+""Title" => "Stamina""Description" => "Increases Stamina points"),
array("Factor" => 3, "Prefix" => "+""Title" => "Combat rating (ranged, daggers)""Description" => "Increases Combat rating with ranged weapons and daggers"),
array("Factor" => 0.05, "Prefix" => "+""Title" => "Natural Stamina regeneration""Description" => "Increases Natural Stamina regeneration"),
array("Factor" => 0.15, "Prefix" => "+""Title" => "OOC Stamina regeneration""Description" => "Increases Out of Combat Stamina regeneration")),
"Wisdom" => array(
array("Factor" => 0.6, "Prefix" => "+""Title" => "Spell damage (priest)""Description" => "Increases Spell damage for spells with Wisdom attribute (priest spells)"),
array("Factor" => 3, "Prefix" => "+""Title" => "Mana""Description" => "Increases Mana points"),
array("Factor" => 0.07, "Prefix" => "+""Title" => "Natural Mana regeneration""Description" => "Increases Natural Mana regeneration"),
array("Factor" => 0.38, "Prefix" => "+""Title" => "OOC Mana regeneration""Description" => "Increase Out of Combat Mana regeneration"),
array("Factor" => 0.5, "Prefix" => "+""Title" => "Protection (Holy/Unholy)""Description" => "Increases Protection from Holy/Unholy magic"))
 ); 

return $attributelist[$attr];
}
}
?>
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: Poonjab on July 30, 2009, 10:45:12 pm
Very nice.  I'll be checkin this out when I get a chance.
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: DJKRose on August 01, 2009, 03:21:42 am
Looks good! I'm gonna test it soon...
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: Poonjab on August 03, 2009, 05:27:24 pm
This module is working great and is already very popular in my guild.  Thanks again.
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: heljeere on August 06, 2009, 08:36:37 am
Happy to hear that. :)

Let me know if you find any mistakes/miscalculations. I do hope Funcom will update the online reference list if they change the values.
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: Drizzurdeen on August 08, 2009, 12:27:47 am
thanks for this module ... works perfekt ... my guild love it ;) ... an so what i can see all should be correct
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: Kore on January 30, 2010, 06:31:31 am
This is great but you missed somthing..

Increases Protection from Electrical/Fire/Cold magic by 0.5 = INT

Same with Wisdom.

Increases Protection from Holy/Unholy magic by 0.5 = WIS
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: TBK on June 04, 2010, 01:54:34 am
Anybody got the trickle-down values for critigation?
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: heljeere on June 21, 2010, 01:05:40 pm
This is great but you missed somthing..

Increases Protection from Electrical/Fire/Cold magic by 0.5 = INT

Same with Wisdom.

Increases Protection from Holy/Unholy magic by 0.5 = WIS

Updated the code with elemental protection. The spiritual protection was already there, though.
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: snyder on June 21, 2010, 01:46:49 pm
thx bebot nub :)
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: Pituvul on July 22, 2012, 10:27:41 pm
Edited the Attribute calculator that Heljeere initially posted and added all the important stats, simplified the command and customized the displayed results.
Pit
Title: Re: AoC attribute trickle-down/stats calculator module
Post by: Panther on September 13, 2012, 10:29:03 am
Very nice, my guild is going to love this one!
SimplePortal 2.3.7 © 2008-2024, SimplePortal