Jump to content
  • 0
Sign in to follow this  
Lord Ganja

@killable - atcommand.c to script.c

Question

Can anybody help me do this?

 

I wanted to create a killable command by not using it as atcommand since my custom npc script will repeatedly use @killable and I got no way to detect if it's 'on' or 'off'.

 

I was thinking to make a custom_script command with this format ==>  killable <"character name/id">,<on|off>;

 

So even if I repeatedly use the script like killable "Lord Ganja",0; It won't turn on..

 

this is from atcommand.c , but i don't have any idea how can I do it on script.c.. Any help please? Thanks in advance! :)

/*========================================== * @killable by MouseJstr * enable other people killing you *------------------------------------------*/ACMD(killable) {	sd->state.killable = !sd->state.killable;	if(sd->state.killable)		clif->message(fd, msg_fd(fd,242));	else {		clif->message(fd, msg_fd(fd,288));		map->foreachinrange(atcommand->stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id);	}	return true;}

 

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Fixed this the other way around. Instead I created a command that checks if a player is killable or not.

 

BUILDIN(iskillable){	TBL_PC* sd;	sd = script->rid2sd(st);	if( sd == NULL )		return true;// no player attached, report source	if( sd->state.killable )		script_pushint(st,1);	else		script_pushint(st,0);	return true;}

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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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