Jump to content
  • 0

auto heal intancing npc


grimmm

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   1
  • Joined:  08/16/12
  • Last Seen:  

Hello everyone! Can someone tell me why I can not make this npc work correctly?

 

1@pam,0,0,0	script	#PCHealMR	FAKE_NPC,{
	end;
OnPCLoadMapEvent:
	if (strcharinfo(3) == .@map$ || strcharinfo(3) == instance_mapname(.@map$) ) {
		Beginning:
			message strcharinfo(PC_NAME),"Test AAAAAAAAAA Word";
			addtimer 5000, instance_npcname(strnpcinfo(2)) + "::On5secs";
			sleep2 1700; // 1 second
			heal 5000,5000;
			sleep2 1700; // 1 second
			heal 5000,5000;
			sleep2 1700; // 1 second
			heal 5000,5000;
			sleep2 1700; // 1 second
			heal 5000,5000;
			end;
		On5secs:
			goto Beginning;
			end;
	}
	end;
OnPCDieEvent:
	if (strcharinfo(3) == .@map$ || strcharinfo(3) == instance_mapname(.@map$) ) {
		deltimer  instance_npcname(strnpcinfo(0)) + "::On5secs";
		end;
	}
	end;
OnInit:
OnInstanceInit:
	.@map$ = "1@pam";
	setmapflag .@map$,mf_loadevent;
	end;

}

ty!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

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

  • PC_NAME is hercules constant
  • strnpcinfo(0) should be used with addtimer instead of strnpcinfo(2)
  • you're searching the instance npc name of non-instance npc too
  • under oninstanceinit mf_loadevent is only set for non-instance map : this script is not running on instance map
Edited by Capuche
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   1
  • Joined:  08/16/12
  • Last Seen:  

3 hours ago, Capuche said:
  • PC_NAME is hercules constant
  • strnpcinfo(0) should be used with addtimer instead of strnpcinfo(2)
  • you're searching the instance npc name of non-instance npc too
  • under oninstanceinit mf_loadevent is only set for non-instance map : this script is not running on instance map 

thank you, I'll see what happens to me ex: OnTouch

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