Myth 1 Posted July 25, 2013 this npc give 3x runes such as Verkana Runestone Nosiege Runestone Rhydo Runestone Urj Runestone Asir Runestone Hagalas Runestone Pertz Runestone Isia Runestone Turisus Runestone only Rune Knight can talk to this npc and he will only get when he died maximum of 3x of all the runes only he gets. Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted July 28, 2013 Much like that but: The NPC declaration requires location (prontera,111,111,5), the type of NPC (script), the NPC name (which is missing) and the sprite ID and curly opening (39,{). As I've said the NPC name is missing. You are also missing the closing curly of the NPC opening, the { and } must match. Add an end; where the script is supposed to end, so that it actually can be ended and isn't kept on memory. We only provided you a snippet, and you try to make this a full NPC so it should be ended for your server resources sake. Sounds quite redundant, doesn't it? A more correct version woud be like this: prontera,111,111,5 script NPCname 39,{ if( Class == 4060 ){ for (set .@i, 12725; .@i <= 12733; set .@i, .@i + 1) // We loop trhough the IDs for the runestones if(countitem(.@i) < 3) getitem .@i, (3 - countitem(.@i)); } end;} Quote Share this post Link to post Share on other sites
0 Emistry 145 Posted July 26, 2013 OnPCDieEvent:if( Class == 4060 ){ if( countitem( xyz ) < 3 ) getitem xyz,( 3 - countitem( xyz ) );} 1 jaBote reacted to this Quote Share this post Link to post Share on other sites
0 Myth 1 Posted July 26, 2013 OnPCDieEvent:if( Class == 4060 ){ if( countitem( xyz ) < 3 ) getitem xyz,( 3 - countitem( xyz ) );} even he died if he still have 2 runes all of that the NPC will only gave him/her only 1 to make it 3 again. 3x of all that items huh Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted July 26, 2013 Emistry is right. Just change xyz to the item ID you want. You can copy this: if( countitem( xyz ) < 3 ) getitem xyz,( 3 - countitem( xyz ) ); over and over inside the first if and changing the xyz for the different items you wanna give up to 3 so that you can accomplish what you want. Remember that OnPCDieEvent label should be inisde an NPC. Quote Share this post Link to post Share on other sites
0 Myth 1 Posted July 26, 2013 example if( countitem( 1357,14657,18647,46116 ) < 3 ) getitem xyz,( 3 - countitem( 1357,14657,18647,46116 ) ); Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted July 26, 2013 countitem allows only 1 argument which is supposed to be an item ID. It should be like this, so that'll get you some nice errors when parsing the script. Your script should look like this: OnPCDieEvent:if( Class == 4060 ){ if(countitem(12725) < 3) getitem 12725, (3 - countitem(12725)); if(countitem(12726) < 3) getitem 12726, (3 - countitem(12726)); if(countitem(12727) < 3) getitem 12727, (3 - countitem(12727)); if(countitem(12728) < 3) getitem 12728, (3 - countitem(12728)); if(countitem(12729) < 3) getitem 12729, (3 - countitem(12729)); if(countitem(12730) < 3) getitem 12730, (3 - countitem(12730)); if(countitem(12731) < 3) getitem 12731, (3 - countitem(12731)); if(countitem(12732) < 3) getitem 12732, (3 - countitem(12732)); if(countitem(12733) < 3) getitem 12733, (3 - countitem(12733));} Or, in a more compressed form (saves disk space but uses a bit more of process): OnPCDieEvent:if( Class == 4060 ){ for (set .@i, 12725; .@i <= 12733; set .@i, .@i + 1) // We loop trhough the IDs for the runestones if(countitem(.@i) < 3) getitem .@i, (3 - countitem(.@i));} Hope this helps you. Quote Share this post Link to post Share on other sites
0 Myth 1 Posted July 27, 2013 (edited) countitem allows only 1 argument which is supposed to be an item ID. It should be like this, so that'll get you some nice errors when parsing the script. Your script should look like this: OnPCDieEvent:if( Class == 4060 ){ if(countitem(12725) < 3) getitem 12725, (3 - countitem(12725)); if(countitem(12726) < 3) getitem 12726, (3 - countitem(12726)); if(countitem(12727) < 3) getitem 12727, (3 - countitem(12727)); if(countitem(12728) < 3) getitem 12728, (3 - countitem(12728)); if(countitem(12729) < 3) getitem 12729, (3 - countitem(12729)); if(countitem(12730) < 3) getitem 12730, (3 - countitem(12730)); if(countitem(12731) < 3) getitem 12731, (3 - countitem(12731)); if(countitem(12732) < 3) getitem 12732, (3 - countitem(12732)); if(countitem(12733) < 3) getitem 12733, (3 - countitem(12733));} Or, in a more compressed form (saves disk space but uses a bit more of process): OnPCDieEvent:if( Class == 4060 ){ for (set .@i, 12725; .@i <= 12733; set .@i, .@i + 1) // We loop trhough the IDs for the runestones if(countitem(.@i) < 3) getitem .@i, (3 - countitem(.@i));} Hope this helps you. Solved Edited July 27, 2013 by Myth Quote Share this post Link to post Share on other sites
0 Myth 1 Posted July 27, 2013 Thanks to jaBote Emistry for helping me Quote Share this post Link to post Share on other sites
0 Myth 1 Posted July 28, 2013 i want to put an npc so that even they dont die they can receive runes. but the same concept Quote Share this post Link to post Share on other sites
0 Emistry 145 Posted July 28, 2013 use a npc with location...and not floating npc... Quote Share this post Link to post Share on other sites
0 Myth 1 Posted July 28, 2013 like this? prontera,111,111,5 script 39,{if( Class == 4060 ){for (set .@i, 12725; .@i <= 12733; set .@i, .@i + 1) // We loop trhough the IDs for the runestones if(countitem(.@i) < 3) getitem .@i, (3 - countitem(.@i));} Quote Share this post Link to post Share on other sites
this npc give 3x runes such as
only Rune Knight can talk to this npc and he will only get when he died
maximum of 3x of all the runes only he gets.
Share this post
Link to post
Share on other sites