summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-11 13:29:43 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-11 13:29:43 +0000
commitf3622e18550ba50d694129391612c7b48e826107 (patch)
tree0f7ce492f2e6c26fa3fb05717be0ea099eeffca1 /src/map
parent542ad876951945fccf8687618e380e9e60ff25ee (diff)
downloadhercules-f3622e18550ba50d694129391612c7b48e826107.tar.gz
hercules-f3622e18550ba50d694129391612c7b48e826107.tar.bz2
hercules-f3622e18550ba50d694129391612c7b48e826107.tar.xz
hercules-f3622e18550ba50d694129391612c7b48e826107.zip
* Fixed TaTaMiGaEShi(Improvised Defense) not working.
* Implemented new cooking success formula. Now cooking experience starts at 0.(bugreport:2439) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13881 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.c8
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/skill.c53
3 files changed, 32 insertions, 31 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index fdd44339e..abb86f95d 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -972,7 +972,7 @@ int pc_reg_received(struct map_session_data *sd)
sd->kafraPoints = pc_readaccountreg(sd,"#KAFRAPOINTS");
// Cooking Exp
- sd->cooking_attempt = pc_readglobalreg(sd,"COOKING_ATTEMPT");
+ sd->cook_mastery = pc_readglobalreg(sd,"COOK_MASTERY");
if( (sd->class_&MAPID_BASEMASK) == MAPID_TAEKWON )
{ // Better check for class rather than skill to prevent "skill resets" from unsetting this
@@ -6445,10 +6445,10 @@ int pc_setregistry(struct map_session_data *sd,const char *reg,int val,int type)
if( i )
status_calc_pc(sd,0); // Lost the bonus.
}
- else if( !strcmp(reg,"COOKING_ATTEMPT") && sd->cooking_attempt != val )
+ else if( !strcmp(reg,"COOK_MASTERY") && sd->cook_mastery != val )
{
- val = cap_value(val, 0, 400);
- sd->cooking_attempt = val;
+ val = cap_value(val, 0, 1999);
+ sd->cook_mastery = val;
}
sd_reg = sd->save_reg.global;
max = &sd->save_reg.global_num;
diff --git a/src/map/pc.h b/src/map/pc.h
index df6f0ae93..1484f9dc2 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -177,7 +177,7 @@ struct map_session_data {
short skillitem,skillitemlv;
short skillid_old,skilllv_old;
short skillid_dance,skilllv_dance;
- short cooking_attempt; // max: 400 [Inkfish]
+ short cook_mastery; // range: [0,1999] [Inkfish]
unsigned char blockskill[MAX_SKILL];
int cloneskill_id;
int menuskill_id, menuskill_val;
diff --git a/src/map/skill.c b/src/map/skill.c
index 1942ff193..63640656f 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6333,7 +6333,6 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk
}
break;
case NJ_SHADOWJUMP:
- {
if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground )
{ //You don't move on GVG grounds.
unit_movepos(src, x, y, 1, 0);
@@ -6341,7 +6340,6 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk
}
if (sc && sc->data[SC_HIDING])
status_change_end(src, SC_HIDING, -1);
- }
break;
case AM_SPHEREMINE:
case AM_CANNIBALIZE:
@@ -10425,17 +10423,6 @@ static int skill_unit_timer_sub (DBKey key, void* data, va_list ap)
}
}
break;
- case UNT_TATAMIGAESHI:
- if( unit->range >= 0 )
- { //Disable processed cell.
- unit->range = -1;
- if (--group->val1 <= 0) // number of live cells
- { //All tiles were processed, disable skill.
- group->target_flag=BCT_NOONE;
- group->bl_flag= BL_NUL;
- }
- }
- break;
}
}
@@ -10455,10 +10442,14 @@ static int skill_unit_timer_sub (DBKey key, void* data, va_list ap)
if(unit->range == -1) //Unit disabled, but it should not be deleted yet.
group->unit_id = UNT_USED_TRAPS;
- if( !unit->alive )
+ if( group->unit_id == UNT_TATAMIGAESHI )
{
- if( dissonance ) skill_dance_switch(unit, 1);
- return 0;
+ unit->range = -1; //Disable processed cell.
+ if (--group->val1 <= 0) // number of live cells
+ { //All tiles were processed, disable skill.
+ group->target_flag=BCT_NOONE;
+ group->bl_flag= BL_NUL;
+ }
}
}
@@ -10774,6 +10765,7 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
{
int slot[3];
int i,sc,ele,idx,equip,wlv,make_per,flag;
+ int num = -1; // exclude the recipe
struct status_data *status;
nullpo_retr(0, sd);
@@ -10815,6 +10807,7 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
int j,id,x;
if( (id=skill_produce_db[idx].mat_id[i]) <= 0 )
continue;
+ num++;
x=qty*skill_produce_db[idx].mat_amount[i];
do{
int y=0;
@@ -10917,12 +10910,14 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
if (sd->menuskill_val >= 15) //Legendary Cooking Set.
make_per = 10000; //100% Success
else
- make_per = 1200*(sd->menuskill_val-10) //12% chance per set level.
- + 1000 - 500*(skill_produce_db[idx].itemlv-10) //10% - 5% per dish level
- + 20*status->dex + 10*status->luk //0.2% per DEX, 0.1% per LUK
- + 5*sd->cooking_attempt; //+0.05% per try
- if( sd->cooking_attempt < 400 )
- pc_setglobalreg(sd, "COOKING_ATTEMPT", sd->cooking_attempt+1);
+ make_per = 1200 * (sd->menuskill_val - 10)
+ + 20 * (sd->status.base_level + 1)
+ + 20 * (status->dex + 1)
+ + 100 * (rand()%(30+5*(sd->cook_mastery/400) - (6+sd->cook_mastery/80)) + (6+sd->cook_mastery/80))
+ - 400 * (skill_produce_db[idx].itemlv - 11 + 1)
+ - 10 * (100 - status->luk + 1)
+ - 500 * (num - 1)
+ - 100 * (rand()%4 + 1);
break;
}
make_per = 5000;
@@ -11056,9 +11051,12 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
clif_misceffect(&sd->bl,3);
break;
default: //Those that don't require a skill?
- if (skill_produce_db[idx].itemlv>10 &&
- skill_produce_db[idx].itemlv<= 20) //Cooking items.
+ if( skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20)
+ { //Cooking items.
clif_specialeffect(&sd->bl, 608, AREA);
+ if( sd->cook_mastery < 1999 )
+ pc_setglobalreg(sd, "COOK_MASTERY",sd->cook_mastery + ( 1 << ( (skill_produce_db[idx].itemlv - 11) / 2 ) ) * 5);
+ }
break;
}
}
@@ -11097,9 +11095,12 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
clif_misceffect(&sd->bl,2);
break;
default:
- if (skill_produce_db[idx].itemlv>10 &&
- skill_produce_db[idx].itemlv<= 20) //Cooking items.
+ if( skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20 )
+ { //Cooking items.
clif_specialeffect(&sd->bl, 609, AREA);
+ if( sd->cook_mastery > 0 )
+ pc_setglobalreg(sd, "COOK_MASTERY", sd->cook_mastery - ( 1 << ((skill_produce_db[idx].itemlv - 11) / 2) ) - ( ( ( 1 << ((skill_produce_db[idx].itemlv - 11) / 2) ) >> 1 ) * 3 ));
+ }
}
}
return 0;