Jump to content
  • 0

auto heal intancing npc


Question

Posted

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!

2 answers to this question

Recommended Posts

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

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