- Now gvg_dungeon mapflag will activate the other mapflags which are required: pvp, pvp_nocalcrank and pvp_noparty/pvp_noguild (they are forced to off if gvg_dungeon is on and viceversa)

- Cleaned the pvp ranking code so that it takes effect even if pvp_nocalcrank is active WHEN the map is a gvg_dungeon one.
- Cleaned up a bit the pvp ranking timer code.
- Now homuncs and their masters are the only ones who can use support skills on the homunc.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9360 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-11-29 15:22:47 +00:00
parent e4e42fbcb7
commit c22f5854dc
6 changed files with 29 additions and 25 deletions

View File

@ -4,6 +4,13 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/11/29
* Now gvg_dungeon mapflag will activate the other mapflags which are
required: pvp, pvp_nocalcrank and pvp_noparty/pvp_noguild (they are forced
to off if gvg_dungeon is on and viceversa) [Skotlex]
* Cleaned the pvp ranking code so that it takes effect even if
pvp_nocalcrank is active WHEN the map is a gvg_dungeon one. [Skotlex]
* Now homuncs and their masters are the only ones who can use support
skills on them. [Skotlex]
* Some cleaning on the homunc speed calculating code, so that it correctly
uses the default walk speed if the player has no speed yet. [Skotlex]
2006/11/28

View File

@ -8330,13 +8330,11 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(sd->status.guild_id)
guild_send_memberinfoshort(sd,1);
// pvp
//if(sd->pvp_timer!=-1 && !battle_config.pk_mode) /PVP Client crash fix* Removed timer deletion
// delete_timer(sd->pvp_timer,pc_calc_pvprank_timer);
if(map[sd->bl.m].flag.pvp){
if(!battle_config.pk_mode) { // remove pvp stuff for pk_mode [Valaris]
if (sd->pvp_timer == -1)
sd->pvp_timer=add_timer(gettick()+200,pc_calc_pvprank_timer,sd->bl.id,0);
if (!map[sd->bl.m].flag.pvp_nocalcrank)
sd->pvp_timer= add_timer(gettick()+200,
pc_calc_pvprank_timer,sd->bl.id,0);
sd->pvp_rank=0;
sd->pvp_lastusers=0;
sd->pvp_point=5;

View File

@ -2452,7 +2452,10 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4)
}
else if (strcmpi(w3,"gvg_dungeon")==0) {
map[m].flag.gvg_dungeon=state;
if (state) map[m].flag.pvp=0;
map[m].flag.pvp=state;
map[m].flag.pvp_noparty=!state;
map[m].flag.pvp_noguild=!state;
map[m].flag.pvp_nocalcrank=state;
}
else if (strcmpi(w3,"gvg_castle")==0) {
map[m].flag.gvg_castle=state;

View File

@ -5070,14 +5070,16 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
}
}
// pvp
if( map[sd->bl.m].flag.pvp && !battle_config.pk_mode){ // disable certain pvp functions on pk_mode [Valaris]
if (!map[sd->bl.m].flag.pvp_nocalcrank) {
// disable certain pvp functions on pk_mode [Valaris]
if (map[sd->bl.m].flag.pvp && !battle_config.pk_mode &&
(!map[sd->bl.m].flag.pvp_nocalcrank || map[sd->bl.m].flag.gvg_dungeon))
{ //Pvp points always take effect on gvg_dungeon maps.
sd->pvp_point -= 5;
sd->pvp_lost++;
if (src && src->type == BL_PC) {
struct map_session_data *ssd = (struct map_session_data *)src;
if (ssd) { ssd->pvp_point++; ssd->pvp_won++; }
}
ssd->pvp_point++;
ssd->pvp_won++;
}
if( sd->pvp_point < 0 ){
sd->pvp_point=0;
@ -6623,14 +6625,8 @@ int pc_calc_pvprank(struct map_session_data *sd)
{
int old;
struct map_data *m;
nullpo_retr(0, sd);
nullpo_retr(0, m=&map[sd->bl.m]);
m=&map[sd->bl.m];
old=sd->pvp_rank;
if( !(m->flag.pvp) )
return 0;
sd->pvp_rank=1;
map_foreachinmap(pc_calc_pvprank_sub,sd->bl.m,BL_PC,sd);
if(old!=sd->pvp_rank || sd->pvp_lastusers!=m->users)
@ -6644,8 +6640,6 @@ int pc_calc_pvprank(struct map_session_data *sd)
int pc_calc_pvprank_timer(int tid,unsigned int tick,int id,int data)
{
struct map_session_data *sd=NULL;
if(battle_config.pk_mode) // disable pvp ranking if pk_mode on [Valaris]
return 0;
sd=map_id2sd(id);
if(sd==NULL)

View File

@ -1102,10 +1102,11 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
return 1;
return 0;
case BL_HOM:
//Can't use support skills on homun
//Can't use support skills on homun (only master/self can)
//Placed here instead of battle_check_target because support skill
//invocations don't call that function.
if (skill_num && skill_get_inf(skill_num)&INF_SUPPORT_SKILL)
if (skill_num && skill_get_inf(skill_num)&INF_SUPPORT_SKILL &&
battle_get_master(target) != src)
return 0;
default:
//Check for chase-walk/hiding/cloaking opponents.

View File

@ -1627,6 +1627,7 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
if(sd->pvp_timer!=-1) {
delete_timer(sd->pvp_timer,pc_calc_pvprank_timer);
sd->pvp_timer = -1;
sd->pvp_rank = 0;
}
if(pc_issit(sd)) {