laklaker Posted May 15, 2012 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 109 Reputation: 0 Joined: 12/27/11 Last Seen: February 25, 2020 Share Posted May 15, 2012 Hello! I would like just to request something? I wanted to create a npc that trades a card for specific players like for example: Anonymous (This is a real IGN) Skull can be tradable into a card. Would you think it would work? Thanks! Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted May 16, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted May 16, 2012 My fault: delitem2 7420, 1, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; About the name, you have to reloadscript. Here a fix : // Damn !? No reloadscript ?! if ( .char_name$ == "" ) { donpcevent strnpcinfo(3) + "::OnInit"; sleep2 1; // Execute OnInit before continue. } mes "I give you an apple if you give me " + .char_name$ . "'s skull !"; next; if ( countitem2( 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16 ) ) { mes "Yeah you have the skull ! I give you an apple"; delitem2 7420, 1, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; getitem 512, 1; } else { mes "Damn, you don't have it..."; } close; OnInit: set .char_name$, "Anonymous"; query_sql("SELECT `char_id` FROM `char` WHERE `name`='" + escape_sql(.char_name$) + "' LIMIT 1", .cible_cid ); if ( !.cible_cid ) debugmes "[skull Trader] Invalid name specify ?"; end; Quote Link to comment Share on other sites More sharing options...
Emistry Posted May 15, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 2 hours ago Share Posted May 15, 2012 Skull ID - 7420 and yes you can trade it into another Card if your NPC does so. just check for item 7420 and trade to the Card you want. Quote Link to comment Share on other sites More sharing options...
laklaker Posted May 15, 2012 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 109 Reputation: 0 Joined: 12/27/11 Last Seen: February 25, 2020 Author Share Posted May 15, 2012 Skull ID - 7420 and yes you can trade it into another Card if your NPC does so. just check for item 7420 and trade to the Card you want. I mean just to specific skulls? Like My skull only? Thanks! And could you please put some examples of the codes? Thanks Quote Link to comment Share on other sites More sharing options...
Nameless2you Posted May 15, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 351 Reputation: 52 Joined: 11/15/11 Last Seen: June 15, 2015 Share Posted May 15, 2012 Skulls, like yours that are dropped in pvp are just normal skulls, id 7420, nothing special about them, they're just signed with your name, no different worth or any other id. Quote Link to comment Share on other sites More sharing options...
deathscythe13 Posted May 15, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 118 Reputation: 7 Joined: 01/25/12 Last Seen: February 11, 2023 Share Posted May 15, 2012 if(countitem(7420)) { //do something } Quote Link to comment Share on other sites More sharing options...
ForteXX Posted May 15, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 7 Reputation: 0 Joined: 02/08/12 Last Seen: September 21, 2012 Share Posted May 15, 2012 Im pretty sure (s)he's wanting it to read the name off of the skull, perhaps for something like a mercenary script (kill a certain person and bring in their skull). Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted May 15, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted May 15, 2012 Just an example: mes "I give you an apple if you give me " + .char_name$ . "'s skull !"; next; if ( countitem2( 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16 ) ) { mes "Yeah you have the skull ! I give you an apple"; delitem2 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; getitem 512, 1; } else { mes "Damn, you don't have it..."; } close; OnInit: set .char_name$, "Anonymous"; query_sql("SELECT `char_id` FROM `char` WHERE `name`='" + escape_sql(.char_name$) + "' LIMIT 1", .cible_cid ); end; Good luck. 1 Quote Link to comment Share on other sites More sharing options...
laklaker Posted May 16, 2012 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 109 Reputation: 0 Joined: 12/27/11 Last Seen: February 25, 2020 Author Share Posted May 16, 2012 Just an example: mes "I give you an apple if you give me " + .char_name$ . "'s skull !"; next; if ( countitem2( 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16 ) ) { mes "Yeah you have the skull ! I give you an apple"; delitem2 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; getitem 512, 1; } else { mes "Damn, you don't have it..."; } close; OnInit: set .char_name$, "Anonymous"; query_sql("SELECT `char_id` FROM `char` WHERE `name`='" + escape_sql(.char_name$) + "' LIMIT 1", .cible_cid ); end; Good luck. Hello there! I tried your script how ever it doesn't recognized a name. + An error in this line delitem2 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; Quote Link to comment Share on other sites More sharing options...
Emistry Posted May 16, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 2 hours ago Share Posted May 16, 2012 you can try this http://upaste.me/657c37123fcc206 Quote Link to comment Share on other sites More sharing options...
laklaker Posted May 16, 2012 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 109 Reputation: 0 Joined: 12/27/11 Last Seen: February 25, 2020 Author Share Posted May 16, 2012 Ok thanks! I'll try it when I get back in home. Same as the one as I said. :| Quote Link to comment Share on other sites More sharing options...
laklaker Posted May 16, 2012 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 109 Reputation: 0 Joined: 12/27/11 Last Seen: February 25, 2020 Author Share Posted May 16, 2012 (edited) My fault: delitem2 7420, 1, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; About the name, you have to reloadscript. Here a fix : // Damn !? No reloadscript ?! if ( .char_name$ == "" ) { donpcevent strnpcinfo(3) + "::OnInit"; sleep2 1; // Execute OnInit before continue. } mes "I give you an apple if you give me " + .char_name$ . "'s skull !"; next; if ( countitem2( 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16 ) ) { mes "Yeah you have the skull ! I give you an apple"; delitem2 7420, 1, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; getitem 512, 1; } else { mes "Damn, you don't have it..."; } close; OnInit: set .char_name$, "Anonymous"; query_sql("SELECT `char_id` FROM `char` WHERE `name`='" + escape_sql(.char_name$) + "' LIMIT 1", .cible_cid ); if ( !.cible_cid ) debugmes "[skull Trader] Invalid name specify ?"; end; I'll try this when I get back home. Thanks! It works now however the delitem wont work :|. Edited May 16, 2012 by laklaker Quote Link to comment Share on other sites More sharing options...
miapotter Posted May 18, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 3 Reputation: 0 Joined: 05/18/12 Last Seen: September 29, 2012 Share Posted May 18, 2012 i also need something like this. however it wont work on me also. Quote Link to comment Share on other sites More sharing options...
laklaker Posted May 25, 2012 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 109 Reputation: 0 Joined: 12/27/11 Last Seen: February 25, 2020 Author Share Posted May 25, 2012 I still need help :\ . Quote Link to comment Share on other sites More sharing options...
Question
laklaker
Hello! I would like just to request something? I wanted to create a npc that trades a card for specific players like for example: Anonymous (This is a real IGN) Skull can be tradable into a card. Would you think it would work? Thanks!
Link to comment
Share on other sites
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.