From 2449d2a6e7ddd1648d2e1fe446c97fe94378af28 Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 18 Apr 2006 16:01:26 +0000 Subject: - Removed message 592 from trade.c - Removed mapflag nopvp - Added support for disabling mapflags on a mapflag line: comodo.gat mapflag nomemo <- turns on nomemo mapflag comodo.gat mapflag nomemo off <- turns off nomemo mapflag - Cleaned up and optimized the restricted/zones mapflag. Restricted cards will just not work in disallowed maps rather than blocking the compounded equipement from being used. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6159 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/status.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src/map/status.c') diff --git a/src/map/status.c b/src/map/status.c index 2cfbbaf89..d40830465 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -814,6 +814,8 @@ int status_calc_pc(struct map_session_data* sd,int first) if(sd->inventory_data[index]) { int j,c; + struct item_data *data; + //Card script execution. if(sd->status.inventory[index].card[0]==0x00ff || sd->status.inventory[index].card[0]==0x00fe || @@ -821,17 +823,28 @@ int status_calc_pc(struct map_session_data* sd,int first) continue; for(j=0;jinventory_data[index]->slot;j++){ // ƒJ?ƒh current_equip_card_id= c= sd->status.inventory[index].card[j]; - if(c>0){ - if(i == 8 && sd->status.inventory[index].equip == 0x20) - { //Left hand status. - sd->state.lr_flag = 1; - run_script(itemdb_equipscript(c),0,sd->bl.id,0); - sd->state.lr_flag = 0; - } else - run_script(itemdb_equipscript(c),0,sd->bl.id,0); - if (!calculating) //Abort, run_script retriggered status_calc_pc. [Skotlex] - return 1; + if(!c) + continue; + data = itemdb_exists(c); + if (!data || !data->script) + continue; + if(data->flag.no_equip) { //Card restriction checks. + if(map[sd->bl.m].flag.restricted && data->flag.no_equip&map[sd->bl.m].zone) + continue; + if(map[sd->bl.m].flag.pvp && data->flag.no_equip&1) + continue; + if(map_flag_gvg(sd->bl.m) && data->flag.no_equip&2) + continue; } + if(i == 8 && sd->status.inventory[index].equip == 0x20) + { //Left hand status. + sd->state.lr_flag = 1; + run_script(data->script,0,sd->bl.id,0); + sd->state.lr_flag = 0; + } else + run_script(data->script,0,sd->bl.id,0); + if (!calculating) //Abort, run_script retriggered status_calc_pc. [Skotlex] + return 1; } } } -- cgit v1.2.3-70-g09d2