
Сообщение от
Arthaniques
А можешь скинуть статью про Фетиш?
Код:
// register_bonelink_fetish =================================================
static void register_bonelink_fetish( item_t* item )
{
player_t* p = item -> player;
bool heroic = item -> heroic();
bool lfr = item -> lfr();
uint32_t spell_id = heroic ? 109755 : lfr ? 109753 : 107998;
struct bonelink_fetish_callback_t : public action_callback_t
{
double chance;
attack_t* attack;
cooldown_t* cooldown;
rng_t* rng;
struct whirling_maw_t : public attack_t
{
whirling_maw_t( player_t* p, uint32_t spell_id ) :
attack_t( "bonelink_fetish", spell_id, p )
{
trigger_gcd = timespan_t::zero;
background = true;
may_miss = false;
may_glance = false;
may_crit = true;
proc = true;
aoe = -1;
direct_power_mod = extra_coeff();
init();
}
};
bonelink_fetish_callback_t( player_t* p, uint32_t id ) :
action_callback_t( p -> sim, p ), chance( p -> dbc.spell( id ) -> proc_chance() )
{
attack = new whirling_maw_t( p, p -> dbc.spell( id ) -> effect1().trigger_spell_id() );
cooldown = p -> get_cooldown( "bonelink_fetish" );
cooldown -> duration = timespan_t::from_seconds( 25.0 ); // 25 second ICD
rng = p -> get_rng ( "bonelink_fetish" );
}
virtual void trigger( action_t* a, void* /* call_data */ )
{
if ( a -> proc )
return;
if ( cooldown -> remains() > timespan_t::zero )
return;
if ( rng -> roll( chance ) )
{
attack -> execute();
cooldown -> start();
}
}
};
p -> register_attack_callback( RESULT_HIT_MASK, new bonelink_fetish_callback_t( p, spell_id ) );
}
Кд отображено, а вот шанс нет. "Нужно больше информации!"