• 0
Sign in to follow this  
Followers 0
Kuroe

Guild Skill Notification

Question

Posted (edited)

Hello. I found this src edit on rathena by anacondaqq

Quote
// Blocks all guild skills which have a common delay time.
int guild_block_skill_end(int tid, unsigned int tick, int id, intptr_t data) {
	struct guild *g;
	char output[128];
	int idx = battle_config.guild_skills_separed_delay ? (int)data - GD_SKILLBASE : 0;

	if( (g = guild_search(id)) == NULL )
		return 1;

	if( idx < 0 || idx >= MAX_GUILDSKILL )
	{
		ShowError("guild_block_skill_end invalid skill_id %d.\n", (int)data);
		return 0;
	}

	if( tid != g->skill_block_timer[idx] )
	{
		ShowError("guild_block_skill_end %d != %d.\n", g->skill_block_timer[idx], tid);
		return 0;
	}

HERE ---------->>>>>	sprintf(output, "%s : Guild Skill %s Ready!!", g->name, skill_get_desc((int)data));
	g->skill_block_timer[idx] = INVALID_TIMER;
	clif_guild_message(g, 0, output, strlen(output));

	return 1;
}

It notifies the guild master and members if the guild skill is ready to use and if not it'll display the time in minutes:seconds before it is available again.

 

May i request a plugin form of this thats working on the latest version of herc?

 

Thank you in advance :D

Edited by Kuroe

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0
static void guild_block_skill(struct map_session_data *sd, int time)
{
	uint16 skill_id[] = { GD_BATTLEORDER, GD_REGENERATION, GD_RESTORE, GD_EMERGENCYCALL };
	int i;
	for (i = 0; i < 4; i++)
		skill->blockpc_start(sd, skill_id[i], time);
}

hercules uses skill->blockpc_start and skill->blockpc_end to just set sd->blockskill[skill_id] = true:false;

so you can just hook to skill->blockpc_end to display the message for the guild master

to display the time left in min:sec, when guild master use the skill, run DIFF_TICK function

 

oh wait this is request section ....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0