Jump to content

mhielo12

Members
  • Posts

    111
  • Joined

  • Last visited

1 Follower

About mhielo12

  • Birthday March 6

Profile Information

  • Gender
    Male

Recent Profile Visitors

2,299 profile views

mhielo12's Achievements

  1. Would like to request a room that only accessible by guild that had won the WOE on that day.. 24hrs room exclusive for guild winner members. Room count down start at the end of the WOE and end / reset when woe will start. special room feature.. Summon 10~20 random MVP around 12midnight Summon 10 Treasure chest around 10PM / 3AM / 10AM / 3PM Tysm
  2. check your ../src/map/clif_packetdb.hpp if you have the that line.
  3. 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
  4. 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)
  5. 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
  6. 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?
  7. try this https://rathena.org/board/topic/95122-preview-npc/
  8. 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.
  9. 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.
  10. 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
  11. 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
  12. 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
×
×
  • Create New...

Important Information

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