Jump to content
  • 0

Auto resu when killed by mvp within 5 seconds


dubstep

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  35
  • Reputation:   2
  • Joined:  07/25/15
  • Last Seen:  

Hi guys can u help me with a item script of this item. I want to make it auto resu within 5 secs when killed by mvp's

screenDelinquent1140.jpg

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2347
  • Joined:  10/28/11
  • Last Seen:  

-	script	auto_ress_mvp	-1,{
	
	OnInit:
		.itemid = 512;
		end;
	
	OnPCDieEvent:
		if ( killerrid != getcharid(3) && getmonsterinfo( killerrid, MOB_MVPEXP ) ) {
			sleep2 5000;
			if ( countitem( .itemid ) ) {
				delitem .itemid,1;
				atcommand "@alive";
			}
		}
		end;
}

you can try this

  • Upvote 1
Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

use *getunittype in this case

-    script    jksdfkjsf    FAKE_NPC,{
OnPCDieEvent:
    if ( getunittype( killerrid ) != UNITTYPE_MOB )
        end;
    if ( !getmonsterinfo( killerrid, MOB_MVPEXP ) )
        end;
    sleep2 5000;
//    if ( !playerattached() ) end; // it seems only hercules will throw this error, rathena hasn't fix this yet
    if ( countitem(512) ) {
        delitem 512,1;
        atcommand "@alive";
    }
    end;
}

well ... this is old topic so I guess ... this script command wasn't exist back then

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

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  35
  • Reputation:   2
  • Joined:  07/25/15
  • Last Seen:  

Thanks emistry. How can i apply that? What command to use? And do i have to make a new notepad and copy paste that script then put it into custom npc?

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2347
  • Joined:  10/28/11
  • Last Seen:  

5 hours ago, dubstep said:

How can i apply that?

Add to your npc folder... and load it

5 hours ago, dubstep said:

What command to use?

None of this "command" thing are mentioned in your first post ... .so no command required ...

you just need whatever you have mentioned previously... items...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  436
  • Reputation:   31
  • Joined:  02/19/12
  • Last Seen:  

If killed by player:

[Error]: buildin_getmonsterinfo: Wrong Monster ID: 2000000
[Debug]: Source (NPC): auto_ress_mvp (invisible/not on a map)

If killed by monster:

[Error]: buildin_getmonsterinfo: Wrong Monster ID: 110009749
[Debug]: Source (NPC): auto_ress_mvp (invisible/not on a map)

But the player is resurrected after 5 seconds when apple is on inventory. (512 = Apple)

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Since https://github.com/rathena/rathena/commit/a8e4c83ef10dc4ccde1bd6e6f40b296d590d9b80 the script ends if there is no unit attached for sleep2 - no need to check if the player is attached.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

9 hours ago, Capuche said:

Since https://github.com/rathena/rathena/commit/a8e4c83ef10dc4ccde1bd6e6f40b296d590d9b80 the script ends if there is no unit attached for sleep2 - no need to check if the player is attached.

what I'm talking is this ...

prontera,155,190,5    script    ksdfjsh    1_F_MARIA,{
    detachrid; // try removing this line
    attachrid 2000001;
    sleep2 5000;
    announce playerattached() +"", 0;
    debugmes playerattached() +"";
    end;
}

if I put detachrid; ... yup it throws no unit attached error

but if I comment that line ... click on the npc and immediately Alt+F4, there's no error what-so-ever and the debugmes doesn't run

Edited by AnnieRuru
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...