summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-30 11:35:02 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-30 11:35:02 +0000
commit042a8d652e4a828d01948937568373f1b1e0aeee (patch)
treeefc7875513b46cc04281a1e43b21b422ced3fbcc /src/map
parent956b9cbd7a39da9a3d88913151842751ed1e3920 (diff)
downloadhercules-042a8d652e4a828d01948937568373f1b1e0aeee.tar.gz
hercules-042a8d652e4a828d01948937568373f1b1e0aeee.tar.bz2
hercules-042a8d652e4a828d01948937568373f1b1e0aeee.tar.xz
hercules-042a8d652e4a828d01948937568373f1b1e0aeee.zip
* Fixed client crash when disguised characters die
* Fixed and finished Guild Skills (~90%) * Fixed Meltdown and Overthrust used together breaking your own weapon * Updated Weapon Repair * Fixed sp recovery problem, thanks to OutSider for pointing it out * Corrected bUnbreakable value in const.txt * Updated skill_cast_db for Meltdown git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@421 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c51
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/pc.c28
-rw-r--r--src/map/skill.c58
4 files changed, 95 insertions, 44 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 0c1fe65d2..8309bce78 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -640,7 +640,7 @@ int battle_get_atk2(struct block_list *bl)
if(sc_data[SC_NIBELUNGEN].timer!=-1 && (battle_get_element(bl)/10) >= 8 )
atk2 += sc_data[SC_NIBELUNGEN].val2;
if(sc_data[SC_STRIPWEAPON].timer!=-1)
- atk2 = atk2*90/100;
+ atk2 = atk2*sc_data[SC_STRIPWEAPON].val2/100;
if(sc_data[SC_CONCENTRATION].timer!=-1) //コンセントレーション
atk2 += atk2*(5*sc_data[SC_CONCENTRATION].val1)/100;
}
@@ -767,7 +767,7 @@ int battle_get_def(struct block_list *bl)
def = def*75/100;
//ストリップシールド時は減算
if(sc_data[SC_STRIPSHIELD].timer!=-1 && bl->type != BL_PC)
- def = def*85/100;
+ def = def*sc_data[SC_STRIPSHIELD].val2/100;
//シグナムクルシス時は減算
if(sc_data[SC_SIGNUMCRUCIS].timer!=-1 && bl->type != BL_PC)
def = def * (100 - sc_data[SC_SIGNUMCRUCIS].val2)/100;
@@ -3959,33 +3959,38 @@ struct Damage battle_calc_weapon_attack(
if(battle_config.equipment_breaking && src->type==BL_PC && (wd.damage > 0 || wd.damage2 > 0)) {
struct map_session_data *sd=(struct map_session_data *)src;
- int breakrate=1;
- if(sd->status.weapon && sd->status.weapon!=11) {
- if(target->type == BL_PC && sd->sc_data[SC_MELTDOWN].timer!=-1){
- breakrate+=100*sd->sc_data[SC_MELTDOWN].val1;
- if(rand()%10000 < breakrate*battle_config.equipment_break_rate/100 || breakrate >= 10000)
- pc_breakweapon((struct map_session_data *)target);
+ int breakrate = 0;
+
+ if(sd->status.weapon && sd->status.weapon != 11) {
+ if(sd->sc_data[SC_MELTDOWN].timer!=-1) {
+// breakrate += 100*sd->sc_data[SC_MELTDOWN].val1; // since we don't know if there are any other factors for breaking yet, [celest]
+ breakrate += 100*sd->sc_data[SC_MELTDOWN].val1;
+ if(rand()%10000 < breakrate*battle_config.equipment_break_rate/100 || breakrate >= 10000) {
+ if (target->type == BL_PC)
+ pc_breakweapon((struct map_session_data *)target);
+ else
+ skill_status_change_start(target,SC_STRIPWEAPON,1,75,0,0,skill_get_time2(WS_MELTDOWN,1),0 );
+ }
+
+ breakrate = 70*sd->sc_data[SC_MELTDOWN].val1;
+ if (rand()%10000 < breakrate*battle_config.equipment_break_rate/100 || breakrate >= 10000) {
+ if (target->type == BL_PC)
+ pc_breakarmor((struct map_session_data *)target);
+ else
+ skill_status_change_start(target,SC_STRIPSHIELD,1,75,0,0,skill_get_time2(WS_MELTDOWN,1),0 );
+ }
}
- if(sd->sc_data[SC_OVERTHRUST].timer!=-1)
- breakrate+=20*sd->sc_data[SC_OVERTHRUST].val1;
+ if(sd->sc_data[SC_OVERTHRUST].timer!=-1) {
+ breakrate = 20*sd->sc_data[SC_OVERTHRUST].val1;
//if(wd.type==0x0a) //removed! because CRITS don't affect on breaking chance [Lupus]
// breakrate*=2;
- if(rand()%10000 < breakrate*battle_config.equipment_break_rate/100 || breakrate >= 10000) {
- if(pc_breakweapon(sd)==1)
- wd = battle_calc_pc_weapon_attack(src,target,skill_num,skill_lv,wflag);
+ if(rand()%10000 < breakrate*battle_config.equipment_break_rate/100 || breakrate >= 10000) {
+ if(pc_breakweapon(sd)==1)
+ wd = battle_calc_pc_weapon_attack(src,target,skill_num,skill_lv,wflag);
+ }
}
}
}
-
- if (battle_config.equipment_breaking && target->type == BL_PC && (wd.damage > 0 || wd.damage2 > 0)) {
- int breakrate=1;
- if(src->type==BL_PC && ((struct map_session_data *)src)->sc_data[SC_MELTDOWN].timer!=-1) breakrate+=70*((struct map_session_data *)src)->sc_data[SC_MELTDOWN].val1;
- //if (wd.type==0x0a) removed! because CRITS don't affect on breaking chance [Lupus]
- // breakrate*=2;
- if (rand()%10000 < breakrate*battle_config.equipment_break_rate/100 || breakrate >= 10000) {
- pc_breakarmor((struct map_session_data *)target);
- }
- }
return wd;
}
diff --git a/src/map/map.h b/src/map/map.h
index bf443bf46..870682156 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -556,7 +556,7 @@ enum {
SP_USTR,SP_UAGI,SP_UVIT,SP_UINT,SP_UDEX,SP_ULUK,SP_26,SP_27, // 32-39
SP_28,SP_ATK1,SP_ATK2,SP_MATK1,SP_MATK2,SP_DEF1,SP_DEF2,SP_MDEF1, // 40-47
SP_MDEF2,SP_HIT,SP_FLEE1,SP_FLEE2,SP_CRITICAL,SP_ASPD,SP_36,SP_JOBLEVEL, // 48-55
- SP_UPPER,SP_PARTNER,SP_CART,SP_FAME,SP_UNBREAKABLE, //56-58
+ SP_UPPER,SP_PARTNER,SP_CART,SP_FAME,SP_UNBREAKABLE, //56-60
SP_CARTINFO=99, // 99
SP_BASEJOB=119, // 100+19 - celest
diff --git a/src/map/pc.c b/src/map/pc.c
index c9083ce03..13d1914c8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1,4 +1,4 @@
-// $Id: pc.c 101 2004-11-26 5:47:29 PM Celestia $
+// $Id: pc.c 101 2004-11-30 8:27:10 PM Celestia $
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -3462,18 +3462,29 @@ int pc_item_identify(struct map_session_data *sd,int idx)
*/
int pc_item_repair(struct map_session_data *sd,int idx)
{
- int flag=1;
+ int flag=1, material;
+ int materials[5] = { 0, 1002, 998, 999, 756 };
nullpo_retr(0, sd);
+ struct item *item = &sd->status.inventory[idx];
if(idx >= 0 && idx < MAX_INVENTORY) {
- if(sd->status.inventory[idx].nameid > 0 && sd->status.inventory[idx].attribute == 1 ) {
+ if(item->nameid > 0 && item->attribute == 1 ) {
+ if (itemdb_type(item->nameid)==4)
+ material = materials [itemdb_wlv (item->nameid)];
+ else
+ material = materials [3];
+
+ if (pc_search_inventory(sd, material) < 0 ) { //fixed by Lupus (item pos can be = 0!)
+ clif_skill_fail(sd,sd->skillid,0,0);
+ return 0;
+ }
flag=0;
- sd->status.inventory[idx].attribute=0;
+ item->attribute=0;
//Temporary Weapon Repair code [DracoRPG]
- pc_delitem(sd, pc_search_inventory(sd, 999), 1, 0);
+ pc_delitem(sd, pc_search_inventory(sd, material), 1, 0);
clif_equiplist(sd);
- clif_produceeffect(sd, 0, sd->status.inventory[idx].nameid);
+ clif_produceeffect(sd, 0, item->nameid);
clif_misceffect(&sd->bl, 3);
clif_displaymessage(sd->fd,"Item has been repaired.");
}
@@ -5353,7 +5364,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
return 0;
}
sd->status.hp = 0;
- pc_setdead(sd);
+ //pc_setdead(sd);
if(sd->vender_id)
vending_closevending(sd);
@@ -5369,6 +5380,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
pc_stop_walking(sd,0);
skill_castcancel(&sd->bl,0); // 詠唱の中止
clif_clearchar_area(&sd->bl,1);
+ pc_setdead(sd);
skill_unit_out_all(&sd->bl,gettick(),1);
if(sd->sc_data[SC_BLADESTOP].timer!=-1)//白刃は事前に解除
skill_status_change_end(&sd->bl,SC_BLADESTOP,-1);
@@ -7219,7 +7231,7 @@ static int pc_natural_heal_sp(struct map_session_data *sd)
bsp=sd->status.sp;
inc_num = pc_spheal(sd);
- if(sd->sc_count && sd->sc_data[SC_EXPLOSIONSPIRITS].timer == -1)
+ if(sd->sc_data[SC_EXPLOSIONSPIRITS].timer == -1)
sd->sp_sub += inc_num;
if(sd->walktimer == -1)
sd->inchealsptick += natural_heal_diff_tick;
diff --git a/src/map/skill.c b/src/map/skill.c
index 6cc9e7a8a..7676a1380 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1,4 +1,4 @@
-// $Id: skill.c,v 1.8 2004/11/26 7:12:23 PM Celestia Exp $
+// $Id: skill.c,v 1.8 2004/11/30 8:26:49 PM Celestia Exp $
/* スキル?係 */
#include <stdio.h>
@@ -24,6 +24,7 @@
#include "log.h"
#include "chrif.h"
#include "guild.h"
+#include "showmsg.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -398,6 +399,10 @@ const struct skill_name_db skill_names[] = {
{ DC_SERVICEFORYOU, "SERVICEFORYOU", "Prostitute" } ,
{ DC_THROWARROW, "THROWARROW", "Throw_Arrow" } ,
{ DC_UGLYDANCE, "UGLYDANCE", "Ugly_Dance" } ,
+ { GD_BATTLEORDER, "BATTLEORDER", "Battle_Orders" } ,
+ { GD_REGENERATION, "REGENERATION", "Regeneration" } ,
+ { GD_RESTORE, "RESTORE", "Restore" } ,
+ { GD_EMERGENCYCALL, "EMERGENCYCALL", "Emergency_Call" } ,
{ HP_ASSUMPTIO, "ASSUMPTIO", "Assumptio" } ,
{ HP_BASILICA, "BASILICA", "Basilica" } ,
{ HP_MEDITATIO, "MEDITATIO", "Meditation" } ,
@@ -832,6 +837,10 @@ int skill_get_castnodex( int id ,int lv ){
if (id >= 10000 && id < 10015) id-= 9500;
return (lv <= 0) ? 0:skill_db[id].castnodex[lv-1];
}
+int skill_get_nocast ( int id ){
+ if (id >= 10000 && id < 10015) id-= 9500;
+ return skill_db[id].nocast;
+}
int skill_tree_get_max(int id, int b_class){
struct pc_base_job s_class = pc_calc_base_job(b_class);
int i, skillid;
@@ -861,15 +870,15 @@ int skillnotok(int skillid, struct map_session_data *sd) {
return 0; // gm's can do anything damn thing they want
// Check skill restrictions [Celest]
- if(!map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.gvg && skill_db[skillid].nocast & 1)
+ if(!map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.gvg && skill_get_nocast (skillid) & 1)
return 1;
- if(map[sd->bl.m].flag.pvp && skill_db[skillid].nocast & 2)
+ if(map[sd->bl.m].flag.pvp && skill_get_nocast (skillid) & 2)
return 1;
- if(map[sd->bl.m].flag.gvg && skill_db[skillid].nocast & 4)
+ if(map[sd->bl.m].flag.gvg && skill_get_nocast (skillid) & 4)
return 1;
- if (agit_flag && skill_db[skillid].nocast & 8)
+ if (agit_flag && skill_get_nocast (skillid) & 8)
return 1;
- if (battle_config.pk_mode && !map[sd->bl.m].flag.nopvp && skill_db[skillid].nocast & 16)
+ if (battle_config.pk_mode && !map[sd->bl.m].flag.nopvp && skill_get_nocast (skillid) & 16)
return 1;
switch (skillid) {
@@ -3727,11 +3736,11 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case BS_REPAIRWEAPON: /* 武器修理 */
if(sd) {
//動作しないのでとりあえずコメントアウト
- if (pc_search_inventory(sd, 999) < 0 ) { //fixed by Lupus (item pos can be = 0!)
+ /*if (pc_search_inventory(sd, 999) < 0 ) { //fixed by Lupus (item pos can be = 0!)
clif_skill_fail(sd,sd->skillid,0,0);
map_freeblock_unlock();
return 1;
- }
+ }*/
clif_item_repair_list(sd);
}
break;
@@ -5422,9 +5431,14 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,
case GD_SOULCOLD:
case GD_HAWKEYES:
range=2;
- target=BCT_NOENEMY;
- limit=600000;
+ target=BCT_ALL;
+ limit=60000;
break;
+
+ default:
+ if(battle_config.error_log)
+ printf ("skill_unitsetting: Unknown skill id = %d\n",skillid);
+ return 0;
}
nullpo_retr(NULL, group=skill_initunitgroup(src,count,skillid,skilllv,skill_get_unit_id(skillid,flag&1)));
@@ -9380,8 +9394,12 @@ int skill_status_change_start(struct block_list *bl, int type, int val1, int val
val2=10+val1*3;
break;
case SC_STRIPWEAPON:
+ if (val2==0) val2=90;
+ break;
case SC_STRIPSHIELD:
- case SC_STRIPARMOR:
+ if (val2==0) val2=85;
+ break;
+ case SC_STRIPARMOR:
case SC_STRIPHELM:
case SC_CP_WEAPON:
case SC_CP_SHIELD:
@@ -10549,7 +10567,21 @@ int skill_unit_timer_sub( struct block_list *bl, va_list ap )
map_addflooritem(&item_tmp,1,bl->m,bl->x,bl->y,NULL,NULL,NULL,0); // ?返還
}
}
+ skill_delunit(unit);
}
+ break;
+
+ case 0xc1:
+ case 0xc2:
+ case 0xc3:
+ case 0xc4:
+ {
+ struct block_list *src=map_id2bl(group->src_id);
+ if (src)
+ group->tick = tick;
+ }
+ break;
+
default:
skill_delunit(unit);
}
@@ -11605,7 +11637,9 @@ int skill_readdb(void)
if(split[0]==NULL)
continue;
i=atoi(split[0]);
- if(i < 0 || i > MAX_SKILL_DB)
+ if (i>=10000 && i<10015) // for guild skills [Celest]
+ i -= 9500;
+ else if(i<0 || i>MAX_SKILL_DB)
continue;
skill_db[i].nocast=atoi(split[1]);
k++;