Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/conf/battle/battle.conf b/conf/battle/battle.conf
- index 593d4e9..74c35e2 100644
- --- a/conf/battle/battle.conf
- +++ b/conf/battle/battle.conf
- @@ -158,3 +158,10 @@ 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
- +
- +// Costume item edit
- +// Reserved Char ID for costume converted items.
- +// 0 = Disable
- +// If you change this later, then all converted/created costumeitem's will
- +// turn back to normal items with a 'Unknown's ...' name and no socket in it.
- +reserved_costume_id: 1
- \ No newline at end of file
- diff --git a/npc/custom/sehrentos/costumer.txt b/npc/custom/sehrentos/costumer.txt
- new file mode 100644
- index 0000000..803a9be
- --- /dev/null
- +++ b/npc/custom/sehrentos/costumer.txt
- @@ -0,0 +1,43 @@
- +// ======================================
- +// Costumer npc
- +// 27-04-2015
- +// Convert headgear into costume items.
- +// refine & cards will be lost!
- +// ======================================
- +prontera,149,214,4 script Costumer#cs_0 421,{
- + mes "[ "+strnpcinfo(1)+" ]";
- + mes "What headgear would you like to convert into costume?";
- + mes "^ff0000Warning!^000000";
- + mes "Converted item will lose all refine and cards compounded in them.";
- + next;
- + setarray .@Position$[1],"Top","Mid","Low";
- + setarray .@Position[1], 1, 9, 10;
- + set .@Menu$,"";
- + for( set .@i, 1; .@i < 5; set .@i, .@i + 1 )
- + {
- + if( getequipisequiped(.@Position[.@i]) )
- + set .@Menu$, .@Menu$ + .@Position$[.@i] + "-" + "[" + getequipname(.@Position[.@i]) + "]";
- + set .@Menu$, .@Menu$ + ":";
- + }
- + set .@Part, .@Position[ select(.@Menu$) ];
- + if( !getequipisequiped(.@Part) )
- + {
- + mes "[ " + strnpcinfo(1) + " ]";
- + mes "Your not wearing anything there...";
- + close;
- + }
- + mes "[ "+strnpcinfo(1)+" ]";
- + mes "You want to Costume your " + getitemname(getequipid(.@Part)) + "?";
- + next;
- + if( select("Yes, proceed:No, I am sorry.") == 2 )
- + {
- + mes "[ "+strnpcinfo(1)+" ]";
- + mes "Need some time to think about it, huh?";
- + mes "Alright, I can understand.";
- + close;
- + }
- + costume .@Part; // Convert the Headgear
- + mes "[ "+strnpcinfo(1)+" ]";
- + mes "Done, enjoy your costume headgear.";
- + close;
- +}
- \ No newline at end of file
- diff --git a/src/map/atcommand.c b/src/map/atcommand.c
- index d7e318a..f0d5247 100644
- --- a/src/map/atcommand.c
- +++ b/src/map/atcommand.c
- @@ -1198,7 +1198,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; // Costume item edit
- char flag = 0;
- struct item item_tmp;
- struct item_data *item_data[10];
- @@ -1237,6 +1237,24 @@ 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;
- }
- + // Costume item edit
- + if (!strcmpi(command + 1, "costumeitem")) {
- + if (!battle_config.reserved_costume_id) {
- + clif_displaymessage(fd, "Costume convertion is disabled.");
- + return -1;
- + }
- + if (!(item_data[j]->equip&EQP_HEAD_LOW) &&
- + !(item_data[j]->equip&EQP_HEAD_MID) &&
- + !(item_data[j]->equip&EQP_HEAD_TOP) &&
- + !(item_data[j]->equip&EQP_COSTUME_HEAD_LOW) &&
- + !(item_data[j]->equip&EQP_COSTUME_HEAD_MID) &&
- + !(item_data[j]->equip&EQP_COSTUME_HEAD_TOP))
- + {
- + clif_displaymessage(fd, "You cannot costume this item. Costume only work for headgears.");
- + return -1;
- + }
- + costume = 1;
- + } // end edit
- itemlist = strtok(NULL, ":"); //next itemline
- j++;
- }
- @@ -1258,6 +1276,14 @@ 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;
- +
- + // Costume item edit
- + 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 edit
- +
- if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
- clif_additem(sd, 0, 0, flag);
- }
- @@ -9994,6 +10020,7 @@ void atcommand_basecommands(void) {
- ACMD_DEF(costume),
- ACMD_DEF(cloneequip),
- ACMD_DEF(clonestat),
- + ACMD_DEF2("costumeitem", item) // Costume item edit
- };
- AtCommandInfo* atcommand;
- int i;
- diff --git a/src/map/battle.c b/src/map/battle.c
- index ecb15fc..e94fb86 100644
- --- a/src/map/battle.c
- +++ b/src/map/battle.c
- @@ -8015,6 +8015,7 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range
- { "homunculus_evo_intimacy_need", &battle_config.homunculus_evo_intimacy_need, 91100, 0, INT_MAX, },
- { "homunculus_evo_intimacy_reset", &battle_config.homunculus_evo_intimacy_reset, 1000, 0, INT_MAX, },
- { "monster_loot_search_type", &battle_config.monster_loot_search_type, 1, 0, 1, },
- + { "reserved_costume_id", &battle_config.reserved_costume_id, 1, 0, INT_MAX, }, // Costume item edit
- };
- #ifndef STATS_OPT_OUT
- diff --git a/src/map/battle.h b/src/map/battle.h
- index a880661..3cffbc5 100644
- --- a/src/map/battle.h
- +++ b/src/map/battle.h
- @@ -589,6 +589,7 @@ extern struct Battle_Config
- int homunculus_evo_intimacy_need;
- int homunculus_evo_intimacy_reset;
- int monster_loot_search_type;
- + int reserved_costume_id; // Costume item edit
- } battle_config;
- void do_init_battle(void);
- diff --git a/src/map/map.c b/src/map/map.c
- index d9c0b0b..0f383b6 100644
- --- a/src/map/map.c
- +++ b/src/map/map.c
- @@ -1644,6 +1644,13 @@ void map_reqnickdb(struct map_session_data * sd, int charid)
- nullpo_retv(sd);
- + // Costume item edit
- + if (battle_config.reserved_costume_id && battle_config.reserved_costume_id == charid)
- + {
- + clif_solved_charname(sd->fd, charid, "Costume");
- + return;
- + } //end
- +
- tsd = map_charid2sd(charid);
- if( tsd )
- {
- diff --git a/src/map/pc.c b/src/map/pc.c
- index da9285c..54f7a79 100755
- --- a/src/map/pc.c
- +++ b/src/map/pc.c
- @@ -678,7 +678,7 @@ void pc_setnewpc(struct map_session_data *sd, uint32 account_id, uint32 char_id,
- * @param n Equip index in inventory
- */
- int pc_equippoint(struct map_session_data *sd,int n){
- - int ep = 0;
- + int ep = 0, char_id = 0; // Costume item edit
- nullpo_ret(sd);
- @@ -696,6 +696,17 @@ int pc_equippoint(struct map_session_data *sd,int n){
- (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO))//Kagerou and Oboro can dual wield daggers. [Rytech]
- return EQP_ARMS;
- }
- +
- + // Costume item edit
- + if (battle_config.reserved_costume_id &&
- + sd->status.inventory[n].card[0] == CARD0_CREATE &&
- + (char_id = MakeDWord(sd->status.inventory[n].card[2], sd->status.inventory[n].card[3])) == battle_config.reserved_costume_id)
- + { // Costume Item - Converted
- + 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; }
- + } // End edit
- +
- return ep;
- }
- diff --git a/src/map/script.c b/src/map/script.c
- index d6a72a0..2baa114 100644
- --- a/src/map/script.c
- +++ b/src/map/script.c
- @@ -20096,6 +20096,51 @@ static int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap)
- return SCRIPT_CMD_SUCCESS;
- }
- +/**
- + * Costume item edit
- + **/
- +BUILDIN_FUNC(costume) {
- + int i = -1, num, ep;
- + TBL_PC *sd;
- +
- + num = script_getnum(st, 2); // Equip Slot
- + sd = script_rid2sd(st);
- +
- + if (sd == NULL)
- + return 0;
- + if (num > 0 && num <= ARRAYLENGTH(equip))
- + i = pc_checkequip(sd, equip[num - 1]);
- + if (i < 0)
- + return 0;
- +
- + ep = sd->status.inventory[i].equip;
- + if (!(ep&EQP_HEAD_LOW) && !(ep&EQP_HEAD_MID) && !(ep&EQP_HEAD_TOP))
- + return 0;
- +
- + log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]);
- + pc_unequipitem(sd, i, 2);
- + clif_delitem(sd, i, 1, 3);
- + // --------------------------------------------------------------------
- + sd->status.inventory[i].refine = 0;
- + sd->status.inventory[i].attribute = 0;
- + sd->status.inventory[i].card[0] = CARD0_CREATE;
- + sd->status.inventory[i].card[1] = 0;
- + sd->status.inventory[i].card[2] = GetWord(battle_config.reserved_costume_id, 0);
- + sd->status.inventory[i].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, &sd->status.inventory[i]);
- +
- + clif_additem(sd, i, 1, 0);
- + pc_equipitem(sd, i, ep);
- + clif_misceffect(&sd->bl, 3);
- +
- + return 0;
- +}
- +
- #include "../custom/script.inc"
- // declarations that were supposed to be exported from npc_chat.c
- @@ -20648,6 +20693,8 @@ struct script_function buildin_func[] = {
- BUILDIN_DEF(npcshopupdate,"sii?"),
- BUILDIN_DEF(getattachedrid,""),
- + BUILDIN_DEF(costume, "i"), // Costume item edit
- +
- #include "../custom/script_def.inc"
- {NULL,NULL,NULL},
- diff --git a/src/map/status.c b/src/map/status.c
- index 3e78166..e249c2c 100644
- --- a/src/map/status.c
- +++ b/src/map/status.c
- @@ -3095,7 +3095,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt)
- current_equip_combo_pos = 0;
- if (index < 0)
- continue;
- - if (i == EQI_AMMO)
- + if (i == EQI_AMMO || i == EQI_COSTUME_TOP || i == EQI_COSTUME_MID || i == EQI_COSTUME_LOW) // Costume item edit
- continue;
- if (pc_is_same_equip_index((enum equip_index)i, sd->equip_index, index))
- continue;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement