Jump to content
  • 0

Question

Posted (edited)

Hello,

firstly thank you for having answered me in other topic.
I have a question about some guild's package item. I would like to make a guid package but i don't understand how to modify properly sql file (i saw on other post that is needed for adding a guild package ).

I think getboundeditem is not really important in my case because the items ' guild package are duplicated items with their own id (with trade restriction setted in  _db).

I need to use some event for scripting but i don't know if they already exist and if it's possible, i need to check if guild's member have an item of the guild package or if it's in gstorage.

3 Events needed

    on leave guild ( answered )

        need to add this, but it works only for online player* 

             https://github.com/rathena/rathena/blob/master/src/map/guild.cpp#L983

             npc_event_doall_id("OnLeaveGuild", account_id);

    on break guild (please, correct me if the event is at a wrong place)

             https://github.com/rathena/rathena/blob/e8385d812ba327f1019d1f59987233684a6e378d/src/map/guild.cpp#L1893

             https://github.com/rathena/rathena/blob/e8385d812ba327f1019d1f59987233684a6e378d/src/map/guild.cpp#L1967

             npc_event_doall_id("OnGuildBreak", g->member[pos].sd->bl.id);

    on kick player from guild (please, correct me if the event is at a wrong place) :

         https://github.com/rathena/rathena/blob/e8385d812ba327f1019d1f59987233684a6e378d/src/map/guild.cpp#L930

         npc_event_doall_id("OnKickGuild", account_id);

 

For the other events, it seems to be good because player need to online to leave a guild or kicking all members before breaking a guild.

Thank you community's helper.

 

 

 

Edited by kilow

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
On 6/9/2021 at 5:26 PM, kilow said:

Hello,

firstly thank you for having answered me in other topic.

I cannot be bothered to test this but I'm pretty sure...
At line 983 would do the trick.

	if(sd != NULL && sd->status.guild_id == guild_id) {
		// do stuff that needs the guild_id first, BEFORE we wipe it
		npc_event_doall_id("OnLeaveGuild", account_id);
		if (sd->state.storage_flag == 2) //Close the guild storage.
			storage_guild_storageclose(sd);
		guild_send_dot_remove(sd);
		channel_pcquit(sd,3); //leave guild and ally chan
		sd->status.guild_id = 0;
		sd->guild = NULL;
		sd->guild_emblem_id = 0;

		if (g->instance_id) {
			struct map_data *mapdata = map_getmapdata(sd->bl.m);

			if (mapdata->instance_id) { // User was on the instance map
				if (mapdata->save.map)
					pc_setpos(sd, mapdata->save.map, mapdata->save.x, mapdata->save.y, CLR_TELEPORT);
				else
					pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
			}
		}

		clif_name_area(&sd->bl); //Update display name [Skotlex]
		status_change_end(&sd->bl,SC_LEADERSHIP,INVALID_TIMER);
		status_change_end(&sd->bl,SC_GLORYWOUNDS,INVALID_TIMER);
		status_change_end(&sd->bl,SC_SOULCOLD,INVALID_TIMER);
		status_change_end(&sd->bl,SC_HAWKEYES,INVALID_TIMER);
		status_change_end(&sd->bl,SC_EMERGENCY_MOVE,INVALID_TIMER);
		//@TODO: Send emblem update to self and people around
	}
	else {
		npc_event_doall_id("OnKickGuild");
	}

If they are not online when being kicked it would trigger OnKickGuild without an RID attached.

Edit: Also moved topic to source requests since it's becoming a source thing.

Edited by Skorm
  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...