- Updated battle_check_target so that non-offensive skills cannot be used on a homun except for the homun and it's master.

- Steal zeny won't work on treasure chests now.
- Small optimization in the dual-wielding check.
- Some cleaning in char_sql/itemdb.c


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8875 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-09-26 13:59:21 +00:00
parent e79c0a92af
commit c2794a9e1b
4 changed files with 16 additions and 29 deletions

View File

@ -3,6 +3,10 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/09/26
* Updated battle_check_target so that non-offensive skills cannot be used
on a homun except for the homun and it's master. [Skotlex]
* Steal zeny won't work on treasure chests now. [Skotlex]
2006/09/25 2006/09/25
* Added an ugly check so that Heal will display 0 when healing a berserked * Added an ugly check so that Heal will display 0 when healing a berserked
character (and it will again display full heal amount when healing a player character (and it will again display full heal amount when healing a player

View File

@ -26,29 +26,9 @@ static struct dbt* item_db;
static void* create_item(DBKey key, va_list args) { static void* create_item(DBKey key, va_list args) {
struct item_data *id; struct item_data *id;
int nameid = key.i; int nameid = key.i;
CREATE(id, struct item_data, 1); CREATE(id, struct item_data, 1);
id->nameid = nameid; id->nameid = nameid;
if(nameid>500 && nameid<600) id->type = IT_ETC;
id->type=0; //heal item
else if(nameid>600 && nameid<700)
id->type=2; //use item
else if((nameid>700 && nameid<1100) ||
(nameid>7000 && nameid<8000))
id->type=3; //correction
else if(nameid>=1750 && nameid<1771)
id->type=10; //arrow
else if(nameid>1100 && nameid<2000)
id->type=4; //weapon
else if((nameid>2100 && nameid<3000) ||
(nameid>5000 && nameid<6000))
id->type=5; //armor
else if(nameid>4000 && nameid<5000)
id->type=6; //card
else if(nameid>9000 && nameid<10000)
id->type=7; //egg
else if(nameid>10000)
id->type=8; //petequip
return id; return id;
} }
/*========================================== /*==========================================
@ -67,7 +47,7 @@ struct item_data* itemdb_search(int nameid)
int itemdb_isequip(int nameid) int itemdb_isequip(int nameid)
{ {
int type=itemdb_type(nameid); int type=itemdb_type(nameid);
if(type==0 || type==2 || type==3 || type==6 || type==10) if(type==IT_HEALING || type==IT_USABLE || type==IT_ETC || type==IT_CARD || type==IT_AMMO)
return 0; return 0;
return 1; return 1;
} }
@ -79,7 +59,7 @@ int itemdb_isequip2(struct item_data *data)
{ {
if(data) { if(data) {
int type=data->type; int type=data->type;
if(type==0 || type==2 || type==3 || type==6 || type==10) if(type==IT_HEALING || type==IT_USABLE || type==IT_ETC || type==IT_CARD || type==IT_AMMO)
return 0; return 0;
else else
return 1; return 1;

View File

@ -3198,8 +3198,10 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
return 0; return 0;
} }
break; break;
//Valid targets with no special checks here.
case BL_HOM: case BL_HOM:
//Except for the master/itself, hom can't be targetted with non-offensive skills. [Skotlex]
if (t_bl != s_bl && !(flag&BCT_ENEMY))
return 0;
break; break;
//All else not specified is an invalid target. //All else not specified is an invalid target.
default: default:

View File

@ -3259,6 +3259,9 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
if(md->state.steal_coin_flag || md->sc.data[SC_STONE].timer != -1 || md->sc.data[SC_FREEZE].timer != -1) if(md->state.steal_coin_flag || md->sc.data[SC_STONE].timer != -1 || md->sc.data[SC_FREEZE].timer != -1)
return 0; return 0;
if (md->class_>=1324 && md->class_<1364)
return 0;
skill = pc_checkskill(sd,RG_STEALCOIN)*10; skill = pc_checkskill(sd,RG_STEALCOIN)*10;
rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2; rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2;
if(rand()%1000 < rate) { if(rand()%1000 < rate) {
@ -6261,10 +6264,8 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
pos = sd->equip_index[EQI_ACC_L] >= 0 ? EQP_ACC_R : EQP_ACC_L; pos = sd->equip_index[EQI_ACC_L] >= 0 ? EQP_ACC_R : EQP_ACC_L;
} }
if(pos == EQP_ARMS && id->equip == EQP_HAND_R && if(pos == EQP_ARMS && id->equip == EQP_HAND_R)
(pc_checkskill(sd, AS_LEFT) > 0 || { //Dual wield capable weapon.
(sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN)
) { //Dual wield capable weapon.
pos = (req_pos&EQP_ARMS); pos = (req_pos&EQP_ARMS);
if (pos == EQP_ARMS) //User specified both slots, pick one for them. if (pos == EQP_ARMS) //User specified both slots, pick one for them.
pos = sd->equip_index[EQI_HAND_R] >= 0 ? EQP_HAND_L : EQP_HAND_R; pos = sd->equip_index[EQI_HAND_R] >= 0 ? EQP_HAND_L : EQP_HAND_R;