Jump to content
  • 0

Help Me with this Script


Question

Posted

Hello rA :)

Ok I have this Instance the 300 Monster Challenge and after it's completed a treasure chest will spawn the mob_db cannot drop 1 pc of item when it's killed so I made it this way :


- script 300_Monster_Prize -1,{

OnNPCkillEvent:
if(killedrid!=1324){ end;}
getmapxy(@m$,@x,@y,0);
getitem 969,50,@m$,@x,@y;
end;
}

so how can i make it to many monsters I mean the monster ID 1324 because there are 5 treasure chest in the instance that will randomly spawn.


//= Treasure - Mob ID
setarray .@chamonid5[0],1337,1329,1946,1938;

Need Help /ok

SlashGeeGee

12 answers to this question

Recommended Posts

Posted

The treasure box amount is no problem, the script you posted gives the items to the killer, do you want the items to 100% drop on the ground?

read my first post , i said i want to make my script to add more monsters to it.

Posted (edited)

Ok there are several ways to "check" for more monsters when something gets killed:

1.

if(killedrid!=1324 && killedrid != 1329 && killedrid != 1337 && killedrid != 1938 && killedrid != 1946){ end;}

This method is pretty lame, especially when you want to add new monsters it can grow really huge.

2.

setarray .@chamonid5[0],1324,1337,1329,1946,1938;
for( set .@i,0; .@i < getarraysize(.@chamonid5); set .@i,.@i +1 ) {
 if(killedrid != .@chamonid5[.@i]) end;
your code here...
}

Method 2 utilizes the for loop and you only need to edit the array at the start to put a new monster in.

Edited by shadowseph
Posted

You should add your script to the OnKill event label of the monsters you want, not as an NPCKillEvent.

*monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>"};

OnNPCKillEvent will go and loop through every monster killed, which (of course) is highly, highly inefficient.

Posted

is this script correct ?


- script 300_Monster_Prize -1,{

OnNPCkillEvent:
setarray .@chamonid5[0],1324,1337,1329,1946,1938;
for( set .@i,0; .@i < getarraysize(.@chamonid5); set .@i,.@i +1 ) {
if(killedrid != .@chamonid5[.@i]) end;}
getmapxy(@m$,@x,@y,0);
makeitem 969,50,@m$,@x,@y;
end;
}

BUMP !

Posted

You're making the script way harder than it needs to be. Read the documentation that came with it.

The best way to give the player a reward is to create a custom treasure chest mob with the item you want the player to get upon finishing the instance.

Posted

You're making the script way harder than it needs to be. Read the documentation that came with it.

The best way to give the player a reward is to create a custom treasure chest mob with the item you want the player to get upon finishing the instance.

Monster's can't drop many items like I want 969 Gold to be Dropping 10pcs. on the floor.

Posted

You're making the script way harder than it needs to be. Read the documentation that came with it.

The best way to give the player a reward is to create a custom treasure chest mob with the item you want the player to get upon finishing the instance.

Monster's can't drop many items like I want 969 Gold to be Dropping 10pcs. on the floor.

It's easier if you just use getitem 969,10;

Posted

Monster's can't drop many items like I want 969 Gold to be Dropping 10pcs. on the floor.

OnMobKillLabel:
getmapxy( .@Map$,.@X,.@Y,0 );
makeitem 969,10,.@Map$,.@X,.@Y;
end;

*makeitem <item id>,<amount>,"<map name>",<X>,<Y>;
*makeitem "<item name>",<amount>,"<map name>",<X>,<Y>;

This command will create an item lying around on a specified map in the
specified location.

itemid   - Found in 'db/item_db.txt'
amount   - Amount you want produced
map name - The map name
X	    - The X coordinate
Y	    - The Y coordinate.

This item will still disappear just like any other dropped item. Like 'getitem',
it also accepts an 'english name' field from the database and creates apples if
the name isn't found.
If the map name is given as "this", the map the invoking character is on will be used.

Posted

Monster's can't drop many items like I want 969 Gold to be Dropping 10pcs. on the floor.

OnMobKillLabel:
getmapxy( .@Map$,.@X,.@Y,0 );
makeitem 969,10,.@Map$,.@X,.@Y;
end;

*makeitem <item id>,<amount>,"<map name>",<X>,<Y>;
*makeitem "<item name>",<amount>,"<map name>",<X>,<Y>;

This command will create an item lying around on a specified map in the
specified location.

itemid   - Found in 'db/item_db.txt'
amount   - Amount you want produced
map name - The map name
X		- The X coordinate
Y		- The Y coordinate.

This item will still disappear just like any other dropped item. Like 'getitem',
it also accepts an 'english name' field from the database and creates apples if
the name isn't found.
If the map name is given as "this", the map the invoking character is on will be used.

Thanks ! Problem Solved

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