Jump to content
  • 0

specialeffect in mob unit


luizragna

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  107
  • Reputation:   27
  • Joined:  02/12/14
  • Last Seen:  

Hello guys. It's possible use the script command specialeffect  in rathena?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

you can try this...

src\custom\script.inc

BUILDIN_FUNC(specialeffect3)
{
	struct block_list *bl = NULL;
	int id = 0;
	int type = script_getnum(st,2);
	enum send_target target = script_hasdata(st,3) ? (send_target)script_getnum(st,3) : AREA;

	if (script_hasdata(st,4)) {
		id = script_getnum(st,4);
		bl = map_id2bl(id);
	}
	else {
		bl = st->rid ? map_id2bl(st->rid) : map_id2bl(st->oid);
	}

	if(bl == NULL)
		return SCRIPT_CMD_SUCCESS;

	if( type <= EF_NONE || type >= EF_MAX ){
		ShowError( "buildin_specialeffect: unsupported effect id %d\n", type );
		return SCRIPT_CMD_FAILURE;
	}

	if (target == SELF) {
		TBL_PC *sd;
		if (script_rid2sd(sd))
			clif_specialeffect_single(bl,type,sd->fd);
	} else {
		clif_specialeffect(bl, type, target);
	}
	return SCRIPT_CMD_SUCCESS;
}

src\custom\script_def.inc

BUILDIN_DEF(specialeffect3,"i??"),

usage example

// GID examples...
.@gid = getcharid(3);
//.@gid = $@mobid[0];
//.@gid = killerrid;
//.@gid = killergid;

specialeffect3 EF_HIT1,AREA,.@gid;

 

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

  • 1

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

It definitly works because i was using it with my meteor assault mod

 

	case ASC_METEORASSAULT:
		if (unit_movepos(src,x,y,1,1)) {
			clif_snap(src, src->x, src->y);
			skill_unitsetting(src,skill_id,skill_lv,x,y,0);
			clif_specialeffect(src, 923, AREA);
			} else {
			if (sd)
				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
		}
		break;

 

  • Like 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 1/27/2020 at 2:41 PM, Litro Endemic said:

you can try this...

src\custom\script.inc

BUILDIN_FUNC(specialeffect3)
{
	struct block_list *bl = NULL;
	int id = 0;
	int type = script_getnum(st,2);
	enum send_target target = script_hasdata(st,3) ? (send_target)script_getnum(st,3) : AREA;

	if (script_hasdata(st,4)) {
		id = script_getnum(st,4);
		bl = map_id2bl(id);
	}
	else {
		bl = st->rid ? map_id2bl(st->rid) : map_id2bl(st->oid);
	}

	if(bl == NULL)
		return SCRIPT_CMD_SUCCESS;

	if( type <= EF_NONE || type >= EF_MAX ){
		ShowError( "buildin_specialeffect: unsupported effect id %d\n", type );
		return SCRIPT_CMD_FAILURE;
	}

	if (target == SELF) {
		TBL_PC *sd;
		if (script_rid2sd(sd))
			clif_specialeffect_single(bl,type,sd->fd);
	} else {
		clif_specialeffect(bl, type, target);
	}
	return SCRIPT_CMD_SUCCESS;
}

src\custom\script_def.inc

BUILDIN_DEF(specialeffect3,"i??"),

usage example

// GID examples...
.@gid = getcharid(3);
//.@gid = $@mobid[0];
//.@gid = killerrid;
//.@gid = killergid;

specialeffect3 EF_HIT1,AREA,.@gid;

 

Can you help me? It doesn't work to the script I am using. What seems to be missing here.

 

OnKill1: specialeffect3 68, AREA, .@mob_id[1]; callsub OnSetWinner, .mob_id_2, "WALA";
OnKill2: specialeffect3 68, AREA, .@mob_id[0]; callsub OnSetWinner, .mob_id_1, "MERON";

I am using bg_monster

	.@mob_id[0] = bg_monster(1, .map$, .meron_x, .meron_y, "MERON", .mob_id_1, strnpcinfo(0)+"::OnKill1");
	.@mob_id[1] = bg_monster(2, .map$, .wala_x, .wala_y, "WALA", .mob_id_2, strnpcinfo(0)+"::OnKill2");



 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   29
  • Joined:  06/08/23
  • Last Seen:  

that was my account but I can no longer access it because some complication.

On 8/20/2023 at 1:51 PM, Gidz Cross said:

Can you help me? It doesn't work to the script I am using. What seems to be missing here.

you can try check if the *.@mob_id[N]* is exist to debug it why it doesn't work. or change code on part.

or change the src code mod into

src\custom\script.inc

BUILDIN_FUNC(specialeffect3)
{
	int id = script_getnum(st, 2);
	int type = script_getnum(st, 3);
	enum send_target target = script_hasdata(st, 4) ? (send_target)script_getnum(st, 4) : AREA;

	struct block_list *bl = map_id2bl(id);
	if (bl == nullptr)
	{
		ShowError("buildin_specialeffect: unknown game object with id %d.\n", type);
		return SCRIPT_CMD_FAILURE;
	}

	if (type <= EF_NONE || type >= EF_MAX)
	{
		ShowError("buildin_specialeffect: unsupported effect id %d.\n", type);
		return SCRIPT_CMD_FAILURE;
	}

	if (target == SELF)
	{
		map_session_data* sd;
		if (!script_rid2sd(sd))
			return SCRIPT_CMD_FAILURE;
		clif_specialeffect_single(bl, type, sd->fd);
		
	} else
		clif_specialeffect(bl, type, target);

	return SCRIPT_CMD_SUCCESS;
}

src\custom\script_def.inc

	BUILDIN_DEF(specialeffect3,"ii?"),

and in your script

OnKill1: specialeffect3 .@mob_id[1], 68, AREA; callsub OnSetWinner, .mob_id_2, "WALA";
OnKill2: specialeffect3 .@mob_id[1], 68, AREA; callsub OnSetWinner, .mob_id_1, "MERON";

 

  • 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 8/22/2023 at 5:19 PM, Harvin said:

that was my account but I can no longer access it because some complication.

you can try check if the *.@mob_id[N]* is exist to debug it why it doesn't work. or change code on part.

or change the src code mod into

src\custom\script.inc

BUILDIN_FUNC(specialeffect3)
{
	int id = script_getnum(st, 2);
	int type = script_getnum(st, 3);
	enum send_target target = script_hasdata(st, 4) ? (send_target)script_getnum(st, 4) : AREA;

	struct block_list *bl = map_id2bl(id);
	if (bl == nullptr)
	{
		ShowError("buildin_specialeffect: unknown game object with id %d.\n", type);
		return SCRIPT_CMD_FAILURE;
	}

	if (type <= EF_NONE || type >= EF_MAX)
	{
		ShowError("buildin_specialeffect: unsupported effect id %d.\n", type);
		return SCRIPT_CMD_FAILURE;
	}

	if (target == SELF)
	{
		map_session_data* sd;
		if (!script_rid2sd(sd))
			return SCRIPT_CMD_FAILURE;
		clif_specialeffect_single(bl, type, sd->fd);
		
	} else
		clif_specialeffect(bl, type, target);

	return SCRIPT_CMD_SUCCESS;
}

src\custom\script_def.inc

	BUILDIN_DEF(specialeffect3,"ii?"),

and in your script

OnKill1: specialeffect3 .@mob_id[1], 68, AREA; callsub OnSetWinner, .mob_id_2, "WALA";
OnKill2: specialeffect3 .@mob_id[1], 68, AREA; callsub OnSetWinner, .mob_id_1, "MERON";

 

Thank you so much for replying. When made changes based on this patch i finally have map error.

image.png.f87e806912cd98c1732dc486060e54b3.png

*EDIT
When i rediff the initial patch. It somehow works! So Its working now! Thanks!

Edited by Gidz Cross
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...