Jump to content
  • 0
Tio Akima

disable effect

Question

I really need help

I would like to make a command to disable a visual effect on the player

for example, this is the command to enable a visual effect:
(used in skill.c file to enable a visual effect)

 

clif->specialeffect(&sd->bl, type, (send_target)flag); 
 

and this is the function of the command clif.c file:

 

void clif_specialeffect(struct block_list* bl, int type, enum send_target target){unsigned char buf[24];nullpo_retv(bl);memset(buf, 0, packet_len(0x1f3));WBUFW(buf,0) = 0x1f3;WBUFL(buf,2) = bl->id;WBUFL(buf,6) = type;clif->send(buf, packet_len(0x1f3), bl, target);if (disguised(bl)) {WBUFL(buf,2) = -bl->id;clif->send(buf, packet_len(0x1f3), bl, SELF);}} 

 

you know how I can redo this command to disable the visual effect?
 
please help me, you are the one who knows the whole program!
 
thanks 
 
please look at my problem,
 
just need to turn off the visual effect:

 

 

yet without success.

 

 
Edited by akima

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Why not just use /effect ? Doesn't this just turn effects off?

 

If not, you can try this, but not sure if it'll work as you want it to, think it's user based:

 

Well, simplest way would be to assign a variable to a player, and then just end execution before the effect is displayed.

 

For the command, just add this in there. This will set a player's variable to 1 to turn effects off, or 0 to turn effects back on.

