summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-21 03:22:41 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-21 03:22:41 +0000
commit683e4c655690b314d535777d976fb767687e3981 (patch)
tree40e6871f66309034d5280a316c049f25191561d6 /src/map/pc.c
parent5920ad3c5e0517cdb0c46845a431ca791f0d2832 (diff)
downloadhercules-683e4c655690b314d535777d976fb767687e3981.tar.gz
hercules-683e4c655690b314d535777d976fb767687e3981.tar.bz2
hercules-683e4c655690b314d535777d976fb767687e3981.tar.xz
hercules-683e4c655690b314d535777d976fb767687e3981.zip
- Fixed the equip/unequip scripts not triggering for compounded cards.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6207 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c45
1 files changed, 40 insertions, 5 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index c7cf8b24f..9602a9b2c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -6207,9 +6207,26 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos)
}
status_calc_pc(sd,0);
//OnEquip script [Skotlex]
- if (sd->inventory_data[n] && sd->inventory_data[n]->equip_script)
- run_script(sd->inventory_data[n]->equip_script,0,sd->bl.id,0);
-
+ if (sd->inventory_data[n]) {
+ int i;
+ struct item_data *data;
+ if (sd->inventory_data[n]->equip_script)
+ run_script(sd->inventory_data[n]->equip_script,0,sd->bl.id,0);
+ if(sd->status.inventory[n].card[0]==0x00ff ||
+ sd->status.inventory[n].card[0]==0x00fe ||
+ sd->status.inventory[n].card[0]==(short)0xff00)
+ ; //No cards
+ else
+ for(i=0;i<sd->inventory_data[n]->slot; i++)
+ {
+ if (!sd->status.inventory[n].card[i])
+ continue;
+ data = itemdb_exists(sd->status.inventory[n].card[i]);
+ if (data && data->equip_script)
+ run_script(data->equip_script,0,sd->bl.id,0);
+ }
+ }
+
if(sd->sc.count) {
if (sd->sc.data[SC_SIGNUMCRUCIS].timer != -1 && !battle_check_undead(7,sd->def_ele))
status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1);
@@ -6239,6 +6256,7 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
if(battle_config.battle_log)
ShowInfo("unequip %d %x:%x\n",n,pc_equippoint(sd,n),sd->status.inventory[n].equip);
+
if(!sd->status.inventory[n].equip){ //Nothing to unequip
clif_unequipitemack(sd,n,0,0);
return 0;
@@ -6284,8 +6302,25 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1);
}
//OnUnEquip script [Skotlex]
- if (sd->inventory_data[n] && sd->inventory_data[n]->unequip_script)
- run_script(sd->inventory_data[n]->unequip_script,0,sd->bl.id,0);
+ if (sd->inventory_data[n]) {
+ int i;
+ struct item_data *data;
+ if (sd->inventory_data[n]->unequip_script)
+ run_script(sd->inventory_data[n]->unequip_script,0,sd->bl.id,0);
+ if(sd->status.inventory[n].card[0]==0x00ff ||
+ sd->status.inventory[n].card[0]==0x00fe ||
+ sd->status.inventory[n].card[0]==(short)0xff00)
+ ; //No cards
+ else
+ for(i=0;i<sd->inventory_data[n]->slot; i++)
+ {
+ if (!sd->status.inventory[n].card[i])
+ continue;
+ data = itemdb_exists(sd->status.inventory[n].card[i]);
+ if (data && data->unequip_script)
+ run_script(data->unequip_script,0,sd->bl.id,0);
+ }
+ }
return 0;
}