Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


astralprojection last won the day on June 21

astralprojection had the most liked content!


About astralprojection

  • Rank
    Advanced Member

Recent Profile Visitors

4553 profile views
  1. it looks like multiple login server is running. 1. stop everything. ./athena-start stop 2. list running process to verify using ps -e find login-server, map-server, char-server if still exist in the process then kill the process. 3. run again the server.
  2. Refer to this https://github.com/HerculesWS/Hercules/blob/4991d6905ca999a74824181f1677429d2de409e3/doc/sample/npc_trader_sample.txt#L18
  3. IP's are recycled upon termination of machine rental or services. maybe previous user moved/migrated to new ip but there are clients is still trying to send packets to old ip. i dont know.
  4. it must be the database credentials try mysql -u root CREATE USER 's1'@'localhost' IDENTIFIED BY 'p1'; GRANT ALL ON `your_game_database`.* TO 's1'@'localhost'; GRANT ALL ON `your_log_database`.* TO 's1'@'localhost'; FLUSH PRIVILEGES;
  5. this happens when you try to login? or start the server?
  6. firewall-cmd --zone=public --permanent --add-port=6900/tcp firewall-cmd --zone=public --permanent --add-port=6121/tcp firewall-cmd --zone=public --permanent --add-port=5121/tcp firewall-cmd --reload try maybe firewall is preventing it.
  7. its pretty but still have problem somewhere those Admin Menu can't view properly using mobile view. thanks for sharing
  8. its broken, i don't know why dev don't correct the issue on the latest build. https://github.com/HerculesWS/Hercules/issues/2964 You can manually reverse this commit to fix that: https://github.com/HerculesWS/Hercules/pull/2942
  9. /* custom npc trader */ prontera,153,152,1 trader TestCustom2 4_F_EDEN_OFFICER,{ OnInit: tradertype(NST_CUSTOM); sellitem Red_Potion,2; end; /* allows currency to be item 501 and 502 */ OnCountFunds: setcurrency(countitem(Red_Potion),countitem(Orange_Potion)); end; /* receives @price (total cost) and @points (the secondary input field for cash windows) */ OnPayFunds: dispbottom "Hi: price="[email protected]+" and points="[email protected]; /* check if how many item is sold already if max but sorry, we reach max purchase of item end; else ok you can still buy */ if( countitem(Orange_Potion) < @points || countitem(Red_Potion) < @[email protected] ) end; delitem Orange_Potion,@points; delitem Red_Potion,@[email protected]; purchaseok(); end; } that is why i want to use that NTS_MARKET instead, no confusion.
  10. i understand master , it the official setup. but what i was trying to customize or achieve here that "qty limit" of item sold. It can't be done using NST_CUSTOM i believe. Correct me if im wrong.
  11. yes master but i wanted to use that LIMITED QTY feature but uses #CASHPOINTS instead of Zeny i tried already /** * Processes incoming npc market purchase list **/ static enum market_buy_result npc_market_buylist(struct map_session_data *sd, struct itemlist *item_list) { struct npc_data* nd; struct npc_item_list *shop = NULL; int64 z; int i,j,w,new_; unsigned short shop_size = 0; nullpo_retr(1, sd); nullpo_retr(1, item_list); nd = npc->checknear(sd,map->id2bl(sd->npc_shopid)); if (nd == NULL || nd->subtype != SCRIPT || VECTOR_LENGTH(*item_list) == 0 || !nd->u.scr.shop || nd->u.scr.shop->type != NST_MARKET) return MARKET_BUY_RESULT_ERROR; shop = nd->u.scr.shop->item; shop_size = nd->u.scr.shop->items; z = 0; w = 0; new_ = 0; // process entries in buy list, one by one for (i = 0; i < VECTOR_LENGTH(*item_list); ++i) { int value; struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i); // find this entry in the shop's sell list ARR_FIND( 0, shop_size, j, entry->id == shop[j].nameid || //Normal items entry->id == itemdb_viewid(shop[j].nameid) //item_avail replacement ); if (j == shop_size) /* TODO find official response for this */ return MARKET_BUY_RESULT_ERROR; // no such item in shop entry->id = shop[j].nameid; //item_avail replacement if (entry->amount > (int)shop[j].qty) return MARKET_BUY_RESULT_AMOUNT_TOO_BIG; value = shop[j].value; npc_market_qty[i] = j; if (!itemdb->exists(entry->id)) /* TODO find official response for this */ return MARKET_BUY_RESULT_ERROR; // item no longer in itemdb if (!itemdb->isstackable(entry->id) && entry->amount > 1) { //Exploit? You can't buy more than 1 of equipment types o.O ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n", sd->status.name, sd->status.account_id, sd->status.char_id, entry->amount, entry->id); entry->amount = 1; } switch (pc->checkadditem(sd, entry->id, entry->amount)) { case ADDITEM_EXIST: break; case ADDITEM_NEW: new_++; break; case ADDITEM_OVERAMOUNT: /* TODO find official response for this */ return 1; } z += (int64)value * entry->amount; w += itemdb_weight(entry->id) * entry->amount; } if (z > sd->cashPoints) /* TODO find official response for this */ return MARKET_BUY_RESULT_NO_ZENY; // Not enough Zeny if( w + sd->weight > sd->max_weight ) /* TODO find official response for this */ return MARKET_BUY_RESULT_OVER_WEIGHT; // Too heavy if( pc->inventoryblank(sd) < new_ ) /* TODO find official response for this */ return MARKET_BUY_RESULT_OUT_OF_SPACE; // Not enough space to store items pc->paycash(sd,(int)z,0); for (i = 0; i < VECTOR_LENGTH(*item_list); ++i) { struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i); j = npc_market_qty[i]; if (entry->amount > (int)shop[j].qty) /* wohoo someone tampered with the packet. */ return MARKET_BUY_RESULT_AMOUNT_TOO_BIG; shop[j].qty -= entry->amount; npc->market_tosql(nd,j); if (itemdb_type(entry->id) == IT_PETEGG) { pet->create_egg(sd, entry->id); } else { struct item item_tmp; memset(&item_tmp,0,sizeof(item_tmp)); item_tmp.nameid = entry->id; item_tmp.identify = 1; pc->additem(sd, &item_tmp, entry->amount, LOG_TYPE_NPC); } } return MARKET_BUY_RESULT_SUCCESS; } if (z > sd->cashPoints) /* TODO find official response for this */ It's working ok by deducting CP. It still check zeny when you drag item to buy.
  12. Is there way to change currency from zeny > cash? Any help is greatly appreciated. Thank you all!
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.