Jump to content

Shakto

Members
  • Posts

    402
  • Joined

  • Last visited

  • Days Won

    3

Community Answers

  1. Shakto's post in Jumptosell command was marked as the answer   
    /*========================================== * @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; }  
  2. Shakto's post in N>Arsinoe.grf was marked as the answer   
    http://rathena.org/board/topic/53282-maps-scripts-arsinoe-aeries-tears/
  3. Shakto's post in buf: bad header in precompiled chunk Help me please was marked as the answer   
    Why compile lua to lub..
    Just rename your files into .lub, it'll working
  4. Shakto's post in Client crashes/freezes when entering a castle was marked as the answer   
    Maybe the diff patch you used has a mistake
    But a wrong packet utilisation can provok a crash on server
    Try to use another client to check that
  5. Shakto's post in Custom AI was marked as the answer   
    http://drazzy.com/ai/getaai.shtml
     
    Work with homun S
  6. Shakto's post in request magic attack was marked as the answer   
    battle.c
     
    //MATK_RATE scales the damage. 100 = no change. 50 is halved, 200 is doubled, etc #define MATK_RATE( a ) { ad.damage= ad.damage*(a)/100; } //Adds dmg%. 100 = +100% (double) damage. 10 = +10% damage #define MATK_ADDRATE( a ) { ad.damage+= ad.damage*(a)/100; } //Adds an absolute value to damage. 100 = +100 damage #define MATK_ADD( a ) { ad.damage+= a; }    
  7. Shakto's post in Novice on Poring with Accessory was marked as the answer   
    Reins Of Mount    Item ID# 12622 ??
  8. Shakto's post in Viewing Console was marked as the answer   
    ./athena-start start >> athena.txt 2>&1 &  
    And look at your athena.txt to see what happend
  9. Shakto's post in refiner Quest was marked as the answer   
    // Rough / Ori/Elu to Enriched Refiners
    //============================================================
    - script Refiner_Quest#ref -1,{
    mes "[Refiner Quest]";
    mes "If you bring me 50";
    mes "Rough Oridecon or 50 Rough Elunium";
    mes "or 10 Elunium or 10 Oridecon";
    mes "I can exchange them for";
    mes "Enriched Elunium or Enriched Oridecon.";
    next;
    switch(select("Rough Oridecon to Enriched Oridecon.:Oridecon to Enriched Oridecon.:Rough Elunium to Enriched Elunium.:Elunium to Enriched Elunium.:No thanks.")) {
    case 1:
    setarray .@i[0],756,50,7620; //Rough Oridecon -> Enriched Oridecon
    break;
    case 2:
    setarray .@i[0],984,10,7620; //Oridecon -> Enriched Oridecon
    break;
    case 3:
    setarray .@i[0],757,50,7619; //Rough Elunium -> Enriched Elunium
    break;
    case 4:
    setarray .@i[0],985,10,7619; //Elunium -> Enriched Elunium
    break;
    case 5:
    mes "[Refiner Quest]";
    mes "Hmm...";
    close;
    }
    if (countitem(.@i[0]) >= .@i[1]) {
    delitem .@i[0],.@i[1];
    getitem .@i[2],1;
    mes "[Refiner Quest]";
    mes "Ok! Here is your "+getitemname(.@i[2])+".";
    mes "Take it and use it well.";
    close;
    }
    mes "[Refiner Quest]";
    mes "You better not be trying";
    mes "to cheat me because you";
    mes "don't have";
    mes ""+getitemname(.@i[0])+".";
    close;
    }
    prt_in,85,71,5    duplicate(Refiner_Quest#ref)    Refiner Quest#prt    826

×
×
  • Create New...