Jump to content

pajodex

Members
  • Posts

    431
  • Joined

  • Last visited

  • Days Won

    25

Community Answers

  1. pajodex's post in Difficulties with Vending Control Script by Emistry's was marked as the answer   
    If you haven't tried yet, make sure the vending spots are more than 3/4 cells away to avoid getting this error. (AFAIK)..
    Else, change the settings in conf/battle/player.conf
     
    // Minimum distance a vending/chat room must be from a NPC in order to be placed. // Default: 3 (0: disabled). min_npc_vendchat_distance: 3 Edit:

    I think this is a mapflag thing, make sure vending is allowed on this map.
  2. pajodex's post in need help anti bot check was marked as the answer   
    instead of this, try to use this :
     
    if ( instance_id(IM_PARTY) || instance_id(IM_CHAR) ) end;  
  3. pajodex's post in item drop on endless was marked as the answer   
    It seems like you are using a custom Endless tower. Just as example, I will use the official endless tower script.
    1@tower,29,365,1 script #1F Controller 844,{ end; OnInstanceInit: callfunc "F_Tower_Monster", 1, instance_mapname("1@tower"), instance_npcname("#1F Controller")+"::OnMyMobDead"; // This is the function calling the death event of the monster.. end; OnMyMobDead: // This one should trigger. set .@map$, instance_mapname("1@tower"); set .@mob_dead_num,mobcount(.@map$,instance_npcname("#1F Controller")+"::OnMyMobDead"); /* *************************************************** This is where you can add your script posted above I modified it abit so it wont stop the script from functioning. *************************************************** */ if ( killedrid == 31000 ) { if ( getcharid(1) ) { getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/ .@partymemberaid[.@c] = $@partymemberaid[.@i]; .@c++; } } if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1, .@partymemberaid[ rand( .@c ) ]; announce "Party ["+ strcharinfo(1) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } else { if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1; announce "El jugador ["+ strcharinfo(0) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } } if (.@mob_dead_num < 1) { initnpctimer; //SetItemPartyInMap in_102floor 1 } else mapannounce .@map$, "Remaining Monsters on the 1st Level - "+.@mob_dead_num,bc_map,"0x00ff99"; end; OnTimer5000: mapannounce instance_mapname("1@tower"), "All Monsters on the 1st Level have been defeated.",bc_map,"0xffff00"; donpcevent instance_npcname("1FGate102tower")+"::OnEnable"; stopnpctimer; end; }  
  4. pajodex's post in item drop on endless was marked as the answer   
    It seems like you are using a custom Endless tower. Just as example, I will use the official endless tower script.
    1@tower,29,365,1 script #1F Controller 844,{ end; OnInstanceInit: callfunc "F_Tower_Monster", 1, instance_mapname("1@tower"), instance_npcname("#1F Controller")+"::OnMyMobDead"; // This is the function calling the death event of the monster.. end; OnMyMobDead: // This one should trigger. set .@map$, instance_mapname("1@tower"); set .@mob_dead_num,mobcount(.@map$,instance_npcname("#1F Controller")+"::OnMyMobDead"); /* *************************************************** This is where you can add your script posted above I modified it abit so it wont stop the script from functioning. *************************************************** */ if ( killedrid == 31000 ) { if ( getcharid(1) ) { getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/ .@partymemberaid[.@c] = $@partymemberaid[.@i]; .@c++; } } if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1, .@partymemberaid[ rand( .@c ) ]; announce "Party ["+ strcharinfo(1) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } else { if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1; announce "El jugador ["+ strcharinfo(0) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } } if (.@mob_dead_num < 1) { initnpctimer; //SetItemPartyInMap in_102floor 1 } else mapannounce .@map$, "Remaining Monsters on the 1st Level - "+.@mob_dead_num,bc_map,"0x00ff99"; end; OnTimer5000: mapannounce instance_mapname("1@tower"), "All Monsters on the 1st Level have been defeated.",bc_map,"0xffff00"; donpcevent instance_npcname("1FGate102tower")+"::OnEnable"; stopnpctimer; end; }  
  5. pajodex's post in item drop on endless was marked as the answer   
    It seems like you are using a custom Endless tower. Just as example, I will use the official endless tower script.
    1@tower,29,365,1 script #1F Controller 844,{ end; OnInstanceInit: callfunc "F_Tower_Monster", 1, instance_mapname("1@tower"), instance_npcname("#1F Controller")+"::OnMyMobDead"; // This is the function calling the death event of the monster.. end; OnMyMobDead: // This one should trigger. set .@map$, instance_mapname("1@tower"); set .@mob_dead_num,mobcount(.@map$,instance_npcname("#1F Controller")+"::OnMyMobDead"); /* *************************************************** This is where you can add your script posted above I modified it abit so it wont stop the script from functioning. *************************************************** */ if ( killedrid == 31000 ) { if ( getcharid(1) ) { getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/ .@partymemberaid[.@c] = $@partymemberaid[.@i]; .@c++; } } if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1, .@partymemberaid[ rand( .@c ) ]; announce "Party ["+ strcharinfo(1) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } else { if (rand(100) < 10) getitem F_Rand(45006,45007,45008,45009,45010,45011), 1; announce "El jugador ["+ strcharinfo(0) +"] ha matado "+ getmonsterinfo( killedrid, MOB_NAME ) +" en "+ strcharinfo(3), 0; } } if (.@mob_dead_num < 1) { initnpctimer; //SetItemPartyInMap in_102floor 1 } else mapannounce .@map$, "Remaining Monsters on the 1st Level - "+.@mob_dead_num,bc_map,"0x00ff99"; end; OnTimer5000: mapannounce instance_mapname("1@tower"), "All Monsters on the 1st Level have been defeated.",bc_map,"0xffff00"; donpcevent instance_npcname("1FGate102tower")+"::OnEnable"; stopnpctimer; end; }  
  6. pajodex's post in Check Monster Level on OnNPCKillEvent: was marked as the answer   
    Never tried this but I think this should work.
    *strmobinfo(<type>,<monster id>); This function will return information about a monster record in the database, as per 'db/(pre-)re/mob_db.yml'. Type is the kind of information returned. Valid types are: It will return 0 if there is no such monster (or the type value is invalid), or an empty string if you requested the monster's name. 1 - 'english name' field in the database, a string. 2 - 'japanese name' field in the database, a string. All other returned values are numbers: 3 - Level. 4 - Maximum HP. 5 - Maximum SP. 6 - Experience reward. 7 - Job experience reward. - script test -1, OnNPCKillEvent: if ( killedrid == 1134 && strmobinfo(3,killedrid) == 31 ) { // Check if kobold lv 31 if (rand(100) > 50) getitem 501, 1; // get a 50% chance to have reward } end; } you can expand this by adding variables and loops..
  7. pajodex's post in Hiding announcements via command? was marked as the answer   
    Try this, tested on latest git on its basic functionality. Let me know if there are any problems.
    @blockbc - blocks broadcasts depending on the parameter set
    @unblockbc - as the name suggest
     
    0001-blockbc-command.patch
  8. pajodex's post in Making @me command display @fakename instead of real name was marked as the answer   
    Look for this on src/map/atcommand.cpp:

     
    /*========================================== * @me by lordalfa * => Displays the OUTPUT string on top of the Visible players Heads. *------------------------------------------*/ ACMD_FUNC(me) { char tempmes[CHAT_SIZE_MAX]; nullpo_retr(-1, sd); memset(tempmes, '\0', sizeof(tempmes)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (sd->sc.cant.chat || (sd->state.block_action & PCBLOCK_CHAT)) return -1; //no "chatting" while muted. if (!message || !*message || sscanf(message, "%255[^\n]", tempmes) < 0) { clif_displaymessage(fd, msg_txt(sd,1302)); // Please enter a message (usage: @me <message>). return -1; } + if ( sd->fakename[0] ) + sprintf(atcmd_output, msg_txt(sd,270), sd->fakename, tempmes); // *%s %s* + else sprintf(atcmd_output, msg_txt(sd,270), sd->status.name, tempmes); // *%s %s* clif_disp_overhead(&sd->bl, atcmd_output); return 0; } Where the '+' are the lines you need to add incase you didnt know.
  9. pajodex's post in Request PvP Warper was marked as the answer   
    // Disclaimer : // Yes this code is from example 2 of script_commands.txt prontera,150,180,0 script PvP Party Warper 100,{ .@pvpmap$ = "guild_vs1"; // Pvp map .@register_num = 45; // How many party members are required? getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; if ( !getcharid(1) || $@partymembercount != .@register_num ) { mes "Please form a party of " + .@register_num + " to continue"; close; } for ( .@i = 0; .@i < $@partymembercount; .@i++ ) if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) .@count_online++; if ( .@count_online != .@register_num ) { mes "All your party members must be online to continue"; close; } copyarray .@partymembercid, $@partymembercid, .@register_num; mes "Are you ready ?"; next; select("Yes"); getpartymember getcharid(1), 1; if ( $@partymembercount != .@register_num ) { mes "You've made changes to your party !"; close; } for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( .@partymembercid[.@i] != $@partymembercid[.@i] ) { mes "You've made changes to your party !"; close; } } warpparty .@pvpmap$, 0,0, getcharid(1); end; }  
  10. pajodex's post in NPC Shop be walking ? was marked as the answer   
    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: .@len = getarraysize(.customs); // Get the number of customs we're adding. .@b_len = getarraysize(@bought_nameid); // Get the number of purchased items. for( set @i, 0; @i < .@len; set @i, @i+1 ) { for( set @d,0; @d < .@b_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; // Npc walks every 10 sec OnTimer10000: .@x = .npc_x + rand( -10,10 ); .@y = .npc_y + rand( -10,10 ); npcwalkto .@x,.@y; setnpctimer 0; end; // 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 .@i, 0; .customs[.@i]; set .@i, .@i+1 ) // Loop through our custom items. npcshopadditem "custom_seller10",.customs[.@i],.Price[.@i]; // Add our custom items to the cleared dummy shop. npcspeed 200; getmapxy( .npc_map$, .npc_x, .npc_y,1 ); initnpctimer; end; end; }  
  11. pajodex's post in Announce item name and ID was marked as the answer   
    add something like..
    announce "["+strcharinfo(0)+"] has just obtained a ["+getitemname( .@item )+"("+.@item+")] from a Custom Box.",0;  
  12. pajodex's post in Euphy's WOE Controller Rewards was marked as the answer   
    I just read your code right now, I think there is a better way to do that..  (without using SQL)
    just few notes :
    1. Use script commands available at doc/script_commands.txt such as *getguildmaster, *getcharid, *strcharinfo, *attachrid.. 2. You are using "$" as variable.. read in script_commands the functions of the variables.. you can just use ".@" instead.. ".@var$" 3. Since I still didnt check Euphy's script, I assume it ran in a loop.. .@aid[.@j] -> already contains account ID of something? you can run it using *attachrid sample: attachrid .@aid[.@j]; // attaches the .@aid getitem 501, 10; // gets the item.. detachrid; // detaches the rid As they say, there is still room for improvements.. I constantly learn from my mistakes and being pointed out is not a bad thing.. it means new thing you will learn which will improve your skills a lot.
  13. pajodex's post in Item view was marked as the answer   
    *setlook <look type>,<look value>{,<char_id>}; *changelook <look type>,<look value>{,<char_id>}; 'setlook' will alter the look data for the invoking character. It is used mainly for changing the palette used on hair and clothes: you specify which look type you want to change, then the palette you want to use. Make sure you specify a palette number that exists/is usable by the client you use. 'changelook' works the same, but is only client side (it doesn't save the look value). // This will change your hair color, so that it uses palette 8, what ever your // palette 8 is, your hair will use that color setlook LOOK_HAIR_COLOR,8; // This will change your clothes color, so they are using palette 1, whatever // your palette 1 is, your clothes will then use that set of colors. setlook LOOK_CLOTHES_COLOR,1; Here are the possible look types: LOOK_BASE - Base sprite LOOK_HAIR - Hairstyle LOOK_WEAPON - Weapon LOOK_HEAD_BOTTOM - Head bottom LOOK_HEAD_TOP - Head top LOOK_HEAD_MID - Head mid LOOK_HAIR_COLOR - Hair color LOOK_CLOTHES_COLOR - Clothes color LOOK_SHIELD - Shield LOOK_SHOES - Shoes LOOK_BODY2 - Body style Whatever 'shoes' means is anyone's guess, ask Gravity - the client does nothing with this value. It still wants it from the server though, so it is kept, but normally doesn't do a thing. Only the look data for hairstyle, hair color and clothes color are saved to the char server's database and will persist. Body style will also persist if 'save_body_style' configuration is enabled in '/conf/battle/client.conf'. The rest freely change as the character puts on and removes equipment, changes maps, logs in and out and otherwise you should not expect to set them. In fact, messing with them is generally hazardous, do it at your own risk, it is not tested what will this actually do - it won't cause database corruption and probably won't cause a server crash, but it's easy to crash the client with just about anything unusual. However, it might be an easy way to quickly check for empty view IDs for sprites, which is essential for making custom headgear. Since a lot of people have different palettes for hair and clothes, it's impossible to tell you what all the color numbers are. If you want a serious example, there is a Stylist script inside the default rAthena installation that you can look at: 'npc/custom/stylist.txt'  
  14. pajodex's post in GmSupportRequest was marked as the answer   
    don't use `sleep2`
     
    Quoted from doc/script_commands.txt
    sleep 10000; //pause the script for 10 seconds and ditch the RID (so no player is attached anymore) sleep2 5000; //pause the script for 5 seconds, and continue with the RID attached.  
    I didn't test this but ohh well...
    prontera,148,195,5 script GM Support Assistant 469,{ mes .n$; if ( !.onlinegm ) { mes "No available GMs at the moment"; close; } mes "No. of GMs Online :"+ .onlinegm; mes " "; mes "Would you like to contact them?"; next; if(select("Yes","No")==2) close; mes .n$; if(gettimetick(2) < #HelpDelay) { mes "You may only send a message every 5 minutes!"; close; } atcommand "@request This player is in need of assistance."; #HelpDelay = gettimetick(2) + 300; mes "Game Masters has been notified."; close; OnPCLoginEvent: if ( getgmlevel() > 10 ) ++.onlinegm; end; OnPCLogoutEvent: if ( getgmlevel() > 10 ) --.onlinegm; end; OnInit: .n$ = "[ ^FF55FFGM Support Assistant^000000; ]"; L_Reload: waitingroom "Number of online GMs: "+.onlinegm,0; sleep 3000; delwaitingroom; waitingroom "Do you want to contact GMs?",0; sleep 3000; delwaitingroom; waitingroom "If you need assistance, please click me.",0; sleep 3000; delwaitingroom; goto L_Reload; end; }  
  15. pajodex's post in how to put countdown? was marked as the answer   
    make to 
    mes "[自動倒數器]"; announce "The race will begin",bc_all,0xFF0000; initnpctimer; // initialize npc timer end; and here
    to
    OnTimer35000: stopnpctimer; // stops the timer announce "0",15; end;  
  16. pajodex's post in PvP at all locations, except cities was marked as the answer   
    https://github.com/rathena/rathena/blob/master/conf/battle/misc.conf
    // PK Server Mode. Turns entire server pvp(excluding towns). Experience loss is doubled if killed by another player. // When players hunt monsters over 20 levels higher, they will receive 15% additional exp., and 25% chance of receiving more items. // There is a nopvp.txt for setting up maps not to have pk on in this mode. Novices cannot be attacked and cannot attack. // Normal pvp counter and rank display are disabled as well. // Note: If pk_mode is set to 2 instead of 1 (yes), players will receive a // manner penalty of 5 each time they kill another player (see manner_system // config to adjust how this will affect players) pk_mode: 0  
  17. pajodex's post in race to 99 rewards was marked as the answer   
    Here, forgot to add check if player is lower than lvl 99.
    Tick solve and upvote if I helped you, Thanks.
    // by pajodex // Optimized by AnnieRuru prontera,150,150,0 script Race-To-99 100,{ if (BaseLevel < 99) { npctalk "Sorry, Only Lvl 99 can claim the reward!"; end; } if ($ItemGive == 100) { npctalk "Sorry, all rewards has been taken!"; end; } if (getreward) { npctalk "Sorry, Nothing for you!"; end; } announce "Congratulations! "+strcharinfo(0)+" has claimed his reward for Race to 99 Event", bc_all; getitem 501, 100; ++$ItemGive; getreward = 1; sleep 2000; announce "There are "+(100 - $ItemGive)+" rewards left to give!", bc_all; end; }
  18. pajodex's post in Help to adding a script on item was marked as the answer   
    go to your:
    trunk/db/re/item_combo.txt look for this
    //5359:5657,{ bonus bLongAtkRate,getequiprefinerycnt(EQI_HEAD_TOP); } then uncomment / remove the "//" - don't forget to use '@reloaditemdb' after
     
    NOTE: it is not implemented for a reason which I have no idea.
  19. pajodex's post in How to enable Professor/Sage Elemental Change skill to work on players? was marked as the answer   
    LOL sorry I'm sure now
    case SA_ELEMENTWATER: case SA_ELEMENTFIRE: case SA_ELEMENTGROUND: case SA_ELEMENTWIND: //if (sd && (!dstmd || status_has_mode(tstatus,MD_STATUS_IMMUNE))) // Only works on monsters (Except status immune monsters). // break; comment it out
  20. pajodex's post in [SOLVED]Custom aura when Item is worn was marked as the answer   
    Works, however, the loop wont stop in 1 occurrence. It loads again and again therefore causing high load and eventually server crash 
    I used this updated patched of aura mod of Zyphrus by @razmux and works fine.
  21. pajodex's post in How to add custom commands like @freebies @gpack Newbie Here was marked as the answer   
    - script command#freebies -1,{ OnInit: // This part binds "freebies" as atcommand. bindatcmd("freebies",strnpcinfo(0)+"::OnCommand"); end; OnCommand: // This part tells your players that he got his freebies If(GetFree) { mes "You have received your rewards"; close; } else { // This part if players didnt get his freebies yet mes "Welcome! Here are your freebies"; close2: set GetFree,1; // To avoid abuse, Set GetFree variable to 1 getitem 501,1; // Items received by the player in this case, 1 red potion (ItemID 501) you can add more by adding getitem <ITEMID>,<AMOUNT>; below end; } } Do the same for gpack and costumeitem(if it means to get a free costume item)
     
  22. pajodex's post in MVP Card trader was marked as the answer   
    @GodKnows Jhomz   Hi, I was able to do it my self. Working fine I guess? Can you check it for optimization? I will still clean this up in a while 
    prontera,140,160,4 script Black Market NPC 10044,{ mes "[^995050Black Market NPC^000000]"; mes "Hi, "+strcharinfo(0)+"!"; mes "What can I do for you?"; next; switch(select(" > Information: > Trade in cards: > Leave")) { // : > Point shop (^0055FF"+getd(.Points$)+"^000000) case 1: mes "[^995050Black Market NPC^000000]"; mes "Do you find that you've got"; mes "useless cards lying around?"; mes "I'll be glad to take them off"; mes "your hands!"; next; mes "[^995050Black Market NPC^000000]"; mes "I'll give you ^0055FF"+.Points[0]+" Point"+((.Points[0] == 1)?"":"s")+"^000000 for each"; mes "card you give me, and"; mes "^0055FF"+.Points[1]+" Points^000000 for MVP cards."; mes "You can trade those points"; mes "for items later on."; mes "How does that sound?"; emotion e_cash; close; case 2: mes "[^995050Black Market NPC^000000]"; mes "Select the cards you"; mes "want to trade in."; if (.Level) { mes " "; mes "They must be dropped"; mes "by monsters of level"; mes .Level+" and above."; } deletearray @sold_nameid[0],getarraysize(@sold_nameid); callshop "card_shop",2; npcshopattach "card_shop"; end; // case 3: // mes "[^995050Black Market NPC^000000]"; // mes "You have ^0055FF"+getd(.Points$)+"^000000 Point"+((getd(.Points$) == 1)?".":"s."); // callshop "card_shop",1; // npcshopattach "card_shop"; // end; case 3: mes "[^995050Black Market NPC^000000]"; mes "*yawn*"; mes "See you later!"; emotion e_yawn; close; } OnSellItem: mes "Cards to sell:"; mes "-----------------------------------"; for(set .@i,0; .@i<getarraysize(@sold_nameid); set .@i,.@i+1) if (@sold_nameid[.@i] > 4000 && @sold_nameid[.@i] < 4700 | @sold_nameid[.@i] > 33000 && @sold_nameid[.@i] < 33006) { if (.Level) { query_sql("SELECT `LV` FROM `mob_db` WHERE `DropCardid` = "+@sold_nameid[.@i],.@lv); if (.@lv < .Level) { dispbottom getitemname(@sold_nameid[.@i])+" is under the minimum level."; continue; } } set .@card_id[getarraysize(.@card_id)], @sold_nameid[.@i]; set .@card_amt[getarraysize(.@card_amt)], @sold_quantity[.@i]; set .@class2, compare(.class2$,""+@sold_nameid[.@i]); set .@class3, compare(.class3$,""+@sold_nameid[.@i]); set .@class4, compare(.class4$,""+@sold_nameid[.@i]); mes ((.@class2 || .@class3 || .@class4)?" ^FF0000":" ^777777")+@sold_quantity[.@i]+"x "+getitemname(@sold_nameid[.@i])+"^000000"; if(.@class2) { .@class=1; } else if(.@class3) { .@class=2; } else if(.@class4) { .@class=3; } else { .@class=0; mes "DONT SELL ME CRAP I WILL TEAR THIS DOWN!"; close2; end; } set .@card_total, .@card_total+ ( @sold_quantity[.@i]* .Points[.@class] ); } deletearray @sold_nameid[0], getarraysize(@sold_nameid); deletearray @sold_quantity[0], getarraysize(@sold_quantity); if (!.@card_id) { mes " ^777777(none)^000000"; emotion e_swt; close; } //mes " "; mes "-----------------------------------"; mes "---------- Total: ^0055FF"+.@card_total+" pt.^000000 -------"; next; if(select(" > ^0055FFComplete trade...^000000: > ^777777Cancel^000000") == 2) { mes "[^995050Black Market NPC^000000]"; mes "Oh, okay..."; emotion e_hmm; close; } for(set .@i,0; .@i<getarraysize(.@card_id); set .@i,.@i+1) delitem .@card_id[.@i],.@card_amt[.@i]; //setd .Points$, getd(.Points$)+.@card_total; getitem 501, getd(.Points$)+.@card_total; mes "[^995050Black Market NPC^000000]"; mes "All done!"; emotion e_ho; close; OnBuyItem: for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1) for(set .@j,0; .@j<getarraysize(.Shop); set .@j,.@j+2) if (@bought_nameid[.@i] == .Shop[.@j]) { set .@cost, .@cost+(.Shop[.@j+1]*@bought_quantity[.@i]); break; } if (.@cost > getd(.Points$)) { mes "[^995050Black Market NPC^000000]"; mes "You don't have enough Points."; emotion e_omg; } else { mes "Items purchased:"; mes "-----------------------------------"; for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1) { getitem @bought_nameid[.@i], @bought_quantity[.@i]; mes " ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000"; } mes " "; mes "---------- Total: ^0055FF"+.@cost+" pt.^000000 -------"; setd .Points$, getd(.Points$)-.@cost; emotion e_cash; } deletearray @bought_nameid[0], getarraysize(@bought_nameid); deletearray @bought_quantity[0], getarraysize(@bought_quantity); close; OnInit: set .Level,0; // Minimum monster level to trade corresponding cards. set .Points$,"#TESTPOINTS"; // Variable to store points. setarray .Shop[0], // Card Shop items: <ID>,<point cost> 5027,10, 18505,10, 5176,10, 5305,20; //setarray .Points[0],5,100; // Points per <normal card>,<MVP card> setarray .Points[0],0,rand(5,11),rand(1,3),rand(8,20); // Points per <Class 1>,<Class 2>,<Class 3>,<Class 4> set .class2$, "4441,4408,4263,4168,4430,4342,4318,4407,4399,4302,4560,4561,4562,4563,4564,4565,4566,4324,4386,4276,4334,4174"; set .class3$, "4121,4123,4128,4131,4132,4134,4135,4137,4142,4143,4144,4145,4146,4147,4148,"+ "4236,4305,4330,4357,4359,4361,4363,4365,4403"; set .class4$, "33000,33001,33002,33003,33004,33005,33006"; npcshopdelitem "card_shop",909; for(set .@i,0; .@i<getarraysize(.Shop); set .@i,.@i+2) npcshopadditem "card_shop",.Shop[.@i],.Shop[.@i+1]; end; } - shop card_shop -1,909:-1  
×
×
  • Create New...