Jump to content
  • 0

Question

2 answers to this question

Recommended Posts

  • 0
Posted
On 4/15/2024 at 2:38 AM, Rynbef said:

U can use OnNPCKillEvent and do some checks

 

Rynbef~

I kinda figured it out, but I still can't make the item drop on the coordinates where the monster died. Tried getunitdata, but no success.

OnMonsterKilled:
	.@dropchance = rand(1,100);
	if(.@dropchance <= 5){
		getmapxy(.@map$,.@x,.@y,BL_PC);
		setarray .@fateshard[0],1000258,1000259,1000260,1000261,1000262;
		.@randomshard = rand(getarraysize(.@fateshard));
		makeitem (.@fateshard[.@randomshard]),1,.@map$,.@x,.@y;
	}
	dispbottom "Rand: "+.@dropchance;
}

Also, since i'm a complete newbie at scripting, I still don't understand the different scopes of variables, can you enlight me on this one?I've read the doc/script_commands.txt file, but it's not clear to me. Like, when should I use ".@" vs "." var?

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