diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-01-27 00:31:29 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-01-27 00:31:29 +0000 |
commit | 760a86e1c577f776986f4558726a1784317037bb (patch) | |
tree | 1bd9ced75fd02c6a1cc74868c4e7bf9aa761ce11 /src/map/mercenary.c | |
parent | 19c0056b1af3fcc80e3f402e92ca605d4228873e (diff) | |
download | hercules-760a86e1c577f776986f4558726a1784317037bb.tar.gz hercules-760a86e1c577f776986f4558726a1784317037bb.tar.bz2 hercules-760a86e1c577f776986f4558726a1784317037bb.tar.xz hercules-760a86e1c577f776986f4558726a1784317037bb.zip |
- 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
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r-- | src/map/mercenary.c | 35 |
1 files changed, 35 insertions, 0 deletions
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;i<NAME_LENGTH && name[i];i++){ + if( !(name[i]&0xe0) || name[i]==0x7f) + return 1; + } + + return intif_rename_hom(sd, name); +} + +int merc_hom_change_name_ack(struct map_session_data *sd, char* name, int flag) +{ + struct homun_data *hd = sd->hd; + 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; |