Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/20/22 in all areas

  1. You should read every comment in conf file. Read is the key for success. // Minimum account group id required to connect to server. By the way @Elysium has answer your question. Just change it from -1 to 4 .. Then restart your server.
    1 point
  2. /*========================================== * @jumptosell - warps to the cheapest shop. * Made by Vengence * Make it work for latest [Shakto] *------------------------------------------*/ ACMD_FUNC(jumptosell) { char item_name[100]; int item_id = 0, j, count = 0, sat_num = 0; int s_type = 1; // search bitmask: 0-name,1-id, 2-card, 4-refine int refine = 0,card_id = 0; struct map_session_data* pl_sd; struct map_session_data* pl_sd2; struct s_mapiterator* iter; unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0; nullpo_retr(-1, sd); if (!message || !*message) { clif_displaymessage(fd, "Use: @jumptosell (<+refine> )(<item_id>)(<[card_id]>) or @jumptosell <name>"); return -1; } if (sscanf(message, "+%d %d[%d]", &refine, &item_id, &card_id) == 3){ s_type = 1+2+4; } else if (sscanf(message, "+%d %d", &refine, &item_id) == 2){ s_type = 1+4; } else if (sscanf(message, "+%d [%d]", &refine, &card_id) == 2){ s_type = 2+4; } else if (sscanf(message, "%d[%d]", &item_id, &card_id) == 2){ s_type = 1+2; } else if (sscanf(message, "[%d]", &card_id) == 1){ s_type = 2; } else if (sscanf(message, "+%d", &refine) == 1){ s_type = 4; } else if (sscanf(message, "%d", &item_id) == 1 && item_id == atoi(message)){ s_type = 1; } else if (sscanf(message, "%99[^\n]", item_name) == 1){ s_type = 1; std::shared_ptr<item_data> id = item_db.searchname( item_name ); if( id == nullptr ){ clif_displaymessage(fd, "No item found with this name"); return -1; } item_id = id->nameid; } else { clif_displaymessage(fd, "Use: @jumptosell (<+refine> )(<item_id>)(<[card_id]>) or @jumptosell <name>"); return -1; } struct item_data *item_data; //check card if(s_type & 2 && ((item_data = itemdb_exists(card_id)) == NULL || item_data->type != IT_CARD)){ clif_displaymessage(fd, "Not found a card with than ID"); return -1; } //check item if(s_type & 1 && (item_data = itemdb_exists(item_id)) == NULL){ clif_displaymessage(fd, "Not found an item with than ID"); return -1; } //check refine if(s_type & 4){ if (refine<0 || refine>10){ clif_displaymessage(fd, "Refine out of bounds: 0 - 10"); return -1; } /*if(item_data->type != IT_WEAPON && item_data->type != IT_ARMOR){ clif_displaymessage(fd, "Use refine only with weapon or armor"); return -1; }*/ } iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if( pl_sd->vender_id ) //check if player is vending { for (j = 0; j < pl_sd->vend_num; j++) { if((item_data = itemdb_exists(pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid)) == NULL) continue; if(s_type & 1 && pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid != item_id) continue; if(s_type & 2 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || (pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] != card_id && pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[1] != card_id && pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[2] != card_id && pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[3] != card_id))) continue; if(s_type & 4 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || pl_sd->cart.u.items_cart[pl_sd->vending[j].index].refine != refine)) continue; if(pl_sd->vending[j].value < MinPrice){ MinPrice = pl_sd->vending[j].value; pl_sd2 = pl_sd; } count++; } } } mapit_free(iter); if(count > 0) { pc_setpos(sd, pl_sd2->mapindex, pl_sd2->bl.x, pl_sd2->bl.y, CLR_TELEPORT); } else clif_displaymessage(fd, "Nobody is selling it now."); return 0; }
    1 point
  3. Change min_group_id_to_connect: -1 to 4
    1 point
  4. Hi. You need to set the array with IDs before using the conditional. You can use inarray to check if the monster killed ID is in the array. //Only monsters in the given array if ( inarray(.@monster_list, killedrid) > -1) //Only monsters who give MvP exp if ( getmonsterinfo( killedrid, MOB_MVPEXP) ) //Or both if ( inarray(.@monster_list, killedrid) > -1 || getmonsterinfo( killedrid, MOB_MVPEXP) ) Example: - script boss_treasure HIDDEN_WARP_NPC,{ end; OnNPCKillEvent: // add mvp & mini boss mob id's here setarray .@monster_list[0], 1312,1087,1086,1511; if ( inarray(.@monster_list, killedrid) > -1 || getmonsterinfo( killedrid, MOB_MVPEXP) ) { getmapxy(.@map$,.@x,.@y, BL_PC); monster .@map$, rand(.@x,.@x-3),rand(.@y-3,.@y), "--ja--", 1324, 1; } end; }
    1 point
  5. I've removed the OnPCLoadMapEvent Label and removed the set of the loadmap mapflag. Cuz' every time a player change the map (ex. die, warp or on NoSave flagged maps on disconnect) it will trigger this label and set the timer. Therefore I've just init the timer after warp to the map. The formatting was a bit confused. GoldRoom.txt Pls let me know if it works now. I can't check it by myself cuz' I'm only on mobile phone for a few days. Rynbef~
    1 point
  6. are you sure you're using latest git revision? are you updating or fresh clone from rathena git? Here's the v6 and v5. ExtendedVending_rev5.diff ExtendedVending_rev6.diff
    1 point
  7. I was looking at this topic and I think the script would work better like this so the player can enter multiple times throughout the week if he didn't use his 30 minutes up.prontera,150,150,5 script gold room 456,{ function t { function s; set .@left, getarg(0); if ( .@left <= 0 ) return getarg(0); set .@day, .@left / 86400; set .@hour, .@left % 86400 / 3600; set .@min, .@left % 3600 / 60; set .@sec, .@left % 60; return ( ( .@day ? .@day +" day"+ s( .@day ) : "" ) + ( .@hour ? .@hour +" hour"+ s( .@hour ) : "" ) + ( .@min ? .@min +" min"+ s( .@min ) : "" ) + ( .@sec ? .@sec +" sec"+ s( .@sec,1 ) : "" ) ); function s { return ( ( getarg(0) > 1 ? "s" : "" ) + ( getarg(1,0) ? "" : " " ) ); } } if ( gltimer <= 0 && enter_gold_room < gettimetick(2) ) { set gltimer, .glt; enter_gold_room = gettimetick(2) + 86400 * .dly; } else if ( enter_gold_room > gettimetick(2) && gltimer <= 0 ) { mes "I'm sorry you can't enter in the gold room. You must wait "+ t( enter_gold_room - gettimetick(2) )+"."; close; } mes "You have "+t( gltimer )+" remaining."; select( "enter in the gold room" ); warp .map$,0,0; end; OnPCLoadMapEvent: if(strcharinfo(3)==.map$) { attachnpctimer; initnpctimer; } end; OnTimer1000: if( playerattached() ){ if(strcharinfo(3)!=.map$) { stopnpctimer; end; } set gltimer, gltimer-1; attachnpctimer; initnpctimer; if( gltimer <= 0 ) { stopnpctimer; warp "prontera",0,0; message strcharinfo(0), "end of time for the gold room"; end; } } end; OnInit: set .dly , 7 ; //Delay in days. set .glt , 1800 ; //Gold Room Timer in seconds. set .map$, "geffen" ; //Gold Room map. setmapflag .map$, mf_loadevent; end; }I was also thinking about doing this with a rental item like a pass but I'm not sure if the time is consumed while the player is offline.
    1 point
  8. this script require 2-dimension array prontera,156,181,5 script asdas 100,{ mes "select an item"; next; .@item = select( .menu$ ); mes "the item you chose = "+ getitemname( getd( ".craft"+ .@item +"[0]" ) ); mes "require the following items"; for ( .@i = 1; .@i < .size[ .@item ]; .@i += 2 ) mes getd(".craft"+ .@item +"["+( .@i +1 )+"]") +"x "+ getitemname( getd(".craft"+ .@item +"["+ .@i +"]" ) ); next; for ( .@i = 1; .@i < .size[ .@item ]; .@i += 2 ) { if ( countitem( getd(".craft"+ .@item +"["+ .@i +"]") ) < getd(".craft"+ .@item +"["+( .@i +1 )+"]") ) { .@not_enough[ .@c ] = getd(".craft"+ .@item +"["+ .@i +"]"); .@c++; } } if ( .@c ) { mes "== Incomplete Items =="; for ( .@i = 0; .@i < .@c; .@i++ ) mes getitemname( .@not_enough[ .@i ] ); close; } for ( .@i = 1; .@i < .size[ .@item ]; .@i += 2 ) delitem getd(".craft"+ .@item +"["+ .@i +"]" ), getd(".craft"+ .@item +"["+( .@i +1 )+"]"); .@rand = rand(100); if ( .@rand < 5 ) .@get = 4; else if ( .@rand < 10 ) .@get = 3; else if ( .@rand < 25 ) .@get = 2; else if ( .@rand < 50 ) .@get = 1; else { mes "you failed at crafting this item"; close; } getitem getd( ".craft"+ .@item +"[0]" ), .@get; mes "you get "+ .@get +"x "+ getitemname( getd( ".craft"+ .@item +"[0]" ) ); close; OnInit: setarray .craft1, 1201, 501,1, 502,1, 503,1; setarray .craft2, 1204, 504,1, 505,1, 506,1; setarray .craft3, 2301, 512,1, 513,1, 514,1, 515,1; for ( .@i = 1; getd(".craft"+ .@i ); .@i++ ) { .menu$ = .menu$ + getitemname( getd(".craft"+ .@i +"[0]") ) +":"; .size[.@i] = getarraysize( getd(".craft"+ .@i ) ) -1; } end; } where the x-axis is the require items y-axis is the list of craft-able items in the menu
    1 point
×
×
  • Create New...