Jump to content

Eross

Members
  • Posts

    377
  • Joined

  • Last visited

Everything posted by Eross

  1. Thankyou senpai ! Hi ! I would like to ask for this script (Badly needed) ... I found an old source but obviously didnt work .. atleast a revision for this old codes .. Thankyou Godbless ..Longlive rA Index: atcommand.c =================================================================== --- atcommand.c (revision 16082) +++ atcommand.c (working copy) @@ -8473,6 +8473,69 @@ return 0; } +/*========================================== +* @whobuy - List who is buying the item (amount, price, and location). +* remake by VoidLess, original by zephyrus_cr +* re-edit by deathscythe to work in rAthena +*------------------------------------------*/ +ACMD_FUNC(whobuy) +{ + char item_name[100]; + int item_id, j, count = 0, sat_num = 0; + bool flag = 0; // place dot on the minimap? + struct map_session_data* pl_sd; + struct s_mapiterator* iter; + unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0; + struct item_data *item_data; + + nullpo_retr(-1, sd); + memset(item_name, '\0', sizeof(item_name)); + + if (!message || !*message || sscanf(message, "%99[^\n]", item_name) < 1) { + clif_displaymessage(fd, "Input item name or ID (use: @whobuy <name or ID>)."); + return -1; + } + if ((item_data = itemdb_searchname(item_name)) == NULL && + (item_data = itemdb_exists(atoi(item_name))) == NULL) + { + clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + return -1; + } + + item_id = item_data->nameid; + + iter = mapit_getallusers(); + for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) + { + if( pl_sd->buyer_id ) //check if player is autobuying + { + for (j = 0; j < pl_sd->buyingstore.slots; j++) { + if(pl_sd->buyingstore.items[j].nameid == item_id) { + snprintf(atcmd_output, CHAT_SIZE_MAX, "Price %d | Amount %d | Buyer %s | Map %s[%d,%d]",pl_sd->buyingstore.items[j].price,pl_sd->buyingstore.items[j].amount,pl_sd->status.name,mapindex_id2name(pl_sd->mapindex),pl_sd->bl.x, pl_sd->bl.y); + if(pl_sd->buyingstore.items[j].price < MinPrice) MinPrice = pl_sd->buyingstore.items[j].price; + if(pl_sd->buyingstore.items[j].price > MaxPrice) MaxPrice = pl_sd->buyingstore.items[j].price; + clif_displaymessage(fd, atcmd_output); + count++; + flag = 1; + } + } + if(flag && pl_sd->mapindex == sd->mapindex){ + clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF); + flag = 0; + } + } + } + mapit_free(iter); + + if(count > 0) { + snprintf(atcmd_output,CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz", count, MinPrice, MaxPrice); + clif_displaymessage(fd, atcmd_output); + } else + clif_displaymessage(fd, "Nobody buying it now."); + + return 0; +} + /** * Fills the reference of available commands in atcommand DBMap **/ @@ -8717,6 +8780,7 @@ ACMD_DEF(charcommands), ACMD_DEF(font), ACMD_DEF(accinfo), + ACMD_DEF(whobuy), /** * For Testing Purposes, not going to be here after we're done. **/ Output should be like this ~~ same as whosell output diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index cab676cce..b7456cda7 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -8395,6 +8395,152 @@ ACMD_FUNC(mapflag) { return 0; } +/*========================================== +* @whosell - List who is vending the item (amount, price, and location). +* ported to work in latest rA [Cookie] +*------------------------------------------*/ +ACMD_FUNC(whosell) +{ + 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; + bool flag = 0; // place dot on the minimap? + struct map_session_data* pl_sd; + struct s_mapiterator* iter; + unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0; + struct item_data *item_data; + nullpo_retr(-1, sd); + + + if (!message || !*message) { + clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <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; + if ((item_data = itemdb_searchname(item_name)) == NULL){ + clif_displaymessage(fd, "Not found item with this name"); + return -1; + } + item_id = item_data->nameid; + } + else { + clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>"); + return -1; + } + + //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(item_data->type == IT_ARMOR) + snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d] | Price %d | Amount %d | Map %s (%d,%d) | Seller %s",pl_sd->cart.u.items_cart[pl_sd->vending[j].index].refine + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] + ,pl_sd->vending[j].value + ,pl_sd->vending[j].amount + ,mapindex_id2name(pl_sd->mapindex) + ,pl_sd->bl.x,pl_sd->bl.y + ,pl_sd->status.name); + else if(item_data->type == IT_WEAPON) + snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d,%d,%d,%d] | Price %d | Amount %d | Map %s (%d,%d) | Seller %s",pl_sd->cart.u.items_cart[pl_sd->vending[j].index].refine + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[1] + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[2] + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[3] + ,pl_sd->vending[j].value + ,pl_sd->vending[j].amount + ,mapindex_id2name(pl_sd->mapindex) + ,pl_sd->bl.x,pl_sd->bl.y + ,pl_sd->status.name); + else + snprintf(atcmd_output, CHAT_SIZE_MAX, "ID %d | Price %d | Amount %d | Map %s (%d,%d) | Seller %s",pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid + ,pl_sd->vending[j].value + ,pl_sd->vending[j].amount + ,mapindex_id2name(pl_sd->mapindex) + ,pl_sd->bl.x, pl_sd->bl.y + ,pl_sd->status.name); + if(pl_sd->vending[j].value < MinPrice) MinPrice = pl_sd->vending[j].value; + if(pl_sd->vending[j].value > MaxPrice) MaxPrice = pl_sd->vending[j].value; + clif_displaymessage(fd, atcmd_output); + count++; + flag = 1; + } + if (flag && pl_sd->mapindex == sd->mapindex) { + //if (flag && pl_sd->bl.m == sd->bl.m) { + clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF); + flag = 0; + } + } + } + mapit_free(iter); + if(count > 0) { + snprintf(atcmd_output, CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz.", count, MinPrice, MaxPrice); + clif_displaymessage(fd, atcmd_output); + } else + clif_displaymessage(fd, "Nobody is selling it now."); + return 0; +} + /*=================================== * Remove some messages *-----------------------------------*/ @@ -10593,6 +10739,7 @@ void atcommand_basecommands(void) { ACMD_DEFR(channel,ATCMD_NOSCRIPT), ACMD_DEF(fontcolor), ACMD_DEF(langtype), + ACMD_DEF(whosell), #ifdef VIP_ENABLE ACMD_DEF(vip), ACMD_DEF(showrate),
  2. Hehe just wanna make players exert effort finding by coordinates... (evil laugh)
  3. Hi ! I need to show base attack and total attack (+ weapon attack) but it seems not possible ... Can you help me because I added readparam2 script for total STATS .. how to show the total attack magic hit etc with item ??? thanks
  4. ~> Like the title guys , does anyone have this code for latest rathena ??? Thanks !
  5. Good day! I would like to ask for help ... Im using @Emistry's Adv. Stylist ... I would like to ask for help to make the required Item [MULTIPLE] ... Like example for hair dye will ask for 3 different item requiremets (ex. 2 cobalt dye, 2 scarlet dye and 2 lemon dye)... Thankyou /* npc/other/Global_Functions.txt#L589 function script F_InsertComma { set .@str$, getarg(0); for (set .@i,getstrlen(.@str$)-3; .@i>0; set .@i,.@i-3) set .@str$, insertchar(.@str$,",",.@i); return .@str$; } */ - script Stylist -1,{ OnTalk: if (.ignore_secure_npctimeout) ignoretimeout 1; mes "[^0055FF ::: Adv. Stylist ::: ^000000]"; mes "I can change your appearance."; if (.cost_size){ mes " "; mes "^777777[ SERVICES PAYMENT ]^000000"; for(.@i = 0; .@i < .menu_size; .@i++) if (.npc_mode & (1 << .@i)) if (.cost[.@i]) mes "^0055FF"+.menu_name$[.@i]+" : ^777777"+F_InsertComma(.cost[.@i])+" "+.currency_name$[.@i]+"^000000"; else mes "^0055FF"+.menu_name$[.@i]+" : ^777777Free of Charge^000000"; } next; @style = (select(.npc_menu$) - 1); @style_value = getlook(.look_type[@style]); deletearray .@blacklist; switch(@style){ case 0: .@blacklist$ = ","+getd(".blacklist_hairstyle_"+Sex+"$")+","; break; case 1: .@blacklist$ = ","+getd(".blacklist_haircolor_"+Sex+"$")+","; break; case 2: .@blacklist$ = ","+getd(".blacklist_cloth_"+Sex+"$")+","; break; default: break; } .@style_number = .min_style[@style]; addtimer 1000,strnpcinfo(0)+"::OnPCLogoutEvent"; do{ message strcharinfo(0),"Current "+.menu_name$[@style]+" Style : #"+.@style_number; .@removed = 0; if (compare(.@blacklist$,","+.@style_number+",")){ message strcharinfo(0),"[ REMOVED ] "+.menu_name$[@style]+" : "+.@style_number+"th"; .@removed = 1; } else { setlook .look_type[@style],.@style_number; } .@next = .@style_number + 1; .@prev = .@style_number - 1; if (.@next > .max_style[@style]) .@next = .min_style[@style]; if (.@prev < .min_style[@style]) .@prev = .max_style[@style]; @select = prompt( ((.@backward)?"Backward":"Forward")+" - [ ^777777"+((.@backward)? .@prev:.@next)+"th "+.menu_name$[@style]+"^000000 ]", ((!.@backward)?"Backward":"Forward")+" - [ ^777777"+((!.@backward)? .@prev:.@next)+"th "+.menu_name$[@style]+"^000000 ]", "Random "+.menu_name$[@style], "Pick a "+.menu_name$[@style], (.@removed)?"":"^0055FFOkay, I want this "+.menu_name$[@style]+"^000000"); if (@select == 2) .@backward = !.@backward; switch(@select){ case 1: case 2: .@style_number = ((.@backward)? .@prev:.@next); break; case 3: .@style_number = rand(.min_style[@style], .max_style[@style]); break; case 4: message strcharinfo(0),"Available "+.menu_name$[@style]+" : "+.min_style[@style]+" ~ "+.max_style[@style]+"."; input .@style_number,.min_style[@style],.max_style[@style]; break; case 5: .@atoi_currency = atoi(.currency$[@style]); if (@style_value == .@style_number){ message strcharinfo(0),"But that is your current "+.menu_name$[@style]+"."; break; } else if (.@atoi_currency){ if (countitem(.@atoi_currency) >= .cost[@style]){ .@success = 1; delitem .@atoi_currency,.cost[@style]; } } else { if (getd(""+.currency$[@style]) >= .cost[@style]){ .@success = 1; setd(""+.currency$[@style]),(getd(""+.currency$[@style]) - .cost[@style]); } } if (.@success){ message strcharinfo(0),"Enjoy your brand new "+.menu_name$[@style]+" !!"; @style_value = .@style_number; } else { mes "You dont have enough "+.currency_name$[@style]+" to change this "+.menu_name$[@style]+"."; mes "Cost : ^777777"+F_InsertComma(.cost[@style])+" "+.currency_name$[@style]+"^000000"; close2; } default: setlook .look_type[@style],@style_value; break; } } while (@select != 5 && @select != 255); mes "Come back again next time. ^^"; @select = 0; if (.ignore_secure_npctimeout) ignoretimeout 0; close2; deltimer strnpcinfo(0)+"::OnPCLogoutEvent"; OnPCLogoutEvent: if (@select) setlook .look_type[@style],@style_value; end; OnInit: // NPC Mode (Bitmask) // 1 - Enable Hairstyle // 2 - Enable Hair Color // 4 - Enable Cloth Color .npc_mode = 7; // ignore SECURE_NPCTIMEOUT .ignore_secure_npctimeout = 1; // Menu Name setarray .menu_name$, "Hair Style", "Hair Color", "Cloth Color"; // Payment Currency + Cost // Can be ITEM ID or Any Variable. setarray .currency$, "Zeny", // Hairstyle - Ex. need Zeny "Zeny", // Hair Color - Ex. need Zeny "Zeny"; // Cloth Color - Ex. need Zeny setarray .cost, 100000, // Hairstyle (10,000 Zeny) 30000, // Hair Color (10,000 Zeny) 70000; // Cloth Color (10,000 Zeny) // Blacklisted Style for each style and each gender. // --- Female --- .blacklist_hairstyle_0$ = "2,4,6"; .blacklist_haircolor_0$ = "1,3,5"; .blacklist_cloth_0$ = "1,2,3"; // --- Male --- .blacklist_hairstyle_1$ = "3,5,7"; .blacklist_haircolor_1$ = "2,4,6"; .blacklist_cloth_1$ = "4,5,6"; // Dont edit setarray .min_style,getbattleflag("min_hair_style"),getbattleflag("min_hair_color"),getbattleflag("min_cloth_color"); setarray .max_style,getbattleflag("max_hair_style"),getbattleflag("max_hair_color"),getbattleflag("max_cloth_color"); .menu_size = getarraysize(.menu_name$); .cost_size = getarraysize(.cost); setarray .look_type,LOOK_HAIR,LOOK_HAIR_COLOR,LOOK_CLOTHES_COLOR; for(.npc_menu$ = ""; .@i < .menu_size; .@i++) .npc_menu$ = .npc_menu$ + ((.npc_mode & (1 << .@i))? .menu_name$[.@i]:"") +":"; for(.@i = 0; .@i < .cost_size; .@i++){ .@atoi = atoi(.currency$[.@i]); .currency_name$[.@i] = ((!.@atoi || getitemname(.@atoi) == "null")? .currency$[.@i]:getitemname(.@atoi)); } end; } // NPC Lists prontera,80,91,7 script Adv. Stylist#main 878,{ doevent "Stylist::OnTalk"; } //prontera,115,181,5 duplicate(Adv. Stylist#main) Adv. Stylist#1 878 //prontera,115,181,5 duplicate(Adv. Stylist#main) Adv. Stylist#2 878 //prontera,115,181,5 duplicate(Adv. Stylist#main) Adv. Stylist#3 878
  6. Sorry my bad sir ... I was actually pasted it wrong lol ... I managed to fixed it earlier by addig INSERT lines ,Thankyou
  7. I badly need help with this one guys ... Okay I modified Redeem NPC on flux files a little so I can convert the Credit Points into PODS ... The problem is , If the player/account is a newly created one and tried to exchange pods into credit, the pod will deleted but there will be no additional credits on database .. Can you check if ive done something wrong ?? thankyou !
  8. Hi ! great work sir @Neo-Mind but when I tried this on 20130807 ,my client is crashing when I input wrong password in login screen
  9. Hi ! I need help with this script by @Akkarin ... On how to add command @NOKS ..where It will ask the target of the command if it is [SELF/PARTY/GUILD] .. Thankyou so much ! //===== rAthena Script ======================================= //= OnPCLogin NPC //===== By: ================================================== //= Akkarin //===== Current Version: ===================================== //= 2.0 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= This NPC saves your settings so the next time you login, it //= will auto perform the commands you selected. Easy to edit //= or duplicate/modify based on cmds you want to allow. //===== Additional Comments: ================================= //= 1.0 First Version. //= 2.0 Complete rewrite to make use of binary values and // switch(select()) instead of menu(); //============================================================ //prontera,147,175,5 script Settings 61,{ - script save_cmd -1,{ OnInit: bindatcmd("savecmd","save_cmd::OnCommand"); OnCommand: UserMenu: set .@reset$,"^000000"; set .@disabled$,"^BE1C1C"; set .@enabled$,"^0DB40D"; mes "[^484848Settings^000000]"; mes "Note: These are all account based, not per-character."; mes "Note 2: You must relog for them to take effect."; if (#pcloginflag&1) { set .@st_autoloot$,.@enabled$+#pcloginalp+"%"+.@reset$; } else { set .@st_autoloot$,.@disabled$+"Off"+.@reset$; } if (#pcloginflag&2) { set .@st_showdelay$,.@enabled$+"On"+.@reset$; } else { set .@st_showdelay$,.@disabled$+"Off"+.@reset$; } if (#pcloginflag&4) { set .@st_rates$,.@enabled$+"On"+.@reset$; } else { set .@st_rates$,.@disabled$+"Off"+.@reset$; } if (#pcloginflag&8) { set .@st_showexp$,.@enabled$+"On"+.@reset$; } else { set .@st_showexp$,.@disabled$+"Off"+.@reset$; } if (#pcloginflag&16) { set .@st_showzeny$,.@enabled$+"On"+.@reset$; } else { set .@st_showzeny$,.@disabled$+"Off"+.@reset$; } if (#pcloginflag&32) { set .@st_uptime$,.@enabled$+"On"+.@reset$; } else { set .@st_uptime$,.@disabled$+"Off"+.@reset$; } next; switch(select("Auto Loot ["+.@st_autoloot$+"]:Show Delay ["+.@st_showdelay$+"]:Rates on login ["+.@st_rates$+"]:Show Exp ["+.@st_showexp$+"]:Show Zeny ["+.@st_showzeny$+"]:Uptime on login ["+.@st_uptime$+"]")){ case 1: mes "[^484848Settings^000000]"; mes "Auto Loot is currently "+.@st_autoloot$; mes "Desc: Auto loot adds items to your inventory automatically."; next; switch(select("Toggle:Back")){ case 1: if (#pcloginflag&1) { set #pcloginflag, #pcloginflag &~ 1; } else { mes "[^484848Settings^000000]"; mes "Auto Loot is currently "+.@st_autoloot$; mes "Enter the minimum rate an item must drop at before it it looted, 100 will loot all items, 99 will only loot cards, 0 disables it."; next; input .@rate; if ((.@rate >= 0) && (.@rate <= 100)) set #pcloginalp,.@rate; set #pcloginflag, #pcloginflag | 1; } break; case 2: break; } break; case 2: mes "[^484848Settings^000000]"; mes "Show Delay is currently "+.@st_showdelay$; mes "Desc: When a skill fails because of delay, it will be hidden."; next; switch(select("Toggle:Back")){ case 1: if (#pcloginflag&2) { set #pcloginflag, #pcloginflag &~ 2; } else { set #pcloginflag, #pcloginflag | 2; } break; case 2: break; } break; case 3: mes "[^484848Settings^000000]"; mes "Rates on login is currently "+.@st_rates$; mes "Desc: Displays the current server rates on login."; next; switch(select("Toggle:Back")){ case 1: if (#pcloginflag&4) { set #pcloginflag, #pcloginflag &~ 4; } else { set #pcloginflag, #pcloginflag | 4; } break; case 2: break; } break; case 4: mes "[^484848Settings^000000]"; mes "Show Exp is currently "+.@st_showexp$; mes "Desc: When you gain exp, it will be displaied."; next; switch(select("Toggle:Back")){ case 1: if (#pcloginflag&8) { set #pcloginflag, #pcloginflag &~ 8; } else { set #pcloginflag, #pcloginflag | 8; } break; case 2: break; } break; case 5: mes "[^484848Settings^000000]"; mes "Show Zeny is currently "+.@st_showzeny$; mes "Desc: When you gain zeny, it will be displaied."; next; switch(select("Toggle:Back")){ case 1: if (#pcloginflag&16) { set #pcloginflag, #pcloginflag &~ 16; } else { set #pcloginflag, #pcloginflag | 16; } break; case 2: break; } break; case 6: mes "[^484848Settings^000000]"; mes "Uptime on login is currently "+.@st_uptime$; mes "Desc: When you log in, server uptime will be displaied."; next; switch(select("Toggle:Back")){ case 1: if (#pcloginflag&32) { set #pcloginflag, #pcloginflag &~ 32; } else { set #pcloginflag, #pcloginflag | 32; } break; case 2: break; } break; } goto UserMenu; OnPCLoginEvent: sleep2 1000; if (#pcloginflag&1) atcommand "@autoloot " + #pcloginalp; if (#pcloginflag&2) atcommand "@showdelay"; if (#pcloginflag&4) atcommand "@rates"; if (#pcloginflag&8) atcommand "@showexp"; if (#pcloginflag&16) atcommand "@showzeny"; if (#pcloginflag&32) atcommand "@uptime"; end; }
  10. Thankyou for you effort sir @Skorm .. I tried this but I think the .maps_to$[0] is not working ? only the .maps_from$[0] maps are working where it restricts me to use warp when im on the listed maps ..but the one that restricts me to go to the listed map is not working ... if(inarray(.maps_from$[0], strcharinfo(3))>-1) { message strcharinfo(0), "You can't open use warp here!"; end; } else if (inarray(.maps_to$[0], strcharinfo(3))>-1) { message strcharinfo(0), "You can't warp to that map!"; end; } I think they have same equation sir ?
  11. Good day! I would like to ask for a script that will restrict my gm staffs to @warp in mvp maps (block this command if they use it to warp on maps with mvp monsters) and also to block @recall when they load on map that has MVP (just to be sure.) .. The recall script will bind when they are on a certain map and unbind when they warp on a map that is not on the list ... Thankyou so much
  12. Hi! Like what the title says , I want to ask and Im very curious if is it possible to 'trigger' the floating rates using that script ?? mr. @Tokei helped me on my old script wherein players are required to donate zeny on floating rates npc and when they reached the maximum required donates the NPC will activate for 24hours and continue on changing rates every hour while event is active ... but the problem on that script was, the timer for changing the rate is using OnMinute00 .. So, If I activate the Event on 02:30pm, instead of having a 24hour countdown it will only give me 23hours and 30minutes because the first 30minutes have already passed ... Now, Im thinking of using gettimetick command to change the rates every time the timer losses 1hour or 60minutes .. Timer will trigger after I give what the NPC is askin like; '$fr_delay = gettimetick(2) + (.fr_delay * 3600);' set .fr_delay,24; then every hour that will pass will change the rates I hope you understand my question ..I have a very bad english tho ... Hope someone notice my question and if possible please help me construct the whole script coz im not good at it thankyou btw! heres line to the script given by sir @Tokei .. all credits to this kind dev
  13. Hi ! Is it possible to add commands/conditions before you can open these features ??? Also on Modifying Homunculus and Pet names .. like asking for zeny payment ..On bank, It should ask you to open account first ? thanks How to edit codes inside this button ?? Lets say I need zeny to open this one or a condition like requires level 40 and up ?? Please help ... Thanks Hi ! How to make a condition in SRC code like if (!#banking) mes "You need to open an account to use banking feature"; or if (#banking != 1) etc ... void clif_parse_BankOpen(int fd, struct map_session_data* sd) { //TODO check if preventing trade or stuff like that //also mark something in case char ain't available for saving, should we check now ? nullpo_retv(sd); if( !battle_config.feature_banking ) { clif_messagecolor(&sd->bl,color_table[COLOR_RED],msg_txt(sd,1496),false,SELF); //Banking is disabled return; } if (pc_readaccountreg(sd, add_str("#account_var")) != 1 ) { //clif_messagecolor(&sd->bl,color_table[COLOR_RED],msg_txt(sd,1496),false,SELF); //Banking is disabled clif_displaymessage(fd, "You need to open an account first."); return; } else { struct s_packet_db* info = &packet_db[RFIFOW(fd,0)]; int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ? if(sd->status.account_id == aid){ sd->state.banking = 1; //request save ? //chrif_bankdata_request(sd->status.account_id, sd->status.char_id); //on succes open bank ? clif_bank_open(sd); } } } Im trying to add this part but im not sure if im doing it right if (pc_readaccountreg(sd, add_str("#account_var")) != 1 ) { //clif_messagecolor(&sd->bl,color_table[COLOR_RED],msg_txt(sd,1496),false,SELF); //Banking is disabled clif_displaymessage(fd, "You need to open an account first."); return; } please help thanks Does anyone know how to add a condition to open the bank vault in CTRL+B or ALT +V button ? Like for example check if my character or account variable is set to #Baking == 1 ?????? I Will appreciate your help thankyou !!
  14. Hi ! Im trying to make a paid rename npc for homun and pet but its not working on my sql script query_sql "UPDATE `pet` SET `name` = '"+escape_sql(.@petnewname$)+"' WHERE `name` = '"+getpetinfo(2)+"'"; query_sql "UPDATE `homunculus` SET `name` = '"+escape_sql(.@name$)+"' WHERE `name` = '"+strcharinfo(0)+"'"; Its updating on my database but once I relog it will change back to old name ,... thanks
  15. hi! its still not working ? yes sir its working when I type it as a command @channel leave #main ... but when I add it on npc as 'atcommand "@channel leave #main" ' its not working
  16. Hi! Is it just on me or is atcommand "@channel leave #main" not working ??? Please enlighten me
  17. Eross

    Renamer NPC

    Good day ! I need an NPC that lets player to choose on these options (RENAME CHARACTER, RENAME GUILD, RENAME PET and RENAME HOMUNCULUS) THANKS A LOT !! ^_^
  18. Thankyou for your response sir @Emistry but right before the response ive already did this script Works fine but I cannot move this line if (guildopenstorage()) { mes "[Kafra Employee]"; mes "I'm sorry but another guild member is using the guild storage"; mes "right now. Please wait until that person is finished."; return; } On upper part coz it will cause problem .. Thanks! Just one question sir ! what kafra uses this equation ? just to make sure that it wont make problem by adding this paid Guild storage ...
  19. I need to make a new function for GUILD STORAGE wherein it will check if you re a member of a guild and check zeny .. I tried doing this default: setarray .@K_Menu0$[0],"Save","Use Storage", "Use Teleport Service","Rent a Pushcart","Check Other Information","Cancel"; break; default: setarray .@K_Menu0$[0],"Save","Use Storage", "Use Guild Storage","Use Teleport Service","Rent a Pushcart","Check Other Information","Cancel"; break; The guild storage opens , yes , but doesnt look like opening normal storage that you need to hit CLOSE before the storage opens ... And also doesnt check for ZENY (I think this is for free service only) How will I add another function here and call it ? Like this ??? else if (.@K_Menu0$[.@j] == "Use Guild Storage (200 Zeny)") { callfunc "F_KafGuildStor",1,0; next; } and create this ? function script F_KafGuildStor { <CONTENT HERE> } Everytime I do it the npc stuck ... I'm trying to edit it from FUNCTION KAFRA.txt coz I want all my kafra to have this paid GUILD STORAGE service Thanks in advance
  20. Hi ! Im using old client now .. I just want to ask if is it possible to manipulate the bank button on my alt +V ? like you need to talk to NPC first to open account before using that feature ... and also add password on it ? Thanks a loot .. I dont know where section to post it im really sorry
  21. Ohh Thats why .. I get it sir ... So, the extra minute came from the difference between the trigger time and the 00 of the next hour right ?? ... Hmmm .. How about after reaching the goal , There will be an announcement that "THE FLOATING RATES EVENT WILL START IN THE NEXT 00 OF NEXT HOUR" ? I apologize for asking too much ,but ... How to add cooldown after the event ends sir ?? Like if the timer reached zero , The NPC will be disabled for the next 6days .. and announce when players can donate again ? Im so noob on this .. Thankyou for assisting me sir @Tokei Edited: Sir as ive observed, everytime I reload script the rates are changing ... Okay my bad sir .. I managed to fix the OnInit: by adding this line if ($floating_rates_hours_left > 0) { end; }
  22. Goodmorning (*PH time) .. Yes2 exactly sir ! I need the script continously running for 24hours without any interruptions ,,, Thanks I will try this one sir ! Godbless Hi ! I noticed that the npc has ended the event without event starting it yet .. I will observe it for the next 24hours ... And also the timer left shows like this sir I think this is because you added extra hour?? ... // Up to you whether you want to add an extra hour or not, as otherwise the event will be below 24 hours. I supposed this will show 23hours and 00:55:59 if I set it to '$floating_rates_hours_left = 24;' right ?? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Oppps ! I tried to make it 24hours and the timer shows like this .. Why is it only 30minutes sir ? ~~~ And also sir, How to add restriction/cooldown on time .. Like, After the event ends .. The player will able to donate again after 6days ?
  23. Hi! I just need a small help here guys .. I need some answers for me to finish my npc script ... I have a Donation base Floating Rates npc .. Wherein the players will donate zeny until they reach the target amount .. Like for example the Server need to donate 5,000,000z ... After they reach target donate amount these are how It should work : 1. The NPC will Enable the script of "OnMinute00" (Which we all know that'll change rate every hour) ..So while the event is active there will be changes every hour.. 2. The said NPC will enable that script immidiately right after they reached 5m donation for only 24hours .. So, whether its Minute00 or not it should start right away.. (Ex. They reach 5m in 10:55pm, It will start right away but will change rates on 11:00pm and 12:00am so on....) 3. The players are able to check the remaining time of the Floating Rate Event ..And there will be an announcement If theres only hour left or minutes 4. After the timer ends , whether the last hour of event is done or not the server rate should return to its normal rate. I have here a sample of script by @lupus ... I'm trying to modify it a little but im not good in adding timer .. Please help I really need to finish this one ... Or you can suggest or lecture me on my mistakes here ... Heres the script from rathena folder : //===== rAthena Script ======================================= //= Floating Server Rates //===== By: ================================================== //= Lupus //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= It's a simply example of setbattleflag //= This script will change your server rates from 1x to 1.5x every 6 hours //= Note: It doesn't affect Card granted drops, MVP & Treasure Chests drops ^_- //= It also doesn't affect CARD drops, because they are just 0.01% //===== Additional Comments: ================================= //= You can make incredible scripts with 'setbattleflag'! //============================================================ //- script FloatingRates -1,{ prontera,123,209,6 script Broker#FloatingRates 84,{ OnInit: set .@fr_targetdonation, 5000; mes "[Broker]"; mes "Our server's current fund is:"; mes "" + callfunc("F_InsertComma",$fr_zeny) + " Zeny"; next; mes "[Broker]"; mes "Would you like to make a donation?"; next; switch(select("Yes:No")) { case 1: Change_Amount: mes "[Broker]"; mes "Please input your donation amount."; next; input .@fr_zeny; if (.@fr_zeny < 1){ mes "[Broker]"; mes "Input number greater than 0."; end; } mes "[Broker]"; mes "Please confirm Zeny transfer.."; next; switch(select("Cancel:Change Amount:Confirm")) { case 1: end; case 2: set .@fr_zeny,0; next; goto Change_Amount; end; case 3: if (Zeny < .@fr_zeny) { mes "[Broker]"; mes "Sorry, but you don't have enough"; mes "zeny to proceed on payment."; end; } mes "[Broker]"; mes "Zeny has succesfully transfered."; $fr_zeny += .@fr_zeny; if ($fr_zeny >= .@fr_targetdonation) { set $fr_zeny,0; } Zeny -= .@fr_zeny; end; } case 2: } OnMinute00: set $@brate,rand(500,800); set $@jrate,rand(500,599); //set $@drate,rand(100,150); //Base exp setbattleflag("base_exp_rate",$@brate); //Job exp setbattleflag("job_exp_rate",$@jrate); set $@brateminus, ($@brate/100) * 100; set $@jrateminus, ($@jrate/100) * 100; announce "Current rates are: "+($@brate/100)+"."+($@brate-$@brateminus)+"x "+($@jrate/100)+"."+($@jrate-$@jrateminus)+"x ",bc_all,0xFF6060; end; }
  24. Good day ^_^ ! Today , Im trying to make an NPC that work just like the normal floating rates .. The only modification is it will require certain amount of donation to function ... * Players will donate zeny by inputing the amount * While, the NPC has a target amount of donation like 5,000,000z * if ($serverdonation >= 5000000) ~> The NPC Will announce that the floating rate will be activated for 24hours (Changing rates every OnMinute0000 ) * And also it has to have a timer that will end after 24hours Now the thing is .. I dont know how to trigger It every hour while the event is active ... I can only trigger it ONCE by donating 5m Zeny Here's my unfinished edit :
×
×
  • Create New...