From 760a86e1c577f776986f4558726a1784317037bb Mon Sep 17 00:00:00 2001 From: skotlex Date: Sat, 27 Jan 2007 00:31:29 +0000 Subject: - Moved the pet rename code from int_pet.c to inter.c and normalized it so it can be used for any object. - Made homunculus renaming go through the char-server so it can be validated against the allowed characters setting. - Added battle config hom_rename so you can enable renaming multiple times your homunc. - Updated the hardcoded defaults for gvg-damage to what they should be. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9720 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mercenary.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/map/mercenary.c') diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 6cd05926b..cb502d8af 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -494,6 +494,41 @@ int merc_hom_hungry_timer_delete(struct homun_data *hd) return 1; } +int merc_hom_change_name(struct map_session_data *sd,char *name) +{ + int i; + struct homun_data *hd; + nullpo_retr(1, sd); + + hd = sd->hd; + if (!merc_is_hom_active(hd)) + return 1; + if(hd->homunculus.rename_flag && !battle_config.hom_rename) + return 1; + + for(i=0;ihd; + if (!merc_is_hom_active(hd)) return 0; + if (!flag) { + clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name + return 0; + } + strncpy(hd->homunculus.name,name,NAME_LENGTH); + clif_charnameack (0,&hd->bl); + hd->homunculus.rename_flag = 1; + clif_hominfo(sd,hd,0); + return 1; +} + int search_homunculusDB_index(int key,int type) { int i; -- cgit v1.2.3-60-g2f50