if (pc_readglobalreg(sd, script->add_str("disable_effect")))    pc->setregistry(sd, script->add_str("disable_effect"),0;else    pc->setregistry(sd, script->add_str("disable_effect"),1;

 

Then, for clif_speacialeffect, all you need to do is add a check to see if they have the variable set to 1. If it is, you just end the execution early, so that no effect is displayed, but if it's 0, then continue with execution.

void clif_specialeffect(struct block_list* bl, int type, enum send_target target){unsigned char buf[24];nullpo_retv(bl);if (pc_readglobalreg(sd, script->add_str("disable_effect")))    return;memset(buf, 0, packet_len(0x1f3));WBUFW(buf,0) = 0x1f3;WBUFL(buf,2) = bl->id;WBUFL(buf,6) = type;clif->send(buf, packet_len(0x1f3), bl, target);if (disguised(bl)) {WBUFL(buf,2) = -bl->id;clif->send(buf, packet_len(0x1f3), bl, SELF);}} 

 

Like I said, this is the easiest way, but truthfully, I don't think this will work as you want. If i'm not mistaken, all this will do is prevent that selected player, from using the effect. In other words, when he/she uses a skill, no effect will show, but if another player uses a skill, then theirs will show.

Edited by GmOcean

Share this post


Link to post
Share on other sites
  • 0

hi Ocean ...

 
actually what I need to do is turn off the effect after it is used!
 
actually need to make the visual effect disappear.
after using it, the visual effect will be on the player ... I need to make it disappear by clicking on the same skill ....
The skill is this:

 

case BS_MAXIMIZE:		if(tsce) {	   //I need a function to turn off the visual effect here//function to turn off the skill Skill 				clif->skill_nodamage(src,bl,skill_id,skill_lv,1); 				clif->skill_nodamage(src,bl,skill_id,skill_lv,status_change_end(bl, type, INVALID_TIMER)); 				map->freeblock_unlock(); 				return 0; 				 		}else{ 				    				   clif->specialeffect(&sd->bl, 586, (send_target)flag);  //function to turn on the visual effect 					clif->skill_nodamage(src,bl,skill_id,skill_lv,         //function to turn on the skillsc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));			 	   } 			break;   

 

for example the ''@refresh '' function makes the visual effect disappear ...
 
but it would be bad for the server all players making refresh ... would be chaos.
 
 
for example, when I use @warp and @go the visual effect also disappears.
 
then, according to the logic and my programming skills ..
 
must be some variable that the "clif_speacialeffect" function  fills
 
and I use these commands the @refresh, @warp and @go, the variable back to the default and the visual effect disappears.
 
this is my logic.
 
 
Another example is the skill STEELBODY
 
when your time is up, the skill off and the visual effect disappears ....
 
that's incredible!
 
and I can not make the visual effect disappear off my skill.
-----------------------------------------------------------------------------------------
NOTE: I do not want to prevent the player to use the effect, but to make the visual effect disappears after use.
 
 
I'm counting on your help!
Edited by akima

Share this post


Link to post
Share on other sites
  • 0

I bet many people do, but the thing is effects are set and removed on the client side, so without getting into the client you're pretty much screwed. The reason why effects disappear after map change, @refresh and such is because of "screen reset" that's happening (If you check the code, screen effects are not the only thing client "loses" on screen refresh). I think it's also client-side for Steel Body, since for as long as status is active, client will show the effect. It doesn't matter how you got the status even, be it skill or script.

Edited by Garr

Share this post


Link to post
Share on other sites
  • 0
I completely understand what you're saying.
 
 
but, as the client also works with a logic.
 
 the visual effect appears, it means that somewhere in the memory he is ...
to disappear, it ceases to occupy that place in memory.
 
this space in memory is allocated to a variable.
 
therefore, any variable takes care of that part.
 
resetting this variable, probably the effect would disappear without reloading the screen.
 
 
I am guiding me by that logic programming.
and putting faith to be true!
 
I am studying the skill STEELBODY
 
 
:unsure:  :(
 
and am trying to reset "map_session_data" without reloading the screen.
 
I'm trying something ...
aught...

Share this post


Link to post
Share on other sites
  • 0

Sigh. You didn't get my point. Effects are not done server side. They can be initiated there, and most are, but at the same time all the work on effects is done on client. It's NOT connected to server when they end. The client decides. No matter what you do, whatever variable server-side you reset, it won't affect client-side variables. As I was saying, server can send a packet for client to "reset screen", on which much info is lost, including effects (check clif_refresh, it's the screen resfreshing, and resending the "lost variables" back to client). It's just either you reset everything, or nothing here. No middle ground. So if you can edit the client itself so it could receive some custom packet you make and stop the effect, then go for it. Meddling server-side won't bring you any good.

 

And as I said, steelbody effect will show as long as you have SC_STEELBODY active on character. Just make a script to grand character SC_STEELBODY and you'll see yourself. It's the same as these fancy headgears.

Share this post


Link to post
Share on other sites
  • 0

What if I create a SC_TEST and associate my visual effect to it?

 
the doubt is: the visual effects of SC_ are decided by the client?
 
there must be some way to do this server-side!

Share this post


Link to post
Share on other sites
  • 0

Well, I'm not really familiar with client-side editing, so there might be a way to add some kind of effect on sc, like it's possible to add icon for custom scs. (My opinion is that those effects are hardcoded). Imo you'll still get more luck trying to figure it client-side rather than server-side. Good luck anyway.

Share this post


Link to post
Share on other sites
  • 0

Uhh, if this is the issue, then what you need to do is just make 2 different SC_'s.

First SC_MAXIMIZE give the buff the player receives.

Second SC_WHATEVER show the effect for X seconds, by simply making it last for X seconds.

 

This would solve your problem.

So, when they use the skill, have it set 2 effects to them. As it is now, SC_MAXIMIZE doesn't have a visual effect so it'll still last as long as it should.

And since you managed to have the client display a custom effect, you can just have it display it for a few seconds using a separate SC_effect.

 

For example:

Cast Maximize in game ( on a normal client/server ).

Then, cast a skill that has a limited visual effect such as, Assumptio.

 

All you need to do is merely make the second sc_effect not provide buffs but rather just display the effect.

Share this post


Link to post
Share on other sites
  • 0

if you are talking about skill effect then there is no way to stop the animation after the server sent the request...

however if you are talking about status effect then you can use 'clif->sc_end'...

 

:meow:

Share this post


Link to post
Share on other sites
  • 0

Sigh. tl:dr;

He wants to make an effect show when skill is active, and for it to disappear when the skill is turned off. Currently a question's raised: can effect on status being active be edited into client without hexing (Like custom status icons, per se)?

 

yeah! this is the big question!

 

but, Ocean solution for now is the most viable.

 

the advantage is that these discuções is emerging ideas!

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.