Jump to content
  • 0

SC_END to exclude cart remove


Bin4ry

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

Like title. I think this would be very helpful :o

Edited by darristan
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

What do you mean? I don't fully understand

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

In the latest SVN, pushcart is acting like a 'buff' behavior so when you use any script that has sc_end it takes away merchant's cart too. (Correct me is the 'Buff' is wrong)

Edit: Status behavior sounds more appropriate.

Edited by darristan
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

@script.c

	if( !bl ) return 0;

if( type >= 0 && type < SC_MAX )
{
	struct status_change *sc = status_get_sc(bl);
	struct status_change_entry *sce = sc?sc->data[type]:NULL;
	if (!sce) return 0;
	//This should help status_change_end force disabling the SC in case it has no limit.
	sce->val1 = sce->val2 = sce->val3 = sce->val4 = 0;
	status_change_end(bl, (sc_type)type, INVALID_TIMER);
} else
	status_change_clear(bl, 2);// remove all effects

if( type == SC_PUSH_CART ) return 0;

add this after

if( !bl ) return 0;

:meow:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

@malufett

if sc_end SC_ALL;

how to fix src exclude cart remove

type = SC_ALL

switch(type)
{
 case SC_PUSH_CART:
  return 0;
}

thankyou

Edited by Napster
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

@Napster

if this will be the case 'sc_end SC_ALL;' then by default it cannot be remove so nothing to worried about...

:meow:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

@malufett

I have test but... cart status has been remove away

ex. npc

[/color]

morocc,158,92,5 script test 69,{

sc_end SC_ALL;
end;
}

src


BUILDIN_FUNC(sc_end)
{
struct block_list* bl;
int type;

type = script_getnum(st,2);
if( script_hasdata(st,3) )
bl = map_id2bl(script_getnum(st,3));
else
bl = map_id2bl(st->rid);

if( potion_flag==1 && potion_target )
{//##TODO how does this work [FlavioJS]
bl = map_id2bl(potion_target);
}

if( !bl ) return 0;
if( type == SC_PUSH_CART ) return 0;

if( type >= 0 && type < SC_MAX )
{
struct status_change *sc = status_get_sc(bl);
struct status_change_entry *sce = sc?sc->data[type]:NULL;
if (!sce) return 0;
//This should help status_change_end force disabling the SC in case it has no limit.
sce->val1 = sce->val2 = sce->val3 = sce->val4 = 0;
status_change_end(bl, (sc_type)type, INVALID_TIMER);
} else
status_change_clear(bl, 2);// remove all effects
return 0;
}
Edited by Napster
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

SC_ALL will trigger this one

'status_change_clear(bl, 2);'

oh..wait I forgot..type 2 in 'status_change_clear' means remove all buff regardless the settings..sorry.. :)

ok go to status.c and look for 'status_change_clear' declaration then after

	case SC_L_LIFEPOTION:
case SC_PUSH_CART:
	continue;

}

add this

if( i == SC_PUSH_CART )

	continue;

so regardless the type it will not remove SC_PUSH_CART

:meow:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

ok! thank you sir /lv

this it working /ok

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

I wonder why you don't use loop to check every sc status?

http://www.eathena.ws/board/index.php?showtopic=239242

just put SC_PUSH_CART(518) into if condition I think that should work

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

I wonder why you don't use loop to check every sc status?

http://www.eathena.w...howtopic=239242

just put SC_PUSH_CART(518) into if condition I think that should work

some status found problem with SC_ALL

ex.

SC_LEADERSHIP

SC_GLORYWOUNDS

SC_SOULCOLD

SC_HAWKEYES

i thank this status can't remove

and i want fix in mysrc /ok

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...