Beispiel #1
0
//Innvoked on /breakguild "Guild name"
int guild_broken(int guild_id,int flag)
{
	struct guild *g=guild_search(guild_id);
//	struct guild_castle *gc=NULL;
	struct map_session_data *sd;
	int i;
//	char *name;;

	if(flag!=0 || g==NULL)
		return 0;

	//we call castle_event::OnGuildBreak of all castlesof the guild
	//you can set all castle_events in the castle_db.txt
/*	name=(char *)aCalloc(50,sizeof(char)); //24 char = event name, + space for  "::OnGuildBreak"
	for(i=0;i<MAX_GUILDCASTLE;i++){
		if( (gc=guild_castle_search(i)) != NULL ){
			if(gc->guild_id == guild_id){
				memcpy(name,gc->castle_event,50);
				npc_event_do(strcat(name,"::OnGuildBreak"));
			}
		}
	}
	free(name);
*/
	for(i=0;i<g->max_member;i++){	// ギルド解散を通知
		if((sd=g->member[i].sd)!=NULL){
			if(sd->state.storage_flag == 2)
				storage_guild_storage_quit(sd,1);
			sd->status.guild_id=0;
			sd->state.guild_sent=0;
			clif_guild_broken(g->member[i].sd,0);
			clif_charnameupdate(sd); // [LuzZza]
		}
	}

	guild_db->foreach(guild_db,guild_broken_sub,guild_id);
	castle_db->foreach(castle_db,castle_guild_broken_sub,guild_id);
	guild_storage_delete(guild_id);
	idb_remove(guild_db,guild_id);
	return 0;
}
Beispiel #2
0
//Code from party_send_xy_timer [Skotlex]
static int guild_send_xy_timer(int tid,unsigned int tick,int id,int data)
{
	guild_db->foreach(guild_db,guild_send_xy_timer_sub,tick);
	return 0;
}
Beispiel #3
0
// ギルド名検索
struct guild* guild_searchname(char *str)
{
	struct guild *g=NULL;
	guild_db->foreach(guild_db,guild_searchname_sub,str,&g);
	return g;
}
Beispiel #4
0
struct party_data* party_searchname(char *str)
{
	struct party_data *p=NULL;
	party_db->foreach(party_db,party_searchname_sub,str,&p);
	return p;
}
Beispiel #5
0
int party_send_xy_timer(int tid,unsigned int tick,int id,int data)
{
	party_db->foreach(party_db,party_send_xy_timer_sub,tick);
	return 0;
}