Jump to content
  • 0

OnNPCKillEvent


EL Dragon

Question


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

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

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  


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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

sorry.. typo, change

 

set .@randitem,rand(2);
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

end;
}
}

does not go -.-

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

Sorry for the late reply, But you are missing 1 closing brace }

Link to comment
Share on other sites

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