Jump to content
  • 0

Help Me with this Script


SlashGeeGee

Question


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

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

Link to comment
Share on other sites

12 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   13
  • Joined:  02/15/12
  • Last Seen:  

That treasure box should drop loot around it when it gets killed?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

That treasure box should drop loot around it when it gets killed?

yeah but my problem is there is 5 treasure boxes and my script has one only.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   13
  • Joined:  02/15/12
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   13
  • Joined:  02/15/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1131
  • Joined:  05/27/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

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 !

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  218
  • Reputation:   16
  • Joined:  01/24/12
  • Last Seen:  

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;

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2351
  • Joined:  10/28/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

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

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