Jump to content
  • 0
Almond Snicker

Npc spawn around monster or player

Question

Hi all,

Is it possible to spawn NPC around the player after killing a monster? or spawn a NPC around the monster where it was killed?

 


Update: I found a script..

The script..

-	script	Main NPC	-1,{
	end;

OnNPCKillEvent:
	if (.state != 1)
		end;
	[email protected] = inarray(.moblist[0], killedrid);
	if ([email protected] == -1)
		end;
	[email protected] = getelementofarray(getvariableofnpc(.tombid, "TheTomb"), [email protected]);
	debugmes "npcid: "[email protected];
	getunitdata(killedgid, [email protected]);
	setunitdata([email protected], UNPC_MAPID, [email protected][UMOB_MAPID]);
	setunitdata([email protected], UNPC_X, [email protected][UMOB_X]);
	setunitdata([email protected], UNPC_Y, [email protected][UMOB_Y]);
	setunitdata([email protected], UNPC_LOOKDIR, 0);
	end;

OnInit:
	setarray .moblist[0], 1002, 1003, 1004, 1005;
	
	[email protected] = getarraysize(.moblist);
	[email protected] = getvariableofnpc(.tombcount, "TheTomb");
	if ([email protected] < [email protected]) {
		debugmes "The Tomb count isn't match with the mob count in list";
		debugmes "Size of Mob List: "[email protected]+", NPC Tomb Count: "[email protected];
		end;
	}
	.state = 1;
	end;
}

-	script	TheTomb	-1,{
	end;
	
OnInit:
	if (strnpcinfo(2) == "")
		end;
	.tombcount++;
	.tombid[.tombcount-1] = getnpcid(0);
	end;

}

prontera,0,0,0	duplicate(TheTomb)	Tomb#1	112
prontera,0,0,0	duplicate(TheTomb)	Tomb#2	112
prontera,0,0,0	duplicate(TheTomb)	Tomb#3	112
prontera,0,0,0	duplicate(TheTomb)	Tomb#4	112

 

This is workable, however, I need to or more Tombs (NPC). I have managed to move the Tomb on a different location by editing the coordinates of UMOB. But I'm having a hard time adding another Tomb(NPC). the 2nd Tomb should be on a different location as the first one. Does anyone know how to add a 2nd Tomb by editing this script above?

 

Edited by Almond Snicker
added a possible core script
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

Important Information

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