I need to make a simple modification to a npc I already have, but I do not know if this is possible.
I need an npc shop item to be walking in the middle of prontera.
shop custom_seller21 -1,673:1000000 // Create our dummy shop.
prontera,150,150,4 script [Máquina Cartas] 564,{
// This code runs when the user clicks our npc.
mes "[^FF2400Cuidado^000000] Escolha um item!"; // Let the user know about our shop.
callshop "custom_seller21",1; // Summon our dummy shop filled with custom items.
npcshopattach "custom_seller21"; // Attach the shop to this npc.
end;
// This code runs when a user purchases an item from out shop.
OnBuyItem:
[email protected] = getarraysize(.customs); // Get the number of customs we're adding.
[email protected]_len = getarraysize(@bought_nameid); // Get the number of purchased items.
for( set @i, 0; @i < [email protected]; set @i, @i+1 ) {
for( set @d,0; @d < [email protected]_len; set @d, @d+1 ) {
if( @bought_nameid[@d] == .customs[@i] ) { // Check if the purchased item equals our custom item.
if( countitem(.CoinID) >= .Price[@i] * @bought_quantity[@d] ) { // Check if the user has the correct funds.
delitem .CoinID,.Price[@i]*@bought_quantity[@d];
getitem @bought_nameid[@d],@bought_quantity[@d];
}
}
}
}
deletearray @bought_quantity, getarraysize(@bought_quantity); // Remove the array.
deletearray @bought_nameid, getarraysize(@bought_nameid); // Remove the array.
close;
// This code runs first. When the server is started.
OnInit:
setarray .customs[0],4035,4060,4063; // An array of out custom items.
set .CoinID,1226; // ID da Moeda em uso.
setarray .Price[0],500,500,500; // The amount of coins needed for our items. (For example: Item 12103 = 20 coins)
npcshopitem "custom_seller21",0,0; // Remove all items from our dummy shop.
for( set [email protected], 0; .customs[[email protected]]; set [email protected], [email protected]+1 ) // Loop through our custom items.
npcshopadditem "custom_seller10",.customs[[email protected]],.Price[[email protected]]; // Add our custom items to the cleared dummy shop.
end;
}
If it is possible could someone show me how to do it?
If it is possible to do this I can put the sprite of a monster that he will walk?
Good night..
I need to make a simple modification to a npc I already have, but I do not know if this is possible.
I need an npc shop item to be walking in the middle of prontera.
shop custom_seller21 -1,673:1000000 // Create our dummy shop. prontera,150,150,4 script [Máquina Cartas] 564,{ // This code runs when the user clicks our npc. mes "[^FF2400Cuidado^000000] Escolha um item!"; // Let the user know about our shop. callshop "custom_seller21",1; // Summon our dummy shop filled with custom items. npcshopattach "custom_seller21"; // Attach the shop to this npc. end; // This code runs when a user purchases an item from out shop. OnBuyItem: [email protected] = getarraysize(.customs); // Get the number of customs we're adding. [email protected]_len = getarraysize(@bought_nameid); // Get the number of purchased items. for( set @i, 0; @i < [email protected]; set @i, @i+1 ) { for( set @d,0; @d < [email protected]_len; set @d, @d+1 ) { if( @bought_nameid[@d] == .customs[@i] ) { // Check if the purchased item equals our custom item. if( countitem(.CoinID) >= .Price[@i] * @bought_quantity[@d] ) { // Check if the user has the correct funds. delitem .CoinID,.Price[@i]*@bought_quantity[@d]; getitem @bought_nameid[@d],@bought_quantity[@d]; } } } } deletearray @bought_quantity, getarraysize(@bought_quantity); // Remove the array. deletearray @bought_nameid, getarraysize(@bought_nameid); // Remove the array. close; // This code runs first. When the server is started. OnInit: setarray .customs[0],4035,4060,4063; // An array of out custom items. set .CoinID,1226; // ID da Moeda em uso. setarray .Price[0],500,500,500; // The amount of coins needed for our items. (For example: Item 12103 = 20 coins) npcshopitem "custom_seller21",0,0; // Remove all items from our dummy shop. for( set [email protected], 0; .customs[[email protected]]; set [email protected], [email protected]+1 ) // Loop through our custom items. npcshopadditem "custom_seller10",.customs[[email protected]],.Price[[email protected]]; // Add our custom items to the cleared dummy shop. end; }If it is possible could someone show me how to do it?
If it is possible to do this I can put the sprite of a monster that he will walk?
I thank you for your help.
Link to comment
Share on other sites