Jump to content

mhielo12

Members
  • Posts

    109
  • Joined

  • Last visited

Everything posted by mhielo12

  1. i have tested the code and yes there is a glitch with other regular costume items. it seems it also remove all the effect for regular costume
  2. Updated for latest git. diff --git a/conf/battle/battle.conf b/conf/battle/battle.conf index 93fe9db..0e741ad 100644 --- a/conf/battle/battle.conf +++ b/conf/battle/battle.conf @@ -167,3 +167,6 @@ warg_can_falcon: no // Should the target be able of dodging damage by snapping away to the edge of the screen? // Official behavior is "no" snap_dodge: no + +// Reserved Char ID for costume converted items. +reserved_costume_id: 999998 diff --git a/npc/custom/etc/costume.txt b/npc/custom/etc/costume.txt new file mode 100644 index 0000000..bf3772c --- /dev/null +++ b/npc/custom/etc/costume.txt @@ -0,0 +1,135 @@ +// ------------------------------------------------------------------------------- +// Script Name : Headgear to Costume converter >> Costume to Headgear converter +// ------------------------------------------------------------------------------- +// Description : +// - Allows a user to convert the equipped headgear (on Top, Mid or Low) into a +// costume item. It will remove any card and refine of the Item. +// - Allows a user to restore the equipped costume headgear (on Top, Mid or Low) +// into its original form. It will not return any card or refine of the item. +// ------------------------------------------------------------------------------- +function script costume { + [email protected]_name$ = getarg(0); + disable_items; + mes "["+ [email protected]_name$ +"]"; + mes "Here you can convert your headgears into a Costume Headgear or restore to its Original form."; + next; + + switch(select("I want to convert.:I want to restore.:No thanks.")) { + case 1: + setarray [email protected][1], EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW; + for ([email protected] = 1; [email protected]<=3; [email protected]) { + if (getequipisequiped([email protected][[email protected]])) { + [email protected]$ = [email protected]$ + F_getpositionname([email protected][[email protected]]) + "-[" + getequipname([email protected][[email protected]]) + "]"; + [email protected] = 1; + } + [email protected]$ = [email protected]$ + ":"; + } + + if ([email protected] == 0) { + mes "["+ [email protected]_name$ +"]"; + mes "You need to wear headgears that I can costume..."; + close; + } + + mes "["+ [email protected]_name$ +"]"; + mes "Please select what to convert."; + mes "Remember, cards and refine will be removed."; + next; + + [email protected] = [email protected][ select([email protected]$) ]; + if (!getequipisequiped([email protected])) { + mes "["+ [email protected]_name$ +"]"; + mes "You're not wearing anything there..."; + close; + } + + mes "["+ [email protected]_name$ +"]"; + mes "You want to Costume your " + getitemname(getequipid([email protected])) + "?"; + next; + + if (select("Yes, proceed:No, sorry.") == 2) { + mes "["+ [email protected]_name$ + "]"; + mes "Need some time to think about it, huh?"; + mes "Alright, I can understand."; + close; + } + + costume [email protected]; // Convert the Headgear + + mes "["+ [email protected]_name$ +"]"; + mes "Done, enjoy your costume headgear."; + close; + case 2: + setarray [email protected][1], EQI_COSTUME_HEAD_TOP, EQI_COSTUME_HEAD_MID, EQI_COSTUME_HEAD_LOW; + for ([email protected] = 1; [email protected]<=3; [email protected]) { + if (getequipisequiped([email protected][[email protected]])) { + [email protected]$ = [email protected]$ + F_getpositionname([email protected]$[[email protected]]) + "-[" + getequipname([email protected][[email protected]]) + "]"; + [email protected] = 1; + } + [email protected]$ = [email protected]$ + ":"; + } + + if ([email protected] == 0) { + mes "["+ [email protected]_name$ +"]"; + mes "You need to wear costumed headgears that I can restore..."; + close; + } + + mes "["+ [email protected]_name$ +"]"; + mes "Please select what to restore."; + mes "Remember, I will only restore it back without refine and cards."; + next; + + [email protected] = [email protected][ select([email protected]$) ]; + if (!getequipisequiped([email protected])) { + mes "["+ [email protected]_name$ +"]"; + mes "You're not wearing anything there..."; + close; + } + + if (isequippedcnt(getequipid([email protected])) > 1) { + mes "["+ [email protected]_name$ +"]"; + mes "You're wearing too many of the same headgear!"; + mes "How am I supposed to know which one to restore?"; + mes "See me when you have one equipped."; + close; + } + + if (countitem(getequipid([email protected])) > 1) { + mes "["+ [email protected]_name$ +"]"; + mes "You have another " + getitemname(getequipid([email protected])) + " with you."; + mes "Put it away before restoring."; + close; + } + + mes "[" + [email protected]_name$ + "]"; + mes "You want to restore your " + getitemname(getequipid([email protected])) + "?"; + next; + + if (select("Yes, proceed:No, sorry.") == 2) { + mes "["+ [email protected]_name$ +"]"; + mes "Need some time to think about it, huh?"; + mes "Alright, I can understand."; + close; + } + + // Restore headgear by recreating + a = getequipid([email protected]); + delitem a,1; + getitem a,1; + + mes "["+ [email protected]_name$ +"]"; + mes "Done, enjoy your restored headgear."; + close; + case 3: + mes "["+ [email protected]_name$ +"]"; + mes "Very well. Return at once if you seek my services."; + close; + } +} + +// --------------------------------------------------------------------------- +// Add more lines to put your npc on different cities (adjust name if desired) +// --------------------------------------------------------------------------- +prontera,144,230,6 script Costume Clown#1 715,{ callfunc "costume","Costume Clown",0; end; } + diff --git a/npc/scripts_custom.conf b/npc/scripts_custom.conf index 1adf1f3..d4e5706 100644 --- a/npc/scripts_custom.conf +++ b/npc/scripts_custom.conf @@ -115,6 +115,8 @@ npc: npc/custom/etc/quest_warper.txt // -- Custom quests from official Umbalian Quests //npc: npc/custom/quests/sphinx_mask.txt //npc: npc/custom/quests/umbalian_language.txt +// -- Costume NPC script (from rAthena) +npc: npc/custom/etc/costume.txt // --------------------- ChocobotRO Scripts -------------------- // -- Peak NPC script (from FluxCP) diff --git a/src/custom/atcommand_def.inc b/src/custom/atcommand_def.inc index 54d9e74..d9b8b2d 100644 --- a/src/custom/atcommand_def.inc +++ b/src/custom/atcommand_def.inc @@ -9,3 +9,6 @@ **/ //ACMD_DEF(newcommand), + +// @costumeitem <item> +ACMD_DEF2("costumeitem", item), diff --git a/src/custom/script.inc b/src/custom/script.inc index 839b990..776120e 100644 --- a/src/custom/script.inc +++ b/src/custom/script.inc @@ -17,3 +17,44 @@ // script_pushint(st,1); // return 0; //} + +/*========================================== + * Costume Items + *------------------------------------------*/ +BUILDIN_FUNC(costume) +{ + int i = -1, num, ep; + TBL_PC *sd; + item* item; + num = script_getnum(st, 2); // Equip Slot + if (!script_rid2sd(sd)) + return 0; + if (equip_index_check(num)) + i = pc_checkequip(sd, equip_bitmask[num]); + if (i < 0) + return 0; + item = &sd->inventory.u.items_inventory[i]; + ep = item->equip; + if (!(ep&EQP_HEAD_LOW) && !(ep&EQP_HEAD_MID) && !(ep&EQP_HEAD_TOP)) + return 0; + log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, item); + pc_unequipitem(sd, i, 2); + clif_delitem(sd, i, 1, 3); + // -------------------------------------------------------------------- + item->refine = 0; + item->attribute = 0; + item->card[0] = CARD0_CREATE; + item->card[1] = 0; + item->card[2] = GetWord(battle_config.reserved_costume_id, 0); + item->card[3] = GetWord(battle_config.reserved_costume_id, 1); + if (ep&EQP_HEAD_TOP) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; } + if (ep&EQP_HEAD_LOW) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; } + if (ep&EQP_HEAD_MID) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; } + // -------------------------------------------------------------------- + log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, item); + clif_additem(sd, i, 1, 0); + pc_equipitem(sd, i, ep); + clif_misceffect(&sd->bl, 3); + return 0; +} + diff --git a/src/custom/script_def.inc b/src/custom/script_def.inc index 8863992..917ffea 100644 --- a/src/custom/script_def.inc +++ b/src/custom/script_def.inc @@ -9,3 +9,6 @@ **/ //BUILDIN_DEF(example,""), + +// Costume System +BUILDIN_DEF(costume,"i"), diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 266f375..8e9f8af 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -1343,7 +1343,7 @@ static void warp_get_suggestions(struct map_session_data* sd, const char *name) ACMD_FUNC(item) { char item_name[100]; - int number = 0, bound = BOUND_NONE; + int number = 0, bound = BOUND_NONE, costume = 0; char flag = 0; struct item item_tmp; struct item_data *item_data[10]; @@ -1382,6 +1382,26 @@ static void warp_get_suggestions(struct map_session_data* sd, const char *name) clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name. return -1; } + + // Start costume conversion logic (1) + if(!strcmpi(command+1, "costumeitem")) { + if(!battle_config.reserved_costume_id) { + clif_displaymessage(fd, "Costume conversion is disabled. Set a value for reserved_costume_id in your battle.conf file."); + return -1; + } + if(!(item.get()->equip&EQP_HEAD_LOW) && + !(item.get()->equip&EQP_HEAD_MID) && + !(item.get()->equip&EQP_HEAD_TOP) && + !(item.get()->equip&EQP_COSTUME_HEAD_LOW) && + !(item.get()->equip&EQP_COSTUME_HEAD_MID) && + !(item.get()->equip&EQP_COSTUME_HEAD_TOP)) { + clif_displaymessage(fd, "You cannot costume this item. Costumes only work for headgears."); + return -1; + } + costume = 1; + + } + // End costume conversion logic (1) + itemlist = strtok(NULL, ":"); //next itemline j++; } @@ -1403,6 +1423,15 @@ static void warp_get_suggestions(struct map_session_data* sd, const char *name) item_tmp.nameid = item_id; item_tmp.identify = 1; item_tmp.bound = bound; + + // Start costume conversion logic (2) + if(costume == 1) { + item_tmp.card[0] = CARD0_CREATE; + item_tmp.card[2] = GetWord(battle_config.reserved_costume_id, 0); + item_tmp.card[3] = GetWord(battle_config.reserved_costume_id, 1); + } + // End costume conversion logic (2) + if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) clif_additem(sd, 0, 0, flag); } diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 684c833..88a691b 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -8635,6 +8635,7 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range { "item_enabled_npc", &battle_config.item_enabled_npc, 1, 0, 1, }, { "item_flooritem_check", &battle_config.item_onfloor, 1, 0, 1, }, { "bowling_bash_area", &battle_config.bowling_bash_area, 0, 0, 20, }, + { "reserved_costume_id", &battle_config.reserved_costume_id, 999998, 0, INT_MAX, }, { "drop_rateincrease", &battle_config.drop_rateincrease, 0, 0, 1, }, { "feature.auction", &battle_config.feature_auction, 0, 0, 2, }, { "feature.banking", &battle_config.feature_banking, 1, 0, 1, }, diff --git a/src/map/battle.hpp b/src/map/battle.hpp index c26efe3..58ffded 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -544,6 +544,7 @@ struct Battle_Config int item_enabled_npc; int item_onfloor; // Whether to drop an undroppable item on the map or destroy it if inventory is full. int bowling_bash_area; + int reserved_costume_id; // Costume System int drop_rateincrease; int feature_auction; int feature_banking; diff --git a/src/map/map.cpp b/src/map/map.cpp index 0aee3ce..1cb4df2 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -1950,6 +1950,14 @@ void map_reqnickdb(struct map_session_data * sd, int charid) nullpo_retv(sd); + // Start costume conversion logic (3) + if( battle_config.reserved_costume_id && battle_config.reserved_costume_id == charid ) + { + clif_solved_charname(sd->fd, charid, "Costume"); + return; + } + // End costume conversion logic (3) + tsd = map_charid2sd(charid); if( tsd ) { diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 658984b..2b2a8cf 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -870,7 +870,18 @@ int pc_equippoint_sub(struct map_session_data *sd,struct item_data* id){ int pc_equippoint(struct map_session_data *sd,int n){ nullpo_ret(sd); - return pc_equippoint_sub(sd,sd->inventory_data[n]); + // Start costume conversion logic (4) + int ep = pc_equippoint_sub(sd,sd->inventory_data[n]); + int char_id = 0; + if (battle_config.reserved_costume_id && + sd->inventory.u.items_inventory[n].card[0] == CARD0_CREATE && + (char_id = MakeDWord(sd->inventory.u.items_inventory[n].card[2],sd->inventory.u.items_inventory[n].card[3])) == battle_config.reserved_costume_id) { + if (ep&EQP_HEAD_TOP) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; } + if (ep&EQP_HEAD_LOW) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; } + if (ep&EQP_HEAD_MID) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; } + } + return ep; + // End costume conversion logic (4) } /** @@ -2582,7 +2593,7 @@ void pc_delautobonus(struct map_session_data* sd, std::vector<s_autobonus> &bonu unsigned int equip_pos_idx = 0; // Create a list of all equipped positions to see if all items needed for the autobonus are still present [Playtester] - for (uint8 j = 0; j < EQI_MAX; j++) { + for (uint8 j = 0; j < EQI_MAX_BONUS; j++) { if (sd->equip_index[j] >= 0) equip_pos_idx |= sd->inventory.u.items_inventory[sd->equip_index[j]].equip; } @@ -2627,7 +2638,7 @@ void pc_exeautobonus(struct map_session_data *sd, std::vector<s_autobonus> *bonu int j; unsigned int equip_pos_idx = 0; //Create a list of all equipped positions to see if all items needed for the autobonus are still present [Playtester] - for(j = 0; j < EQI_MAX; j++) { + for(j = 0; j < EQI_MAX_BONUS; j++) { if(sd->equip_index[j] >= 0) equip_pos_idx |= sd->inventory.u.items_inventory[sd->equip_index[j]].equip; } @@ -10126,7 +10137,7 @@ int pc_load_combo(struct map_session_data *sd) { *------------------------------------------*/ bool pc_equipitem(struct map_session_data *sd,short n,int req_pos,bool equipswitch) { - int i, pos, flag = 0, iflag; + int i, pos, flag = 0, iflag, char_id = 0; struct item_data *id; uint8 res = ITEM_EQUIP_ACK_OK; short* equip_index; diff --git a/src/map/pc.hpp b/src/map/pc.hpp index b52784b..23d1a85 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -84,7 +84,8 @@ enum equip_index { EQI_SHADOW_SHOES, EQI_SHADOW_ACC_R, EQI_SHADOW_ACC_L, - EQI_MAX + EQI_MAX, + EQI_MAX_BONUS = 10 }; enum prevent_logout_trigger { diff --git a/src/map/status.cpp b/src/map/status.cpp index 09317fd..bd3699b 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -3805,7 +3805,7 @@ int status_calc_pc_sub(struct map_session_data* sd, enum e_status_calc_opt opt) running_npc_stat_calc_event = false; // Parse equipment - for (i = 0; i < EQI_MAX; i++) { + for (i = 0; i < EQI_MAX_BONUS; i++) { current_equip_item_index = index = sd->equip_index[i]; // We pass INDEX to current_equip_item_index - for EQUIP_SCRIPT (new cards solution) [Lupus] current_equip_combo_pos = 0; if (index < 0)
  3. this was missing on my rathena version #if PACKETVER_MAIN_NUM >= 20190227 || PACKETVER_RE_NUM >= 20190220 || PACKETVER_ZERO_NUM >= 20190220 parseable_packet( 0x0B1C, sizeof( struct PACKET_CZ_PING ), clif_parse_dull, 0 ); #endif how can i update my git version to enable this packets
  4. Received unsupported packet (packet 0x0b1c, 2 bytes received), disconnecting session #8 Im using a 2019 git version with 20200401 Client executable. I got this error: Received unsupported packet (packet 0x0b1c, 2 bytes received), disconnecting session #8 Npc's not showing up and after dc i got the warning message. Can someone help me?
  5. try this https://rathena.org/board/topic/95122-preview-npc/
  6. try to check your db/map_index.txt and conf/maps_athena.conf make sure all map names are the same with those two files.
  7. just create another hourly file that do not trigger when afk. like this - script hourlypoints -1,{ OnPointGet: //Check for idle. while(checkvending() >= 1) { if( [email protected]$ == "" ) { dispbottom set( [email protected]$, "The hourly points event stopped because you were vending" ); set @hourly_points_timer, 0; } sleep2 .delay; } @consecutive_timer++; [email protected]_string$ = Time2Str( @consecutive_timer * ( .timer / 1000 ) ); dispbottom "You received "+.points+" Hourly Point(s) by staying ingame for "[email protected]_string$+"."; #HOURLYPOINTS = #HOURLYPOINTS + .points; dispbottom "Current Balance = "+#HOURLYPOINTS+" Hourly Point(s)"; @consecutive_bonus++; //Check for consecutive timer. if(@consecutive_bonus == .cdelay) { @consecutive_bonus = 0; #HOURLYPOINTS = #HOURLYPOINTS + .cpoints; dispbottom "You receive a bonus "+.cpoints+" Hourly Point(s) by playing for "[email protected]_string$+" consecutively!!!"; dispbottom "Current Balance = "+#HOURLYPOINTS+" Hourly Point(s)"; } OnPCLoginEvent: addtimer .timer,"hourlypoints::OnPointGet"; @hourly_points_timer = gettimetick(2) + ( .timer / 1000 ); end; OnCmdHour: message strcharinfo(0),@hourly_points_timer ? Time2Str( @hourly_points_timer )+" remaining before you get your Hourly Reward(s).":"Something went wrong or you're considered idle at the moment, try relogging!"; end; OnInit: bindatcmd "hourlypoints","hourlypoints::OnCmdHour"; //@ctr to view time till next point. .timer = 1000*60*60; //Timer in milliseconds. ( Default: 1000*60*60 [ = 1 Hour ] ) .cdelay = 10; //Delay before receiving the consecutive bonus. ( Default: 3 [ { ~ 3 Hours } *Using default timer ] ) .cpoints = 3; //Points gained for consecutive time online. ( Default: 10 ) .points = 1; //Normal points gained. ( Default: 1 ) .delay = 216000; //Delay for idle re-check check. ( Default: 1000 [ = 1 Second ] ) .idle = 360*10; //Player is idle after not moving for this many seconds. ( Default: 60*5 [ = 5 Minutes ] ) } not my script just found somewhere else I just remove the function that check idle players tho still cancel hourly when vending.
  8. Hi can someone help me with this i just switched to pre renewal to renewal.. in renewal sonic blow is not being used so we didnt see the problem in here. but when i switched to pre re trans sonic blow of assassin we have checked that doesn't have animation. see video.. we have gepard installed.. not using modified grf also.. 2021-08-15 02-47-16.mp4
  9. Hi can I make a request regarding Hourly System but the change was an item needs to be equip before the hourly count starts. Equip = Hat Makes Hourly countdown starts UN equip = Hat Makes Hourly Countdown stop AFK/VENDING/CHATTING will also makes the countdown stop
  10. at status.cpp:12683 sd = 0x0 sc = 0x7fffe2cc7174 sce = <optimized out> status = 0x7fffe2cc7110 vd = 0x55555bd8c6d4 opt_flag = <optimized out> calc_flag = 33554432 undead_flag = <optimized out> val_flag = 0 tick_time = <optimized out> sc_isnew = true __FUNCTION__ = "status_change_start" tick = <optimized out> #1 0x000055555578c69b in skill_castend_nodamage_id (src=0x7fffe2cc6c04, bl=0x7fffe2cc6c04, skill_id=<optimized out>, skill_lv=1, tick=489235094, flag=0) at /usr/include/c++/8/bits/shared_ptr_base.h:1018 sd = <optimized out> dstsd = <optimized out> --Type <RET> for more, q to quit, c to continue without paging--RET md = <optimized out> dstmd = 0x7fffe2cc6c04 hd = <optimized out> mer = 0x0 sstatus = <optimized out> tstatus = <optimized out> tsc = <optimized out> tsce = <optimized out> i = <optimized out> type = <optimized out> __FUNCTION__ = "skill_castend_nodamage_id" #2 0x00005555557a9fdf in skill_castend_id (tid=<optimized out>, [email protected]=489235094, id=<optimized out>, [email protected]=0) at skill.cpp:11914 fail = false res = <optimized out> target = 0x7fffe2cc6c04 src = 0x7fffe2cc6c04 sd = <optimized out> md = <optimized out> ud = <optimized out> sc = <optimized out> flag = <optimized out> Can anyone help me with this please server crashing and here is the gdb report
  11. 1. i will cast devo to my party member and defender on 2. enemy player hit my pt member - " works fine " 3. but when i cast my devo skill again to my pt member the defender reduce damage gone but the icon defender skill and the effect of slow still there anyone can help me to fix this? Thank you! Thats my main problem when the paladin user devotion again while other party member is on defender, The defender damage reduction is gone
  12. still bug until now and still no solution or fix.. still occurs in pre-re we just need to wait for vacant dev's to fix this issue tho its been a year already
  13. Hi can some one help me update the sql format of this script Item_Check_Players.txt
  14. Hi annie have tried this script.. I have a question does dead winner teammate wont receive the prize? and also script stops after selecting start match.. using latest rathena git
  15. query_sql("SELECT `LV` FROM `mob_db` WHERE `DropCardid` = "[email protected]_nameid[[email protected]],[email protected]); I think its from this query Can copy maybe with the hunting_mission script query query_sql("SELECT ID FROM `" + .mob_db$ + "` WHERE left(Sprite, 4) != 'meta' AND left(Sprite, 2) != 'E_' AND ~Mode & 32 AND EXP > 0 AND MVP1id = 0 AND DropCardid > 4000 AND DropCardid < 5000 AND ID < 2000 AND instr('"+.Blacklist$+"',ID) = 0 ORDER BY rand() LIMIT " + .Quests, [email protected]); Tho i dont know where to start xD
  16. Can someone help me regarding card trader also exchanging bullet for a point.. I want this script to add a black list on items that shouldn't be exchange. example bullet /===== rAthena Script ======================================= //= Card Trader //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.1 //===== Compatible With: ===================================== //= rAthena SVN //===== Description: ========================================= //= Exchange cards for points. //============================================================ byako,106,175,4 script Card Trader 90,{ mes "[Card Trader]"; mes "Hi, "+strcharinfo(0)+"!"; mes "What can I do for you?"; next; switch(select(" > Information: > Trade in cards: > Point shop (^0055FF"+getd(.Points$)+"^000000): > Leave")) { case 1: mes "[Card Trader]"; 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 "[Card Trader]"; 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 "[Card Trader]"; 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 "[Card Trader]"; mes "You have ^0055FF"+getd(.Points$)+"^000000 Point"+((getd(.Points$) == 1)?".":"s."); callshop "card_shop",1; npcshopattach "card_shop"; end; case 4: mes "[Card Trader]"; mes "*yawn*"; mes "See you later!"; emotion e_yawn; close; } OnSellItem: mes "Cards to sell:"; mes "-----------------------------------"; for(set [email protected],0; [email protected]<getarraysize(@sold_nameid); set [email protected],[email protected]+1) if (@sold_nameid[[email protected]] > 4000 && @sold_nameid[[email protected]] < 32000) { if (.Level) { query_sql("SELECT `LV` FROM `mob_db` WHERE `DropCardid` = "[email protected]_nameid[[email protected]],[email protected]); if ([email protected] < .Level) { dispbottom getitemname(@sold_nameid[[email protected]])+" is under the minimum level."; continue; } } set [email protected]_id[getarraysize([email protected]_id)], @sold_nameid[[email protected]]; set [email protected]_amt[getarraysize([email protected]_amt)], @sold_quantity[[email protected]]; set [email protected], compare(.MVP$,""[email protected]_nameid[[email protected]]); mes (([email protected])?" ^FF0000":" ^777777")[email protected]_quantity[[email protected]]+"x "+getitemname(@sold_nameid[[email protected]])+"^000000"; set [email protected]_total, [email protected]_total+(@sold_quantity[[email protected]]*(([email protected])?.Points[1]:.Points[0])); } deletearray @sold_nameid[0], getarraysize(@sold_nameid); deletearray @sold_quantity[0], getarraysize(@sold_quantity); if ([email protected]_id) { mes " ^777777(none)^000000"; emotion e_swt; close; } mes " "; mes "---------- Total: ^0055FF"[email protected]_total+" pt.^000000 -------"; next; if(select(" > ^0055FFComplete trade...^000000: > ^777777Cancel^000000") == 2) { mes "[Card Trader]"; mes "Oh, okay..."; emotion e_hmm; close; } for(set [email protected],0; [email protected]<getarraysize([email protected]_id); set [email protected],[email protected]+1) delitem [email protected]_id[[email protected]],[email protected]_amt[[email protected]]; setd .Points$, getd(.Points$)[email protected]_total; mes "[Card Trader]"; mes "All done!"; emotion e_ho; close; OnBuyItem: for(set [email protected],0; [email protected]<getarraysize(@bought_nameid); set [email protected],[email protected]+1) for(set [email protected],0; [email protected]<getarraysize(.Shop); set [email protected],[email protected]+2) if (@bought_nameid[[email protected]] == .Shop[[email protected]]) { set [email protected], [email protected]+(.Shop[[email protected]+1]*@bought_quantity[[email protected]]); break; } if ([email protected] > getd(.Points$)) { mes "[Card Trader]"; mes "You don't have enough Points."; emotion e_omg; } else { mes "Items purchased:"; mes "-----------------------------------"; for(set [email protected],0; [email protected]<getarraysize(@bought_nameid); set [email protected],[email protected]+1) { getitem @bought_nameid[[email protected]], @bought_quantity[[email protected]]; mes " ^777777"[email protected]_quantity[[email protected]]+"x "+getitemname(@bought_nameid[[email protected]])+"^000000"; } mes " "; mes "---------- Total: ^0055FF"[email protected]+" pt.^000000 -------"; setd .Points$, getd(.Points$)[email protected]; 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$,"#Card_Points"; // Variable to store points. setarray .Shop[0], // Card Shop items: <ID>,<point cost> 12414,2,13994,2,50042,10,17331,20,13610,50,13611,50,4054,50,4174,75,4047,100; setarray .Points[0],1,5; // Points per <normal card>,<MVP card> set .MVP$, // List of MVP cards. "4121,4123,4128,4131,4132,4134,4135,4137,4142,4143,4144,4145,4146,4147,4148,4168,4236,"+ "4241,4263,4276,4302,4305,4318,4324,4330,4342,4357,4359,4361,4363,4365,4399,4403,4407,4605,4636"+ "27126,4592,27182,4562,4560,4563,4574,27164,4576,4509,27162,27106,4566,4363,4365,4580,4525,4520,27325,4652"+ "4565,4561,4578,4507,31026,4625,27020"; npcshopdelitem "card_shop",909; for(set [email protected],0; [email protected]<getarraysize(.Shop); set [email protected],[email protected]+2) npcshopadditem "card_shop",.Shop[[email protected]],.Shop[[email protected]+1]; end; } - shop card_shop -1,909:-1 any one please
  17. Hi I would like to request a different kind of card remove with OnPCLoginEvent: Remove Cards character thas has this specific card or acce example: buffalo card <<< will be remove to accessory when login and will be stored at storage
  18. this working on latest rathena version?
  19. How to make this every 3 hours and for specific map only
  20. Is it possible to create an npc that counts players who have a specific items and can only be access by GM. Like Memory of Thanatos Card = There are ( 20 ) player that has this Item Kield D-01 Card = There are ( 2 ) player that has this Item Weapon Custom = There are ( 2 ) player that has this Item Counts items inside Inventory/Storage/Vending/Gstorage Dont need the player name just to count the item..
  21. bug still persist now after I create my guild and tried to logout and login guild UI is removed.. how to know the problem.. I already removed the battleground free mod.. no error during compilation.. i have guild but create guild UI is showing Already remove BG mod. but I have extended vending patch remove extended vending and still bug.. im using 20200401 client
×
×
  • Create New...

Important Information

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