Index: src/common/mmo.h =================================================================== --- src/common/mmo.h (revision 17296) +++ src/common/mmo.h (working copy) @@ -47,7 +47,7 @@ // 20120307 - 2012-03-07aRagexeRE+ - 0x970 #ifndef PACKETVER - #define PACKETVER 20120410 + #define PACKETVER 20130320 //#define PACKETVER 20111116 #endif Index: src/map/skill.c =================================================================== --- src/map/skill.c (revision 17296) +++ src/map/skill.c (working copy) @@ -1826,8 +1826,8 @@ } if(sd && (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR && - rnd()%10000 < battle_config.sg_miracle_skill_ratio) //SG_MIRACLE [Komurka] - sc_start(src,src,SC_MIRACLE,100,1,battle_config.sg_miracle_skill_duration); + map[sd->bl.m].flag.nosumstarmiracle == 0) //SG_MIRACLE [Komurka] + sc_start(src,src,SC_MIRACLE,battle_config.sg_miracle_skill_ratio,1,battle_config.sg_miracle_skill_duration); if(sd && skill_id && attack_type&BF_MAGIC && status_isdead(bl) && !(skill_get_inf(skill_id)&(INF_GROUND_SKILL|INF_SELF_SKILL)) && @@ -13136,7 +13136,7 @@ * Warlock **/ case WL_COMET: - if( skill_check_pc_partner(sd,skill_id,&skill_lv,1,0) <= 0 + if( skill_check_pc_partner(sd,skill_id,&skill_lv,1,0) <= 0 && ((i = pc_search_inventory(sd,require.itemid[0])) < 0 || sd->status.inventory[i].amount < require.amount[0]) ) { //clif_skill_fail(sd,skill_id,USESKILL_FAIL_NEED_ITEM,require.amount[0],require.itemid[0]); clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); Index: src/map/clif.c =================================================================== --- src/map/clif.c (revision 17296) +++ src/map/clif.c (working copy) @@ -5564,15 +5564,16 @@ WFIFOSET(fd,packet_len(0x199)); } + void clif_maptypeproperty2(struct block_list *bl,enum send_target t) { -#if PACKETVER >= 20130000 /* not entirely sure when this started */ +#if PACKETVER >= 20130000 uint8 buf[8]; WBUFW(buf,0)=0x99b; //2 WBUFW(buf,2)=0x28; //2 - WBUFB(buf,4) |= 0x01; //party - WBUFB(buf,4) |= 0x02; //guild + WBUFB(buf,4) = ((map[bl->m].flag.partylock)?0:0x01); //party + WBUFB(buf,4) |= ((map[bl->m].flag.guildlock)?0:0x02); //guild WBUFB(buf,4) |= ((map_flag_gvg2(bl->m))?0x04:0); //siege WBUFB(buf,4) |= 0x08; //mineffect WBUFB(buf,4) |= 0; //nolockon 0x10 @@ -5580,9 +5581,9 @@ WBUFB(buf,4) |= 0; //nopartyformation 0x40 WBUFB(buf,4) |= ((map[bl->m].flag.battleground)?0x80:0); //battleground - WBUFB(buf,5) |= 0; //noitemconsumption - WBUFB(buf,5) |= 0x02; //cart - WBUFB(buf,5) |= 0x04; //summonstarmiracle + WBUFB(buf,5) = ((map[bl->m].flag.noitemconsmtion)?0x01:0); //noitemconsumption + WBUFB(buf,5) |= ((map[bl->m].flag.nousecart)?0:0x02); // usecart + WBUFB(buf,5) |= ((map[bl->m].flag.nosumstarmiracle)?0:0x04); //summonstarmiracle // WBUFB(buf,5) |= RBUFB(buf,5)&0xf8; //sparebit[0-4] WBUFW(buf,6) = 0; //sparebit [5-15], + extra[4] Index: src/map/npc.c =================================================================== --- src/map/npc.c (revision 17296) +++ src/map/npc.c (working copy) @@ -281,6 +281,16 @@ } #endif +int npc_delayed_script_event(int tid, unsigned int tick, int id, intptr_t data) { + struct map_session_data* sd = NULL; + if( (sd = map_id2sd(id)) == NULL || !sd->npc_id ) { + return 0;//Not logged in anymore OR no longer attached to a npc + } + npc_script_event(sd,data); + return 0; +} + + /*========================================== * Dequeue event and add timer for execution (100ms) *------------------------------------------*/ @@ -3442,6 +3452,12 @@ map[m].flag.reset=state; else if (!strcmpi(w3,"nomapchannelautojoin")) map[m].flag.chmautojoin = state; + else if (!strcmpi(w3,"nousecart")) + map[m].flag.nousecart = state; + else if (!strcmpi(w3,"noitemconsmtion")) + map[m].flag.noitemconsmtion = state; + else if (!strcmpi(w3,"summonstarmiracle")) + map[m].flag.nosumstarmiracle = state; else ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer)); Index: src/map/npc.h =================================================================== --- src/map/npc.h (revision 17296) +++ src/map/npc.h (working copy) @@ -167,6 +167,7 @@ int npc_reload(void); void npc_read_event_script(void); int npc_script_event(struct map_session_data* sd, enum npce_event type); +int npc_delayed_script_event(int tid, unsigned int tick, int id, intptr_t data); int npc_duplicate4instance(struct npc_data *snd, int16 m); int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int points); Index: src/map/pc.c =================================================================== --- src/map/pc.c (revision 17296) +++ src/map/pc.c (working copy) @@ -4099,6 +4099,8 @@ nullpo_ret(sd); + + item = sd->inventory_data[n]; nameid = sd->status.inventory[n].nameid; @@ -4107,6 +4109,8 @@ //Not consumable item if( item->type != IT_HEALING && item->type != IT_USABLE && item->type != IT_CASH ) return 0; + else if(map[sd->bl.m].flag.noitemconsmtion) //consumable but mapflag prevent it + return 0; if( !item->script ) //if it has no script, you can't really consume it! return 0; @@ -6644,7 +6648,7 @@ sd->st->state = END; } - npc_script_event(sd,NPCE_DIE); + add_timer(gettick()+100,npc_delayed_script_event,sd->bl.id,NPCE_DIE); /* e.g. not killed thru pc_damage */ if( pc_issit(sd) ) { @@ -6691,14 +6695,10 @@ } break; case BL_PET: //Pass on to master... - src = &((TBL_PET*)src)->msd->bl; - break; case BL_HOM: - src = &((TBL_HOM*)src)->master->bl; - break; case BL_MER: - src = &((TBL_MER*)src)->master->bl; - break; + src = battle_get_master(src); + break; } if (src && src->type == BL_PC) Index: src/map/map.h =================================================================== --- src/map/map.h (revision 17296) +++ src/map/map.h (working copy) @@ -568,6 +568,9 @@ unsigned src4instance : 1; // To flag this map when it's used as a src map for instances unsigned reset :1; // [Daegaladh] unsigned chmautojoin : 1; //prevent to auto join map channel + unsigned nousecart : 1; //prevent open up cart @FIXME client side only atm + unsigned noitemconsmtion : 1; //prevent item usage + unsigned nosumstarmiracle : 1; //allow SG miracle to happen ? } flag; struct point save; struct npc_data *npc[MAX_NPC_PER_MAP]; Index: src/map/atcommand.c =================================================================== --- src/map/atcommand.c (revision 17296) +++ src/map/atcommand.c (working copy) @@ -8904,6 +8904,8 @@ return channel_pcban(sd,sub1,map_nick2sd(sub2),1); } else if ( strcmpi(key,"unbanall") == 0 ) { return channel_pcban(sd,sub1,NULL,2); + } else if ( strcmpi(key,"banlist") == 0 ) { + return channel_pcban(sd,sub1,NULL,3); } else if ( strcmpi(key,"setopt") == 0 ) { return channel_pcsetopt(sd,sub1,sub2,sub3); } else { Index: src/map/script.c =================================================================== --- src/map/script.c (revision 17296) +++ src/map/script.c (working copy) @@ -400,7 +400,11 @@ MF_MONSTER_NOTELEPORT, MF_PVP_NOCALCRANK, //50 MF_BATTLEGROUND, - MF_RESET + MF_RESET, + MF_CHANNELAUTOJOIN, + MF_NOUSECART, + MF_NOITEMCONSUMTION, + MF_SUMSTARTMIRACLE, }; const char* script_op2name(int op) @@ -10837,6 +10841,10 @@ case MF_PVP_NOCALCRANK: script_pushint(st,map[m].flag.pvp_nocalcrank); break; case MF_BATTLEGROUND: script_pushint(st,map[m].flag.battleground); break; case MF_RESET: script_pushint(st,map[m].flag.reset); break; + case MF_CHANNELAUTOJOIN: script_pushint(st,map[m].flag.chmautojoin); break; + case MF_NOUSECART: script_pushint(st,map[m].flag.nousecart); break; + case MF_NOITEMCONSUMTION: script_pushint(st,map[m].flag.noitemconsmtion); break; + case MF_SUMSTARTMIRACLE: script_pushint(st,map[m].flag.nosumstarmiracle); break; } } @@ -10938,6 +10946,10 @@ case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank = 1; break; case MF_BATTLEGROUND: map[m].flag.battleground = (val <= 0 || val > 2) ? 1 : val; break; case MF_RESET: map[m].flag.reset = 1; break; + case MF_CHANNELAUTOJOIN: map[m].flag.chmautojoin = 1 ; break; + case MF_NOUSECART: map[m].flag.nousecart = 1 ; break; + case MF_NOITEMCONSUMTION: map[m].flag.noitemconsmtion = 1 ; break; + case MF_SUMSTARTMIRACLE: map[m].flag.nosumstarmiracle = 1 ; break; } } @@ -11030,6 +11042,10 @@ case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank = 0; break; case MF_BATTLEGROUND: map[m].flag.battleground = 0; break; case MF_RESET: map[m].flag.reset = 0; break; + case MF_CHANNELAUTOJOIN: map[m].flag.chmautojoin = 0 ; break; + case MF_NOUSECART: map[m].flag.nousecart = 0 ; break; + case MF_NOITEMCONSUMTION: map[m].flag.noitemconsmtion = 0 ; break; + case MF_SUMSTARTMIRACLE: map[m].flag.nosumstarmiracle = 0 ; break; } }