Jump to content
  • 0

OnNPCKillEvent


Question

Posted

how do I make a OnNPCKillEvent with

 

if (killedrid !=MOB ID){

setarray .items[0],501,502,503,504,506,507,508

set .items, .items[rand(getarraysize(.items))];

 

getitem .@item_id,1;

 

or ?

 

makeitem .@item_id,1;

 

 

and random item drop to 0,50%

 

 

hope I can help someone, sorry for my bad english

7 answers to this question

Recommended Posts

Posted (edited)


OnNPCKillEvent:

if (killedrid != MOB ID){

        setarray .items1[0],501,502,503,504,506,507,508;

        set .items, .items1[rand(getarraysize(.items1))];

        getitem .items,1;

set .@randitem,rand(1);

if(.@randitem == 0) getitem 1234,1; //Change to what random item do you want to give

end;

Edited by sandbox
Posted
-	script	DropExtraTreasure	-1,{

	OnNPCKillEvent:
if (killedrid != 1902){
        setarray .items1[0],501,502,503,504,506,507,508;
        set .items, .items1[rand(getarraysize(.items1))];
        getitem .items,1;
        
        set .@randitem,rand(1);
        if(.@randitem == 100) getitem .items1,1; //Change to what random item do you want to give
end;
}
}

the mob does not drop

 

is if(.@randitem == 100) the drop change ?

 

map server makes shows no error but it is not easy to

 

pls help....

Posted

yes it won't drop, if you want it to specifically drop.

 

find

set .@randitem,rand(1);
if(.@randitem == 100) getitem .items1,1; //Change to what random item do you want to give

 

replace

 set .@randitem,rand(1);
        if(.@randitem == 1) {
getmapxy(.@map$,.@x,.@y,0);
makeitem .items1,1,.@map$,.@x,.@y;
} //Change to what random item do you want to give
Posted
-	script	DropExtra	-1,{

	OnNPCKillEvent:
if (killedrid != 1902){
        setarray .items1[0],501,502,503,504,506,507,508;
        set .items, .items1[rand(getarraysize(.items1))];
        getitem .items,1;
        
        set .@randitem,rand(1);
        if(.@randitem == 1) {
        getmapxy(.@map$,.@x,.@y,0);
        makeitem .items1,1,.@map$,.@x,.@y;
end;
}
}

does not go

and I do not 100% but 0.50%

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