diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-02-16 08:25:45 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-02-16 08:25:45 +0000 |
commit | 4431323e09b1ab9875ea8ac67f0ecd1b36420559 (patch) | |
tree | 3e45c50e0b8333a87443240bd7cd7653c9bfe948 /src/map/skill.c | |
parent | 35c7324f5f2f1a5f1dc4fa690020fcbd0c18d891 (diff) | |
download | hercules-4431323e09b1ab9875ea8ac67f0ecd1b36420559.tar.gz hercules-4431323e09b1ab9875ea8ac67f0ecd1b36420559.tar.bz2 hercules-4431323e09b1ab9875ea8ac67f0ecd1b36420559.tar.xz hercules-4431323e09b1ab9875ea8ac67f0ecd1b36420559.zip |
* Fixed a typo in quests/all_quest.txt
* Set 'killerrid' and do PCKillEvent before calling PCDieEvent
* Added some new script event related options to script config
* Added 10 of the new card effects on the 2/15's patch
* Minor rewrites on self and enemy weapon/armor breaking
* Added missing code for 'bBreakWeaponRate' and 'bBreakWeaponRate' effects
* Added missing code for 'bAddStealRate' effect
* Removed redundant 'infinite_autospell' in map_session_data
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1116 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 116 |
1 files changed, 74 insertions, 42 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 78849469c..e4b171636 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1050,7 +1050,7 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s diff = mhp*10/100; if (hp - diff < mhp>>2) diff = hp - (mhp>>2); - pc_heal((struct map_session_data *)bl, -hp, 0); + pc_heal(dstsd, -hp, 0); } else if(bl->type == BL_MOB) { struct mob_data *md = (struct mob_data *)bl; hp -= mhp*15/100; @@ -1287,59 +1287,89 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s break; } - if(sd && skillid != MC_CARTREVOLUTION && attack_type&BF_WEAPON){ /* カ?ドによる追加?果 */ + if((sd||dstsd) && skillid != MC_CARTREVOLUTION && attack_type&BF_WEAPON){ /* カ?ドによる追加?果 */ int i; int sc_def_card=100; for(i=SC_STONE;i<=SC_BLIND;i++){ //?象に?態異常 - if(i==SC_STONE || i==SC_FREEZE) - sc_def_card=sc_def_mdef; - else if(i==SC_STAN || i==SC_POISON || i==SC_SILENCE) - sc_def_card=sc_def_vit; - else if(i==SC_SLEEP || i==SC_CONFUSION || i==SC_BLIND) - sc_def_card=sc_def_int; - else if(i==SC_CURSE) - sc_def_card=sc_def_luk; - - if(!sd->state.arrow_atk) { - if(rand()%10000 < (sd->addeff[i-SC_STONE])*sc_def_card/100 ){ - if(battle_config.battle_log) - printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",sd->bl.id,i,sd->addeff[i-SC_STONE]); - status_change_start(bl,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); - } + switch (i) { + case SC_STONE: + case SC_FREEZE: + sc_def_card=sc_def_mdef; + break; + case SC_STAN: + case SC_POISON: + case SC_SILENCE: + sc_def_card=sc_def_vit; + break; + case SC_SLEEP: + case SC_CONFUSION: + case SC_BLIND: + sc_def_card=sc_def_int; + break; + case SC_CURSE: + sc_def_card=sc_def_luk; } - else { - if(rand()%10000 < (sd->addeff[i-SC_STONE]+sd->arrow_addeff[i-SC_STONE])*sc_def_card/100 ){ - if(battle_config.battle_log) - printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",sd->bl.id,i,sd->addeff[i-SC_STONE]); - status_change_start(bl,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + + if (sd) { + if(!sd->state.arrow_atk) { + if(rand()%10000 < (sd->addeff[i-SC_STONE])*sc_def_card/100 ){ + if(battle_config.battle_log) + printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",sd->bl.id,i,sd->addeff[i-SC_STONE]); + status_change_start(bl,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + } + } + else { + if(rand()%10000 < (sd->addeff[i-SC_STONE]+sd->arrow_addeff[i-SC_STONE])*sc_def_card/100 ){ + if(battle_config.battle_log) + printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",sd->bl.id,i,sd->addeff[i-SC_STONE]); + status_change_start(bl,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + } } } //自分に?態異常 - if(i==SC_STONE || i==SC_FREEZE) - sc_def_card=sc_def_mdef2; - else if(i==SC_STAN || i==SC_POISON || i==SC_SILENCE) - sc_def_card=sc_def_vit2; - else if(i==SC_SLEEP || i==SC_CONFUSION || i==SC_BLIND) - sc_def_card=sc_def_int2; - else if(i==SC_CURSE) - sc_def_card=sc_def_luk2; - - if(!sd->state.arrow_atk) { - if(rand()%10000 < (sd->addeff2[i-SC_STONE])*sc_def_card/100 ){ - if(battle_config.battle_log) - printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",src->id,i,sd->addeff2[i-SC_STONE]); - status_change_start(src,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); - } + switch (i) { + case SC_STONE: + case SC_FREEZE: + sc_def_card=sc_def_mdef2; + break; + case SC_STAN: + case SC_POISON: + case SC_SILENCE: + sc_def_card=sc_def_vit2; + break; + case SC_SLEEP: + case SC_CONFUSION: + case SC_BLIND: + sc_def_card=sc_def_int2; + break; + case SC_CURSE: + sc_def_card=sc_def_luk2; } - else { - if(rand()%10000 < (sd->addeff2[i-SC_STONE]+sd->arrow_addeff2[i-SC_STONE])*sc_def_card/100 ){ - if(battle_config.battle_log) - printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",src->id,i,sd->addeff2[i-SC_STONE]); - status_change_start(src,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + + if (sd) { + if(!sd->state.arrow_atk) { + if(rand()%10000 < (sd->addeff2[i-SC_STONE])*sc_def_card/100 ){ + if(battle_config.battle_log) + printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",src->id,i,sd->addeff2[i-SC_STONE]); + status_change_start(src,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + } + } + else { + if(rand()%10000 < (sd->addeff2[i-SC_STONE]+sd->arrow_addeff2[i-SC_STONE])*sc_def_card/100 ){ + if(battle_config.battle_log) + printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",src->id,i,sd->addeff2[i-SC_STONE]); + status_change_start(src,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + } } } + if (dstsd && + rand()%10000 < dstsd->addeff3[i-SC_STONE]*sc_def_card/100){ + if(battle_config.battle_log) + printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",src->id,i,dstsd->addeff3[i-SC_STONE]); + status_change_start(src,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + } } } return 0; @@ -3952,6 +3982,8 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if (tsc_data && tsc_data[scid].timer != -1) break; + if (dstsd && dstsd->unstripable_equip & equip) + break; strip_fix = status_get_dex(src) - status_get_dex(bl); if(strip_fix < 0) |