simulationcraft / simc

Simulationcraft engine/GUI
GNU General Public License v3.0
1.32k stars 679 forks source link

Enhancement for generic proc effects #45

Closed navv1234 closed 8 years ago

navv1234 commented 8 years ago

Originally reported on Google Code with ID 46

If you know the properties of a proc it should be simple to create a
generic description to model it.  Similar to the spell_power_trinket you
have now.  Many items are currently not modeled in the simulator and having
a way to model these would be very handy.  In the boomkin simulator I wrote
I had a generic proc effect that would specify proc%, duration, cooldown,
and proc type/amount (ie haste/sp/ap) This would allow for modeling of
several items that are not currently modeled like "lightweave embroidery"
or "totem of the elemental plane"

Reported by ryttingm on 2009-03-30 17:20:21

navv1234 commented 8 years ago
Interesting idea.  We'd also have to specify a trigger: melee/spell hit/crit etc

It would enable us to toss out a ton of code in sc_unique_gear.cpp

Reported by natehieter on 2009-03-30 17:23:00

navv1234 commented 8 years ago
This is now available in the r2665 release.

Simply create an item and specify a use= or equip= parameter.

You can see some examples when saving a profile from the Armory with a supported trinket:

./simcraft armory=us,Llane,Segv save_profiles=1

Defaults from the code:

// ==========================================================================
// unique_gear_t::get_equip_encoding
// ==========================================================================

bool unique_gear_t::get_equip_encoding( std::string&       encoding,
                    const std::string& name )
{
  std::string e;

  // Stat Procs
  if( name == "blood_of_the_old_god"            ) e =
"OnAttackCrit_1284AP_10%_10Dur_50Cd";
  if( name == "comets_trail"                    ) e =
"OnAttackHit_612Haste_10%_10Dur_45Cd";
  if( name == "dark_matter"                     ) e =
"OnAttackHit_612Crit_15%_10Dur_45Cd";
  if( name == "darkmoon_card_crusade"           ) e = "OnSpellHit_8SP_10Stack_10Dur";
  if( name == "dying_curse"                     ) e = "OnSpellHit_765SP_15%_10Dur_45Cd";
  if( name == "elemental_focus_stone"           ) e =
"OnSpellHit_522Haste_10%_10Dur_45Cd";
  if( name == "embrace_of_the_spider"           ) e =
"OnSpellHit_505Haste_10%_10Dur_45Cd";
  if( name == "eye_of_magtheridon"              ) e = "OnSpellMiss_170SP_10Dur";
  if( name == "eye_of_the_broodmother"          ) e = "OnSpellHit_25SP_5Stack_10Dur";
  if( name == "flare_of_the_heavens"            ) e = "OnSpellHit_850SP_10%_10Dur_45Cd";
  if( name == "forge_ember"                     ) e = "OnSpellHit_512SP_10%_10Dur_45Cd";
  if( name == "fury_of_the_five_flights"        ) e = "OnAttackHit_16SP_20Stack_10Dur";
  if( name == "grim_toll"                       ) e =
"OnAttackHit_612ArPen_15%_10Dur_45Cd";
  if( name == "illustration_of_the_dragon_soul" ) e = "OnSpellHit_20SP_10Stack_10Dur";
  if( name == "mark_of_defiance"                ) e = "OnSpellHit_150Mana_15%_15Cd";
  if( name == "mirror_of_truth"                 ) e =
"OnAttackCrit_1000SP_10%_10Dur_50Cd";
  if( name == "mjolnir_runestone"               ) e =
"OnAttackHit_665ArPen_15%_10Dur_45Cd";
  if( name == "pandoras_plea"                   ) e = "OnSpellHit_850SP_10%_10Dur_45Cd";
  if( name == "pyrite_infuser"                  ) e =
"OnAttackCrit_1234AP_10%_10Dur_50Cd";
  if( name == "quagmirrans_eye"                 ) e =
"OnSpellHit_320Haste_10%_6Dur_45Cd";
  if( name == "shiffars_nexus_horn"             ) e = "OnSpellCrit_225SP_20%_10Dur_45Cd";
  if( name == "sextant_of_unstable_currents"    ) e = "OnSpellCrit_190SP_20%_15Dur_45Cd";
  if( name == "sundial_of_the_exiled"           ) e = "OnSpellHit_590SP_10%_10Dur_45Cd";
  if( name == "wrath_of_cenarius"               ) e = "OnSpellHit_132SP_5%_10Dur";

  // Discharge Procs
  if( name == "bandits_insignia"             ) e = "OnAttackHit_1880Arcane_15%_45Cd";
  if( name == "extract_of_necromantic_power" ) e = "OnTick_1050Shadow_10%_15Cd";
  if( name == "lightning_capacitor"          ) e = "OnSpellCrit_750Nature_3Stack_2.5Cd";
  if( name == "timbals_crystal"              ) e = "OnTick_380Shadow_10%_15Cd";
  if( name == "thunder_capacitor"            ) e = "OnSpellCrit_1276Nature_3Stack_2.5Cd";

  if( e.empty() ) return false;

  armory_t::format( e );
  encoding = e;

  return true;
}

// ==========================================================================
// unique_gear_t::get_use_encoding
// ==========================================================================

bool unique_gear_t::get_use_encoding( std::string&       encoding,
                      const std::string& name )
{
  std::string e;

  if( name == "living_flame"                ) e = "505SP_20Dur_120Cd";
  if( name == "mark_of_norgannon"           ) e = "491Haste_20Dur_120Cd";
  if( name == "scale_of_fates"              ) e = "432Haste_20Dur_120Cd";
  if( name == "wrathstone"                  ) e = "856AP_20Dur_120Cd";
  if( name == "energy_siphon"               ) e = "408SP_20Dur_120Cd";
  if( name == "platinum_disks_of_battle"    ) e = "752AP_20Dur_120Cd";
  if( name == "platinum_disks_of_sorcery"   ) e = "440SP_20Dur_120Cd";
  if( name == "platinum_disks_of_swiftness" ) e = "375Haste_20Dur_120Cd";
  if( name == "spirit_world_glass"          ) e = "336Spi_20Dur_120Cd";

  if( e.empty() ) return false;

  armory_t::format( e );
  encoding = e;

  return true;
}

Reported by natehieter on 2009-06-25 20:39:25