Jump to content
  • 0

Npc spawn around monster or player


Gouki

Question


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.06
  • Content Count:  241
  • Reputation:   12
  • Joined:  08/12/20
  • Last Seen:  

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;
	.@inlist = inarray(.moblist[0], killedrid);
	if (.@inlist == -1)
		end;
	.@npcid = getelementofarray(getvariableofnpc(.tombid, "TheTomb"), .@inlist);
	debugmes "npcid: "+.@npcid;
	getunitdata(killedgid, .@md);
	setunitdata(.@npcid, UNPC_MAPID, .@md[UMOB_MAPID]);
	setunitdata(.@npcid, UNPC_X, .@md[UMOB_X]);
	setunitdata(.@npcid, UNPC_Y, .@md[UMOB_Y]);
	setunitdata(.@npcid, UNPC_LOOKDIR, 0);
	end;

OnInit:
	setarray .moblist[0], 1002, 1003, 1004, 1005;
	
	.@moblistsize = getarraysize(.moblist);
	.@tombcount = getvariableofnpc(.tombcount, "TheTomb");
	if (.@moblistsize < .@tombcount) {
		debugmes "The Tomb count isn't match with the mob count in list";
		debugmes "Size of Mob List: "+.@moblistsize+", NPC Tomb Count: "+.@tombcount;
		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...