Song/Dance timers cannot be updated by self without Soul Link - Fixes bugreport:7155
Updated Magic Crasher for Renewal - Fixes bugreport:6340 Attempt to fix walking dead by modifying death function sequence - Fixes bugreport:7607 (but blame aleos if it breaks something - he helped me) Some code cleanup git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17301 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
69508a5ffc
commit
1b5e1a8f8f
@ -1423,8 +1423,7 @@ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int
|
|||||||
weapon = sd->weapontype1;
|
weapon = sd->weapontype1;
|
||||||
else
|
else
|
||||||
weapon = sd->weapontype2;
|
weapon = sd->weapontype2;
|
||||||
switch(weapon)
|
switch(weapon) {
|
||||||
{
|
|
||||||
case W_1HSWORD:
|
case W_1HSWORD:
|
||||||
#ifdef RENEWAL
|
#ifdef RENEWAL
|
||||||
if((skill = pc_checkskill(sd,AM_AXEMASTERY)) > 0)
|
if((skill = pc_checkskill(sd,AM_AXEMASTERY)) > 0)
|
||||||
@ -1516,10 +1515,8 @@ static int battle_calc_base_damage(struct status_data *status, struct weapon_atk
|
|||||||
short type = 0;
|
short type = 0;
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
|
|
||||||
if (!sd)
|
if (!sd) { //Mobs/Pets
|
||||||
{ //Mobs/Pets
|
if(flag&4) {
|
||||||
if(flag&4)
|
|
||||||
{
|
|
||||||
atkmin = status->matk_min;
|
atkmin = status->matk_min;
|
||||||
atkmax = status->matk_max;
|
atkmax = status->matk_max;
|
||||||
} else {
|
} else {
|
||||||
@ -1532,8 +1529,7 @@ static int battle_calc_base_damage(struct status_data *status, struct weapon_atk
|
|||||||
atkmax = wa->atk;
|
atkmax = wa->atk;
|
||||||
type = (wa == &status->lhw)?EQI_HAND_L:EQI_HAND_R;
|
type = (wa == &status->lhw)?EQI_HAND_L:EQI_HAND_R;
|
||||||
|
|
||||||
if (!(flag&1) || (flag&2))
|
if (!(flag&1) || (flag&2)) { //Normal attacks
|
||||||
{ //Normal attacks
|
|
||||||
atkmin = status->dex;
|
atkmin = status->dex;
|
||||||
|
|
||||||
if (sd->equip_index[type] >= 0 && sd->inventory_data[sd->equip_index[type]])
|
if (sd->equip_index[type] >= 0 && sd->inventory_data[sd->equip_index[type]])
|
||||||
@ -1542,8 +1538,7 @@ static int battle_calc_base_damage(struct status_data *status, struct weapon_atk
|
|||||||
if (atkmin > atkmax)
|
if (atkmin > atkmax)
|
||||||
atkmin = atkmax;
|
atkmin = atkmax;
|
||||||
|
|
||||||
if(flag&2 && !(flag&16))
|
if(flag&2 && !(flag&16)) { //Bows
|
||||||
{ //Bows
|
|
||||||
atkmin = atkmin*atkmax/100;
|
atkmin = atkmin*atkmax/100;
|
||||||
if (atkmin > atkmax)
|
if (atkmin > atkmax)
|
||||||
atkmax = atkmin;
|
atkmax = atkmin;
|
||||||
@ -1560,8 +1555,7 @@ static int battle_calc_base_damage(struct status_data *status, struct weapon_atk
|
|||||||
else
|
else
|
||||||
damage = atkmax;
|
damage = atkmax;
|
||||||
|
|
||||||
if (sd)
|
if (sd) {
|
||||||
{
|
|
||||||
//rodatazone says the range is 0~arrow_atk-1 for non crit
|
//rodatazone says the range is 0~arrow_atk-1 for non crit
|
||||||
if (flag&2 && sd->bonus.arrow_atk)
|
if (flag&2 && sd->bonus.arrow_atk)
|
||||||
damage += ( (flag&1) ? sd->bonus.arrow_atk : rnd()%sd->bonus.arrow_atk );
|
damage += ( (flag&1) ? sd->bonus.arrow_atk : rnd()%sd->bonus.arrow_atk );
|
||||||
@ -1576,6 +1570,10 @@ static int battle_calc_base_damage(struct status_data *status, struct weapon_atk
|
|||||||
//Finally, add baseatk
|
//Finally, add baseatk
|
||||||
if(flag&4)
|
if(flag&4)
|
||||||
damage += status->matk_min;
|
damage += status->matk_min;
|
||||||
|
#ifdef RENEWAL
|
||||||
|
else if(flag&32)
|
||||||
|
damage += status->matk_min + status->batk;
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
damage += status->batk;
|
damage += status->batk;
|
||||||
|
|
||||||
@ -1879,30 +1877,14 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
|
|||||||
}
|
}
|
||||||
else if(sc && sc->data[SC_FEARBREEZE] && sd->weapontype1==W_BOW
|
else if(sc && sc->data[SC_FEARBREEZE] && sd->weapontype1==W_BOW
|
||||||
&& (i = sd->equip_index[EQI_AMMO]) >= 0 && sd->inventory_data[i] && sd->status.inventory[i].amount > 1){
|
&& (i = sd->equip_index[EQI_AMMO]) >= 0 && sd->inventory_data[i] && sd->status.inventory[i].amount > 1){
|
||||||
int chance = rand()%100;
|
int chance = rnd()%100;
|
||||||
wd.type = 0x08;
|
wd.type = 0x08;
|
||||||
switch(sc->data[SC_FEARBREEZE]->val1) {
|
switch(sc->data[SC_FEARBREEZE]->val1) {
|
||||||
case 5:
|
case 5: if( chance < 4) { wd.div_ = 5; break; } // 3 % chance to attack 5 times.
|
||||||
if( chance < 3){// 3 % chance to attack 5 times.
|
case 4: if( chance < 7) { wd.div_ = 4; break; } // 6 % chance to attack 4 times.
|
||||||
wd.div_ = 5;
|
case 3: if( chance < 10) { wd.div_ = 3; break; } // 9 % chance to attack 3 times.
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4:
|
|
||||||
if( chance < 7){// 6 % chance to attack 4 times.
|
|
||||||
wd.div_ = 4;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
if( chance < 10){// 9 % chance to attack 3 times.
|
|
||||||
wd.div_ = 3;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1: if( chance < 13) { wd.div_ = 2; break; } // 12 % chance to attack 2 times.
|
||||||
if( chance < 13){// 12 % chance to attack 2 times.
|
|
||||||
wd.div_ = 2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
wd.div_ = min(wd.div_,sd->status.inventory[i].amount);
|
wd.div_ = min(wd.div_,sd->status.inventory[i].amount);
|
||||||
sc->data[SC_FEARBREEZE]->val4 = wd.div_-1;
|
sc->data[SC_FEARBREEZE]->val4 = wd.div_-1;
|
||||||
@ -2161,7 +2143,11 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
|
|||||||
{
|
{
|
||||||
i = (flag.cri?1:0)|
|
i = (flag.cri?1:0)|
|
||||||
(flag.arrow?2:0)|
|
(flag.arrow?2:0)|
|
||||||
|
#ifndef RENEWAL
|
||||||
(skill_id == HW_MAGICCRASHER?4:0)|
|
(skill_id == HW_MAGICCRASHER?4:0)|
|
||||||
|
#else
|
||||||
|
(skill_id == HW_MAGICCRASHER?32:0)|
|
||||||
|
#endif
|
||||||
(!skill_id && sc && sc->data[SC_CHANGE]?4:0)|
|
(!skill_id && sc && sc->data[SC_CHANGE]?4:0)|
|
||||||
(skill_id == MO_EXTREMITYFIST?8:0)|
|
(skill_id == MO_EXTREMITYFIST?8:0)|
|
||||||
(sc && sc->data[SC_WEAPONPERFECTION]?8:0);
|
(sc && sc->data[SC_WEAPONPERFECTION]?8:0);
|
||||||
|
@ -12066,11 +12066,10 @@ void clif_parse_GuildChangeNotice(int fd, struct map_session_data* sd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Helper function for guild invite functions
|
// Helper function for guild invite functions
|
||||||
int
|
int clif_sub_guild_invite(int fd, struct map_session_data *sd, struct map_session_data *t_sd)
|
||||||
clif_sub_guild_invite(int fd, struct map_session_data *sd, struct map_session_data *t_sd) {
|
{
|
||||||
if (t_sd == NULL) {// not online or does not exist
|
if (t_sd == NULL) // not online or does not exist
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
if (map[sd->bl.m].flag.guildlock) {//Guild locked.
|
if (map[sd->bl.m].flag.guildlock) {//Guild locked.
|
||||||
clif_displaymessage(fd, msg_txt(sd,228));
|
clif_displaymessage(fd, msg_txt(sd,228));
|
||||||
|
@ -2109,8 +2109,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
status = &md->status;
|
status = &md->status;
|
||||||
sc = &md->sc;
|
sc = &md->sc;
|
||||||
|
|
||||||
if( src && src->type == BL_PC )
|
if( src && src->type == BL_PC ) {
|
||||||
{
|
|
||||||
sd = (struct map_session_data *)src;
|
sd = (struct map_session_data *)src;
|
||||||
mvp_sd = sd;
|
mvp_sd = sd;
|
||||||
}
|
}
|
||||||
@ -2118,10 +2117,11 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
if( md->guardian_data && md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS )
|
if( md->guardian_data && md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS )
|
||||||
guild_castledatasave(md->guardian_data->castle->castle_id, 10+md->guardian_data->number,0);
|
guild_castledatasave(md->guardian_data->castle->castle_id, 10+md->guardian_data->number,0);
|
||||||
|
|
||||||
if( src )
|
if( src ) { // Use Dead skill only if not killed by Script or Command
|
||||||
{ // Use Dead skill only if not killed by Script or Command
|
md->status.hp = 1;
|
||||||
md->state.skillstate = MSS_DEAD;
|
md->state.skillstate = MSS_DEAD;
|
||||||
mobskill_use(md,tick,-1);
|
mobskill_use(md,tick,-1);
|
||||||
|
md->status.hp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
map_freeblock_lock();
|
map_freeblock_lock();
|
||||||
@ -2133,8 +2133,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
|
|
||||||
// filter out entries not eligible for exp distribution
|
// filter out entries not eligible for exp distribution
|
||||||
memset(tmpsd,0,sizeof(tmpsd));
|
memset(tmpsd,0,sizeof(tmpsd));
|
||||||
for(i = 0, count = 0, mvp_damage = 0; i < DAMAGELOG_SIZE && md->dmglog[i].id; i++)
|
for(i = 0, count = 0, mvp_damage = 0; i < DAMAGELOG_SIZE && md->dmglog[i].id; i++) {
|
||||||
{
|
|
||||||
struct map_session_data* tsd = map_charid2sd(md->dmglog[i].id);
|
struct map_session_data* tsd = map_charid2sd(md->dmglog[i].id);
|
||||||
|
|
||||||
if(tsd == NULL)
|
if(tsd == NULL)
|
||||||
@ -2168,8 +2167,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
// determines, if the monster was killed by homunculus' damage only
|
// determines, if the monster was killed by homunculus' damage only
|
||||||
homkillonly = (bool)( ( dmgbltypes&BL_HOM ) && !( dmgbltypes&~BL_HOM ) );
|
homkillonly = (bool)( ( dmgbltypes&BL_HOM ) && !( dmgbltypes&~BL_HOM ) );
|
||||||
|
|
||||||
if(!battle_config.exp_calc_type && count > 1)
|
if(!battle_config.exp_calc_type && count > 1) { //Apply first-attacker 200% exp share bonus
|
||||||
{ //Apply first-attacker 200% exp share bonus
|
|
||||||
//TODO: Determine if this should go before calculating the MVP player instead of after.
|
//TODO: Determine if this should go before calculating the MVP player instead of after.
|
||||||
if (UINT_MAX - md->dmglog[0].dmg > md->tdmg) {
|
if (UINT_MAX - md->dmglog[0].dmg > md->tdmg) {
|
||||||
md->tdmg += md->dmglog[0].dmg;
|
md->tdmg += md->dmglog[0].dmg;
|
||||||
@ -2287,8 +2285,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
if(base_exp && md->dmglog[i].flag == MDLF_HOMUN) //tmpsd[i] is null if it has no homunc.
|
if(base_exp && md->dmglog[i].flag == MDLF_HOMUN) //tmpsd[i] is null if it has no homunc.
|
||||||
merc_hom_gainexp(tmpsd[i]->hd, base_exp);
|
merc_hom_gainexp(tmpsd[i]->hd, base_exp);
|
||||||
if(flag) {
|
if(flag) {
|
||||||
if(base_exp || job_exp)
|
if(base_exp || job_exp) {
|
||||||
{
|
|
||||||
if( md->dmglog[i].flag != MDLF_PET || battle_config.pet_attack_exp_to_master ) {
|
if( md->dmglog[i].flag != MDLF_PET || battle_config.pet_attack_exp_to_master ) {
|
||||||
#ifdef RENEWAL_EXP
|
#ifdef RENEWAL_EXP
|
||||||
int rate = pc_level_penalty_mod(tmpsd[i], md->level, md->status.race, md->status.mode, 1);
|
int rate = pc_level_penalty_mod(tmpsd[i], md->level, md->status.race, md->status.mode, 1);
|
||||||
@ -2332,8 +2329,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
dlist->third_charid = (third_sd ? third_sd->status.char_id : 0);
|
dlist->third_charid = (third_sd ? third_sd->status.char_id : 0);
|
||||||
dlist->item = NULL;
|
dlist->item = NULL;
|
||||||
|
|
||||||
for (i = 0; i < MAX_MOB_DROP; i++)
|
for (i = 0; i < MAX_MOB_DROP; i++) {
|
||||||
{
|
|
||||||
if (md->db->dropitem[i].nameid <= 0)
|
if (md->db->dropitem[i].nameid <= 0)
|
||||||
continue;
|
continue;
|
||||||
if ( !(it = itemdb_exists(md->db->dropitem[i].nameid)) )
|
if ( !(it = itemdb_exists(md->db->dropitem[i].nameid)) )
|
||||||
@ -2346,8 +2342,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// change drops depending on monsters size [Valaris]
|
// change drops depending on monsters size [Valaris]
|
||||||
if (battle_config.mob_size_influence)
|
if (battle_config.mob_size_influence) {
|
||||||
{
|
|
||||||
if (md->special_state.size == SZ_MEDIUM && drop_rate >= 2)
|
if (md->special_state.size == SZ_MEDIUM && drop_rate >= 2)
|
||||||
drop_rate /= 2;
|
drop_rate /= 2;
|
||||||
else if( md->special_state.size == SZ_BIG)
|
else if( md->special_state.size == SZ_BIG)
|
||||||
@ -2408,8 +2403,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
if(sd) {
|
if(sd) {
|
||||||
// process script-granted extra drop bonuses
|
// process script-granted extra drop bonuses
|
||||||
int itemid = 0;
|
int itemid = 0;
|
||||||
for (i = 0; i < ARRAYLENGTH(sd->add_drop) && (sd->add_drop[i].id || sd->add_drop[i].group); i++)
|
for (i = 0; i < ARRAYLENGTH(sd->add_drop) && (sd->add_drop[i].id || sd->add_drop[i].group); i++) {
|
||||||
{
|
|
||||||
if ( sd->add_drop[i].race == -md->class_ ||
|
if ( sd->add_drop[i].race == -md->class_ ||
|
||||||
( sd->add_drop[i].race > 0 && (
|
( sd->add_drop[i].race > 0 && (
|
||||||
sd->add_drop[i].race & (1<<status->race) ||
|
sd->add_drop[i].race & (1<<status->race) ||
|
||||||
@ -2554,7 +2548,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
|
|
||||||
rebirth = ( md->sc.data[SC_KAIZEL] || (md->sc.data[SC_REBIRTH] && !md->state.rebirth) );
|
rebirth = ( md->sc.data[SC_KAIZEL] || (md->sc.data[SC_REBIRTH] && !md->state.rebirth) );
|
||||||
if( !rebirth ) { // Only trigger event on final kill
|
if( !rebirth ) { // Only trigger event on final kill
|
||||||
md->status.hp = 0; //So that npc_event invoked functions KNOW that mob is dead
|
|
||||||
if( src ) {
|
if( src ) {
|
||||||
switch( src->type ) { //allowed type
|
switch( src->type ) { //allowed type
|
||||||
case BL_PET:
|
case BL_PET:
|
||||||
@ -2600,8 +2593,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
pc_setparam(mvp_sd, SP_KILLEDRID, md->class_);
|
pc_setparam(mvp_sd, SP_KILLEDRID, md->class_);
|
||||||
npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
|
npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
|
||||||
}
|
}
|
||||||
|
|
||||||
md->status.hp = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(md->deletetimer != INVALID_TIMER) {
|
if(md->deletetimer != INVALID_TIMER) {
|
||||||
|
59
src/map/pc.c
59
src/map/pc.c
@ -6620,18 +6620,8 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
|
|||||||
duel_reject(sd->duel_invite, sd);
|
duel_reject(sd->duel_invite, sd);
|
||||||
}
|
}
|
||||||
|
|
||||||
pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
|
|
||||||
pc_setparam(sd, SP_KILLERRID, src?src->id:0);
|
|
||||||
|
|
||||||
if( sd->bg_id ) {
|
|
||||||
struct battleground_data *bg;
|
|
||||||
if( (bg = bg_team_search(sd->bg_id)) != NULL && bg->die_event[0] )
|
|
||||||
npc_event(sd, bg->die_event, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear anything NPC-related when you die and was interacting with one.
|
// Clear anything NPC-related when you die and was interacting with one.
|
||||||
if (sd->npc_id)
|
if (sd->npc_id) {
|
||||||
{
|
|
||||||
if (sd->state.using_fake_npc) {
|
if (sd->state.using_fake_npc) {
|
||||||
clif_clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
|
clif_clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
|
||||||
sd->state.using_fake_npc = 0;
|
sd->state.using_fake_npc = 0;
|
||||||
@ -6646,14 +6636,24 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
|
|||||||
sd->st->state = END;
|
sd->st->state = END;
|
||||||
}
|
}
|
||||||
|
|
||||||
npc_script_event(sd,NPCE_DIE);
|
|
||||||
|
|
||||||
/* e.g. not killed thru pc_damage */
|
/* e.g. not killed thru pc_damage */
|
||||||
if( pc_issit(sd) ) {
|
if( pc_issit(sd) ) {
|
||||||
clif_status_load(&sd->bl,SI_SIT,0);
|
clif_status_load(&sd->bl,SI_SIT,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pc_setdead(sd);
|
pc_setdead(sd);
|
||||||
|
|
||||||
|
pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
|
||||||
|
pc_setparam(sd, SP_KILLERRID, src?src->id:0);
|
||||||
|
|
||||||
|
if( sd->bg_id ) {
|
||||||
|
struct battleground_data *bg;
|
||||||
|
if( (bg = bg_team_search(sd->bg_id)) != NULL && bg->die_event[0] )
|
||||||
|
npc_event(sd, bg->die_event, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
npc_script_event(sd,NPCE_DIE);
|
||||||
|
|
||||||
//Reset menu skills/item skills
|
//Reset menu skills/item skills
|
||||||
if (sd->skillitem)
|
if (sd->skillitem)
|
||||||
sd->skillitem = sd->skillitemlv = 0;
|
sd->skillitem = sd->skillitemlv = 0;
|
||||||
@ -6699,8 +6699,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src && src->type == BL_PC)
|
if (src && src->type == BL_PC) {
|
||||||
{
|
|
||||||
struct map_session_data *ssd = (struct map_session_data *)src;
|
struct map_session_data *ssd = (struct map_session_data *)src;
|
||||||
pc_setparam(ssd, SP_KILLEDRID, sd->bl.id);
|
pc_setparam(ssd, SP_KILLEDRID, sd->bl.id);
|
||||||
npc_script_event(ssd, NPCE_KILLPC);
|
npc_script_event(ssd, NPCE_KILLPC);
|
||||||
@ -6750,8 +6749,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// activate Steel body if a super novice dies at 99+% exp [celest]
|
// activate Steel body if a super novice dies at 99+% exp [celest]
|
||||||
if ((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && !sd->state.snovice_dead_flag)
|
if ((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && !sd->state.snovice_dead_flag) {
|
||||||
{
|
|
||||||
unsigned int next = pc_nextbaseexp(sd);
|
unsigned int next = pc_nextbaseexp(sd);
|
||||||
if( next == 0 ) next = pc_thisbaseexp(sd);
|
if( next == 0 ) next = pc_thisbaseexp(sd);
|
||||||
if( get_percentage(sd->status.base_exp,next) >= 99 ) {
|
if( get_percentage(sd->status.base_exp,next) >= 99 ) {
|
||||||
@ -6791,8 +6789,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
|
|||||||
clif_updatestatus(sd,SP_BASEEXP);
|
clif_updatestatus(sd,SP_BASEEXP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(battle_config.death_penalty_job > 0)
|
if(battle_config.death_penalty_job > 0) {
|
||||||
{
|
|
||||||
base_penalty = 0;
|
base_penalty = 0;
|
||||||
switch (battle_config.death_penalty_type) {
|
switch (battle_config.death_penalty_type) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -6809,16 +6806,14 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
|
|||||||
clif_updatestatus(sd,SP_JOBEXP);
|
clif_updatestatus(sd,SP_JOBEXP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(battle_config.zeny_penalty > 0 && !map[sd->bl.m].flag.nozenypenalty)
|
if(battle_config.zeny_penalty > 0 && !map[sd->bl.m].flag.nozenypenalty) {
|
||||||
{
|
|
||||||
base_penalty = (unsigned int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.);
|
base_penalty = (unsigned int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.);
|
||||||
if(base_penalty)
|
if(base_penalty)
|
||||||
pc_payzeny(sd, base_penalty, LOG_TYPE_PICKDROP_PLAYER, NULL);
|
pc_payzeny(sd, base_penalty, LOG_TYPE_PICKDROP_PLAYER, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(map[sd->bl.m].flag.pvp_nightmaredrop)
|
if(map[sd->bl.m].flag.pvp_nightmaredrop) { // Moved this outside so it works when PVP isn't enabled and during pk mode [Ancyker]
|
||||||
{ // Moved this outside so it works when PVP isn't enabled and during pk mode [Ancyker]
|
|
||||||
for(j=0;j<MAX_DROP_PER_MAP;j++){
|
for(j=0;j<MAX_DROP_PER_MAP;j++){
|
||||||
int id = map[sd->bl.m].drop_list[j].drop_id;
|
int id = map[sd->bl.m].drop_list[j].drop_id;
|
||||||
int type = map[sd->bl.m].drop_list[j].drop_type;
|
int type = map[sd->bl.m].drop_list[j].drop_type;
|
||||||
@ -6868,33 +6863,27 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
|
|||||||
}
|
}
|
||||||
// pvp
|
// pvp
|
||||||
// disable certain pvp functions on pk_mode [Valaris]
|
// 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 )
|
if( map[sd->bl.m].flag.pvp && !battle_config.pk_mode && !map[sd->bl.m].flag.pvp_nocalcrank ) {
|
||||||
{
|
|
||||||
sd->pvp_point -= 5;
|
sd->pvp_point -= 5;
|
||||||
sd->pvp_lost++;
|
sd->pvp_lost++;
|
||||||
if( src && src->type == BL_PC )
|
if( src && src->type == BL_PC ) {
|
||||||
{
|
|
||||||
struct map_session_data *ssd = (struct map_session_data *)src;
|
struct map_session_data *ssd = (struct map_session_data *)src;
|
||||||
ssd->pvp_point++;
|
ssd->pvp_point++;
|
||||||
ssd->pvp_won++;
|
ssd->pvp_won++;
|
||||||
}
|
}
|
||||||
if( sd->pvp_point < 0 )
|
if( sd->pvp_point < 0 ) {
|
||||||
{
|
|
||||||
add_timer(tick+1000, pc_respawn_timer,sd->bl.id,0);
|
add_timer(tick+1000, pc_respawn_timer,sd->bl.id,0);
|
||||||
return 1|8;
|
return 1|8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//GvG
|
//GvG
|
||||||
if( map_flag_gvg(sd->bl.m) )
|
if( map_flag_gvg(sd->bl.m) ) {
|
||||||
{
|
|
||||||
add_timer(tick+1000, pc_respawn_timer, sd->bl.id, 0);
|
add_timer(tick+1000, pc_respawn_timer, sd->bl.id, 0);
|
||||||
return 1|8;
|
return 1|8;
|
||||||
}
|
}
|
||||||
else if( sd->bg_id )
|
else if( sd->bg_id ) {
|
||||||
{
|
|
||||||
struct battleground_data *bg = bg_team_search(sd->bg_id);
|
struct battleground_data *bg = bg_team_search(sd->bg_id);
|
||||||
if( bg && bg->mapindex > 0 )
|
if( bg && bg->mapindex > 0 ) { // Respawn by BG
|
||||||
{ // Respawn by BG
|
|
||||||
add_timer(tick+1000, pc_respawn_timer, sd->bl.id, 0);
|
add_timer(tick+1000, pc_respawn_timer, sd->bl.id, 0);
|
||||||
return 1|8;
|
return 1|8;
|
||||||
}
|
}
|
||||||
|
@ -12243,8 +12243,7 @@ int skill_unit_onout (struct skill_unit *src, struct block_list *bl, unsigned in
|
|||||||
case UNT_SPIDERWEB:
|
case UNT_SPIDERWEB:
|
||||||
{
|
{
|
||||||
struct block_list *target = map_id2bl(sg->val2);
|
struct block_list *target = map_id2bl(sg->val2);
|
||||||
if (target && target==bl)
|
if (target && target==bl) {
|
||||||
{
|
|
||||||
if (sce && sce->val3 == sg->group_id)
|
if (sce && sce->val3 == sg->group_id)
|
||||||
status_change_end(bl, type, INVALID_TIMER);
|
status_change_end(bl, type, INVALID_TIMER);
|
||||||
sg->limit = DIFF_TICK(tick,sg->tick)+1000;
|
sg->limit = DIFF_TICK(tick,sg->tick)+1000;
|
||||||
@ -12264,6 +12263,16 @@ int skill_unit_onout (struct skill_unit *src, struct block_list *bl, unsigned in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case UNT_WHISTLE:
|
||||||
|
case UNT_ASSASSINCROSS:
|
||||||
|
case UNT_POEMBRAGI:
|
||||||
|
case UNT_APPLEIDUN:
|
||||||
|
case UNT_HUMMING:
|
||||||
|
case UNT_DONTFORGETME:
|
||||||
|
case UNT_FORTUNEKISS:
|
||||||
|
case UNT_SERVICEFORYOU:
|
||||||
|
if (sg->src_id==bl->id && !(sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER))
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
return sg->skill_id;
|
return sg->skill_id;
|
||||||
}
|
}
|
||||||
@ -12430,14 +12439,15 @@ static int skill_unit_effect (struct block_list* bl, va_list ap)
|
|||||||
if( isTarget ){
|
if( isTarget ){
|
||||||
if( flag&1 )
|
if( flag&1 )
|
||||||
skill_unit_onplace(unit,bl,tick);
|
skill_unit_onplace(unit,bl,tick);
|
||||||
else
|
else {
|
||||||
skill_unit_onout(unit,bl,tick);
|
if( skill_unit_onout(unit,bl,tick) == -1 )
|
||||||
|
return 0; // Don't let a Bard/Dancer update their own song timer
|
||||||
|
}
|
||||||
|
|
||||||
if( flag&4 )
|
if( flag&4 )
|
||||||
skill_unit_onleft(skill_id, bl, tick);
|
skill_unit_onleft(skill_id, bl, tick);
|
||||||
}else if( !isTarget && flag&4 && ( group->state.song_dance&0x1 || ( group->src_id == bl->id && group->state.song_dance&0x2 ) ) ){
|
} else if( !isTarget && flag&4 && ( group->state.song_dance&0x1 || ( group->src_id == bl->id && group->state.song_dance&0x2 ) ) )
|
||||||
skill_unit_onleft(skill_id, bl, tick);//Ensemble check to terminate it.
|
skill_unit_onleft(skill_id, bl, tick);//Ensemble check to terminate it.
|
||||||
}
|
|
||||||
|
|
||||||
if( dissonance ) {
|
if( dissonance ) {
|
||||||
skill_dance_switch(unit, 1);
|
skill_dance_switch(unit, 1);
|
||||||
@ -15959,7 +15969,6 @@ int skill_unit_move_sub (struct block_list* bl, va_list ap) {
|
|||||||
else
|
else
|
||||||
ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n");
|
ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( flag&4 )
|
if( flag&4 )
|
||||||
@ -15969,24 +15978,17 @@ int skill_unit_move_sub (struct block_list* bl, va_list ap) {
|
|||||||
if( dissonance ) skill_dance_switch(unit, 1);
|
if( dissonance ) skill_dance_switch(unit, 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else {
|
||||||
else
|
if( flag&1 ) {
|
||||||
{
|
|
||||||
if( flag&1 )
|
|
||||||
{
|
|
||||||
int result = skill_unit_onplace(unit,target,tick);
|
int result = skill_unit_onplace(unit,target,tick);
|
||||||
if( flag&2 && result )
|
if( flag&2 && result ) { //Clear skill ids we have stored in onout.
|
||||||
{ //Clear skill ids we have stored in onout.
|
|
||||||
ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == result );
|
ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == result );
|
||||||
if( i < ARRAYLENGTH(skill_unit_temp) )
|
if( i < ARRAYLENGTH(skill_unit_temp) )
|
||||||
skill_unit_temp[i] = 0;
|
skill_unit_temp[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
int result = skill_unit_onout(unit,target,tick);
|
int result = skill_unit_onout(unit,target,tick);
|
||||||
if( flag&2 && result )
|
if( flag&2 && result ) { //Store this unit id.
|
||||||
{ //Store this unit id.
|
|
||||||
ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == 0 );
|
ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == 0 );
|
||||||
if( i < ARRAYLENGTH(skill_unit_temp) )
|
if( i < ARRAYLENGTH(skill_unit_temp) )
|
||||||
skill_unit_temp[i] = skill_id;
|
skill_unit_temp[i] = skill_id;
|
||||||
|
@ -1255,14 +1255,13 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
|
|||||||
unit_stop_walking( target, 1 );
|
unit_stop_walking( target, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( status->hp || (flag&8) )
|
if( status->hp || (flag&8) ) { //Still lives or has been dead before this damage.
|
||||||
{ //Still lives or has been dead before this damage.
|
|
||||||
if (walkdelay)
|
if (walkdelay)
|
||||||
unit_set_walkdelay(target, gettick(), walkdelay, 0);
|
unit_set_walkdelay(target, gettick(), walkdelay, 0);
|
||||||
return hp+sp;
|
return hp+sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
status->hp = 1; //To let the dead function cast skills and all that.
|
status->hp = 0;
|
||||||
//NOTE: These dead functions should return: [Skotlex]
|
//NOTE: These dead functions should return: [Skotlex]
|
||||||
//0: Death cancelled, auto-revived.
|
//0: Death cancelled, auto-revived.
|
||||||
//Non-zero: Standard death. Clear status, cancel move/attack, etc
|
//Non-zero: Standard death. Clear status, cancel move/attack, etc
|
||||||
@ -1283,13 +1282,11 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
|
|||||||
return hp+sp;
|
return hp+sp;
|
||||||
|
|
||||||
//Normal death
|
//Normal death
|
||||||
status->hp = 0;
|
|
||||||
if (battle_config.clear_unit_ondeath &&
|
if (battle_config.clear_unit_ondeath &&
|
||||||
battle_config.clear_unit_ondeath&target->type)
|
battle_config.clear_unit_ondeath&target->type)
|
||||||
skill_clear_unitgroup(target);
|
skill_clear_unitgroup(target);
|
||||||
|
|
||||||
if(target->type&BL_REGEN)
|
if(target->type&BL_REGEN) { //Reset regen ticks.
|
||||||
{ //Reset regen ticks.
|
|
||||||
struct regen_data *regen = status_get_regen_data(target);
|
struct regen_data *regen = status_get_regen_data(target);
|
||||||
if (regen) {
|
if (regen) {
|
||||||
memset(®en->tick, 0, sizeof(regen->tick));
|
memset(®en->tick, 0, sizeof(regen->tick));
|
||||||
@ -1300,8 +1297,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sc && sc->data[SC_KAIZEL] && !map_flag_gvg(target->m) )
|
if( sc && sc->data[SC_KAIZEL] && !map_flag_gvg(target->m) ) { //flag&8 = disable Kaizel
|
||||||
{ //flag&8 = disable Kaizel
|
|
||||||
int time = skill_get_time2(SL_KAIZEL,sc->data[SC_KAIZEL]->val1);
|
int time = skill_get_time2(SL_KAIZEL,sc->data[SC_KAIZEL]->val1);
|
||||||
//Look for Osiris Card's bonus effect on the character and revive 100% or revive normally
|
//Look for Osiris Card's bonus effect on the character and revive 100% or revive normally
|
||||||
if ( target->type == BL_PC && BL_CAST(BL_PC,target)->special_state.restart_full_recover )
|
if ( target->type == BL_PC && BL_CAST(BL_PC,target)->special_state.restart_full_recover )
|
||||||
@ -1343,8 +1339,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
|
|||||||
else
|
else
|
||||||
if(flag&2) //remove from map
|
if(flag&2) //remove from map
|
||||||
unit_remove_map(target,CLR_DEAD);
|
unit_remove_map(target,CLR_DEAD);
|
||||||
else
|
else { //Some death states that would normally be handled by unit_remove_map
|
||||||
{ //Some death states that would normally be handled by unit_remove_map
|
|
||||||
unit_stop_attack(target);
|
unit_stop_attack(target);
|
||||||
unit_stop_walking(target,1);
|
unit_stop_walking(target,1);
|
||||||
unit_skillcastcancel(target,0);
|
unit_skillcastcancel(target,0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user