Jump to content
  • 0

SC_END to exclude cart remove


Question

10 answers to this question

Recommended Posts

Posted (edited)

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
Posted

@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:

Posted (edited)

@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
Posted (edited)

@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
Posted

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:

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