Jump to content
  • 0

Mapflag NoSiegfried


Gidz Cross

Question


  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

Can any make a mod that will ignore Token of Siegfried on a specific maps? A mapflag would be nice.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 2

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  171
  • Reputation:   68
  • Joined:  10/25/20
  • Last Seen:  

Try this.

1. go to src/map/map.hpp and find MF_MAX

above add this MF_NOTOKEN,

 

2. go to src/map/script_constant.hpp and find export_constant(MF_SKILL_DURATION);

below add this export_constant(MF_NOTOKEN);

3go to src/map/pc.cpp and find
 

bool pc_revive_item(struct map_session_data *sd) {
	nullpo_retr(false, sd);

	if (!pc_isdead(sd) || sd->respawn_tid != INVALID_TIMER)
		return false;

	if (sd->sc.data[SC_HELLPOWER]) // Cannot resurrect while under the effect of SC_HELLPOWER.
		return false;

	int16 item_position = itemdb_group_item_exists_pc(sd, IG_TOKEN_OF_SIEGFRIED);
	uint8 hp = 100, sp = 100;

	if (item_position < 0) {
		if (sd->sc.data[SC_LIGHT_OF_REGENE]) {
			hp = sd->sc.data[SC_LIGHT_OF_REGENE]->val2;
			sp = 0;
		}
		else
			return false;
	}

	if (!status_revive(&sd->bl, hp, sp))
		return false;

	if (item_position < 0)
		status_change_end(&sd->bl, SC_LIGHT_OF_REGENE, INVALID_TIMER);
	else
		pc_delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME);

	clif_skill_nodamage(&sd->bl, &sd->bl, ALL_RESURRECTION, 4, 1);

	return true;
}


and change to

 

bool pc_revive_item(struct map_session_data *sd) {
	nullpo_retr(false, sd);
	int16 m = 0;
	struct map_data *mapdata = map_getmapdata(m);

	if (!pc_isdead(sd) || sd->respawn_tid != INVALID_TIMER)
		return false;

	if (sd->sc.data[SC_HELLPOWER]) // Cannot resurrect while under the effect of SC_HELLPOWER.
		return false;
		
	if(map_getmapflag(sd->bl.m, MF_NOTOKEN))
		return false;
		

	int16 item_position = itemdb_group_item_exists_pc(sd, IG_TOKEN_OF_SIEGFRIED);
	uint8 hp = 100, sp = 100;

	if (item_position < 0) {
		if (sd->sc.data[SC_LIGHT_OF_REGENE]) {
			hp = sd->sc.data[SC_LIGHT_OF_REGENE]->val2;
			sp = 0;
		}
		else
			return false;
	}

	if (!status_revive(&sd->bl, hp, sp))
		return false;

	if (item_position < 0)
		status_change_end(&sd->bl, SC_LIGHT_OF_REGENE, INVALID_TIMER);
	else
		pc_delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME);

	clif_skill_nodamage(&sd->bl, &sd->bl, ALL_RESURRECTION, 4, 1);

	return true;
}


Not tested, let me know if it works.

  • Upvote 1
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

On 6/2/2022 at 2:09 AM, cook1e said:

Try this.

1. go to src/map/map.hpp and find MF_MAX

above add this MF_NOTOKEN,

 

2. go to src/map/script_constant.hpp and find export_constant(MF_SKILL_DURATION);

below add this export_constant(MF_NOTOKEN);

3go to src/map/pc.cpp and find
 

bool pc_revive_item(struct map_session_data *sd) {
	nullpo_retr(false, sd);

	if (!pc_isdead(sd) || sd->respawn_tid != INVALID_TIMER)
		return false;

	if (sd->sc.data[SC_HELLPOWER]) // Cannot resurrect while under the effect of SC_HELLPOWER.
		return false;

	int16 item_position = itemdb_group_item_exists_pc(sd, IG_TOKEN_OF_SIEGFRIED);
	uint8 hp = 100, sp = 100;

	if (item_position < 0) {
		if (sd->sc.data[SC_LIGHT_OF_REGENE]) {
			hp = sd->sc.data[SC_LIGHT_OF_REGENE]->val2;
			sp = 0;
		}
		else
			return false;
	}

	if (!status_revive(&sd->bl, hp, sp))
		return false;

	if (item_position < 0)
		status_change_end(&sd->bl, SC_LIGHT_OF_REGENE, INVALID_TIMER);
	else
		pc_delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME);

	clif_skill_nodamage(&sd->bl, &sd->bl, ALL_RESURRECTION, 4, 1);

	return true;
}


and change to

 

bool pc_revive_item(struct map_session_data *sd) {
	nullpo_retr(false, sd);
	int16 m = 0;
	struct map_data *mapdata = map_getmapdata(m);

	if (!pc_isdead(sd) || sd->respawn_tid != INVALID_TIMER)
		return false;

	if (sd->sc.data[SC_HELLPOWER]) // Cannot resurrect while under the effect of SC_HELLPOWER.
		return false;
		
	if(map_getmapflag(sd->bl.m, MF_NOTOKEN))
		return false;
		

	int16 item_position = itemdb_group_item_exists_pc(sd, IG_TOKEN_OF_SIEGFRIED);
	uint8 hp = 100, sp = 100;

	if (item_position < 0) {
		if (sd->sc.data[SC_LIGHT_OF_REGENE]) {
			hp = sd->sc.data[SC_LIGHT_OF_REGENE]->val2;
			sp = 0;
		}
		else
			return false;
	}

	if (!status_revive(&sd->bl, hp, sp))
		return false;

	if (item_position < 0)
		status_change_end(&sd->bl, SC_LIGHT_OF_REGENE, INVALID_TIMER);
	else
		pc_delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME);

	clif_skill_nodamage(&sd->bl, &sd->bl, ALL_RESURRECTION, 4, 1);

	return true;
}


Not tested, let me know if it works.

Works like charm. Thanks @cook1e!

 

Heya @cook1e Ive discovered  that i cannot use token of siegfried anywhere. I have set my prontera with mapflag. Im trying to use token of siegfried in other maps but it doesnt work anymore. Hehe!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  171
  • Reputation:   68
  • Joined:  10/25/20
  • Last Seen:  

On 6/1/2022 at 3:19 PM, Gidz Cross said:

Works like charm. Thanks @cook1e!

 

Heya @cook1e Ive discovered  that i cannot use token of siegfried anywhere. I have set my prontera with mapflag. Im trying to use token of siegfried in other maps but it doesnt work anymore. Hehe!

I enabled the mapflag only in prontera and i can't use the token, but i can anywhere else.

Everything is working as intended

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

21 hours ago, cook1e said:

I enabled the mapflag only in prontera and i can't use the token, but i can anywhere else.

Everything is working as intended

I have reverted back to once it was. Will try to rediff this mod again. But last time i checked. It doesnt work anywhere else when i have this diff.

*EDIT

yep. Still the same. If you have this diff. You cannot use token of siegfried anywhere else.

*EDIT AGAIN

It seems by putting { } fixes the problem.

if(map_getmapflag(sd->bl.m, MF_NOTOKEN)) {
	return false;
}

 

Edited by Gidz Cross
Solved
Link to comment
Share on other sites

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.

×
×
  • Create New...