summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-26 10:02:29 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-26 10:02:29 +0000
commitb064f50c5c54c66cd8e91e75f000a8caa14968d6 (patch)
tree7dcd12076e63e3e2dbe02a504ac1724289af3f23 /src/map
parent91b84dacf6e1376e097cff7c7eff697d21bf1c62 (diff)
downloadhercules-b064f50c5c54c66cd8e91e75f000a8caa14968d6.tar.gz
hercules-b064f50c5c54c66cd8e91e75f000a8caa14968d6.tar.bz2
hercules-b064f50c5c54c66cd8e91e75f000a8caa14968d6.tar.xz
hercules-b064f50c5c54c66cd8e91e75f000a8caa14968d6.zip
Finished Full Strip, Weapon Refine, Slim Pitcher and Full Protection
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@369 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c10
-rw-r--r--src/map/clif.c27
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/guild.c6
-rw-r--r--src/map/pc.c99
-rw-r--r--src/map/pc.h1
-rw-r--r--src/map/skill.c92
-rw-r--r--src/map/skill.h8
8 files changed, 176 insertions, 68 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 22731f01d..24547762d 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3562,21 +3562,13 @@ static struct Damage battle_calc_pc_weapon_attack(
}
// 状態異常中のダメージ追加でクリティカルにも有効なスキル
-
if (sc_data) {
-
// エンチャントデッドリーポイズン
-
if(sc_data[SC_EDP].timer != -1) {
-
damage += damage * (150 + sc_data[SC_EDP].val1 * 50) / 100;
-
damage2 += damage2 * (150 + sc_data[SC_EDP].val1 * 50) / 100;
-
no_cardfix = 1;
-
}
-
}
// 精錬ダメージの追加
@@ -4500,9 +4492,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
}
if(battle_check_target(src,target,BCT_ENEMY) <= 0 &&
-
!battle_check_range(src,target,0))
-
return 0; // 攻撃対象外
race = battle_get_race(target);
diff --git a/src/map/clif.c b/src/map/clif.c
index 2038304dc..9163671a8 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -5031,6 +5031,33 @@ int clif_item_repair_list(struct map_session_data *sd)
}
/*==========================================
+ * Weapon Refining [Celest]
+ *------------------------------------------
+ */
+int clif_item_refine_list(struct map_session_data *sd)
+{
+ int i,c;
+ int fd;
+
+ nullpo_retr(0, sd);
+
+ fd=sd->fd;
+
+ WFIFOW(fd,0)=0x177; // temporarily use same packet as clif_item_identify
+ for(i=c=0;i<MAX_INVENTORY;i++){
+ if(sd->status.inventory[i].nameid > 0 && itemdb_type(sd->status.inventory[i].nameid)==4){
+ WFIFOW(fd,c*2+4)=i+2;
+ c++;
+ }
+ }
+ if(c > 0) {
+ WFIFOW(fd,2)=c*2+4;
+ WFIFOSET(fd,WFIFOW(fd,2));
+ }
+ return 0;
+}
+
+/*==========================================
* アイテムによる一時的なスキル効果
*------------------------------------------
*/
diff --git a/src/map/clif.h b/src/map/clif.h
index 595c7f7be..cf03820b1 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -188,6 +188,7 @@ int clif_cart_equiplist(struct map_session_data *sd);
int clif_item_identify_list(struct map_session_data *sd);
int clif_item_identified(struct map_session_data *sd,int idx,int flag);
int clif_item_repair_list(struct map_session_data *sd);
+int clif_item_refine_list(struct map_session_data *sd);
int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv,const char *name);
diff --git a/src/map/guild.c b/src/map/guild.c
index ca3bbf1fe..a48bb3020 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -62,16 +62,10 @@ int guild_skill_get_max(int id) { // Modified for new skills [Sara]
// ギルドスキルがあるか確認
int guild_checkskill(struct guild *g,int id)
{
-
int idx = id-GD_SKILLBASE;
-
-
if (idx < 0 || idx >= MAX_GUILDSKILL)
-
return 0;
-
return g->skill[idx].lv;
-
}
diff --git a/src/map/pc.c b/src/map/pc.c
index a4503b2c1..5ec5b8a1b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1,4 +1,4 @@
-// $Id: pc.c 101 2004-11-25 4:02:51 PM Celestia $
+// $Id: pc.c 101 2004-11-26 5:47:29 PM Celestia $
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -2733,23 +2733,14 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
}
break;
case SP_HP_DRAIN_VALUE:
-
if(!sd->state.lr_flag) {
-
sd->hp_drain_rate += type2;
-
sd->hp_drain_value += val;
-
}
-
else if(sd->state.lr_flag == 1) {
-
sd->hp_drain_rate_ += type2;
-
sd->hp_drain_value_ += val;
-
}
-
break;
case SP_SP_DRAIN_RATE:
if(!sd->state.lr_flag) {
@@ -2762,21 +2753,13 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
}
break;
case SP_SP_DRAIN_VALUE:
-
if(!sd->state.lr_flag) {
-
sd->sp_drain_rate += type2;
-
sd->sp_drain_value += val;
-
}
-
else if(sd->state.lr_flag == 1) {
-
sd->sp_drain_rate_ += type2;
-
sd->sp_drain_value_ += val;
-
}
break;
@@ -3448,9 +3431,10 @@ int pc_item_identify(struct map_session_data *sd,int idx)
nullpo_retr(0, sd);
// Celest
- if (sd->skillid == BS_REPAIRWEAPON) {
+ if (sd->skillid == BS_REPAIRWEAPON)
return pc_item_repair (sd, idx);
- }
+ else if (sd->skillid == WS_WEAPONREFINE)
+ return pc_item_refine (sd, idx);
if(idx >= 0 && idx < MAX_INVENTORY) {
if(sd->status.inventory[idx].nameid > 0 && sd->status.inventory[idx].identify == 0 ){
@@ -3492,6 +3476,81 @@ int pc_item_repair(struct map_session_data *sd,int idx)
}
/*==========================================
+ * Weapon Refining [Celest]
+ *------------------------------------------
+ */
+int pc_item_refine(struct map_session_data *sd,int idx)
+{
+ int flag = 1, i = 0, count = 0, ep = 0, per, refine;
+ int material[5] = { 0, 1010, 1011, 984, 984 };
+
+ nullpo_retr(0, sd);
+ struct item *item = &sd->status.inventory[idx];
+
+ if(idx >= 0 && idx < MAX_INVENTORY) {
+ if(item->nameid > 0 && itemdb_type(item->nameid)==4) {
+ // if it's no longer refineable
+ if (item->refine == 10) {
+ clif_skill_fail(sd,sd->skillid,0,0);
+ return 0;
+ }
+ refine = item->refine + sd->skilllv > 10
+ ? 10 - item->refine : sd->skilllv;
+ for (i=0; i < MAX_INVENTORY; i++)
+ if(sd->status.inventory[i].nameid == material [itemdb_wlv (item->nameid)])
+ count += sd->status.inventory[i].amount;
+ if (count < refine ) {
+ clif_skill_fail(sd,sd->skillid,0,0);
+ return 0;
+ }
+ per = percentrefinery [itemdb_wlv (item->nameid)][item->refine + refine - 1];
+ //per += pc_checkskill(sd,BS_WEAPONRESEARCH);
+ per *= (75 + sd->status.job_level/2)/100;
+
+ if (per > rand() % 100) {
+ flag = 0;
+ item->refine += refine;
+
+ for (i=0; i < MAX_INVENTORY; i++)
+ if(sd->status.inventory[i].nameid == material [itemdb_wlv (item->nameid)]) {
+ if (sd->status.inventory[i].amount >= refine) {
+ pc_delitem(sd,i,refine,0);
+ break;
+ } else {
+ refine -= sd->status.inventory[i].amount;
+ pc_delitem(sd,i,sd->status.inventory[i].amount,0);
+ }
+ }
+
+ if(item->equip) {
+ ep = item->equip;
+ pc_unequipitem(sd,idx,0, BF_NORMAL);
+ }
+ clif_refine(sd->fd,sd,0,idx,item->refine);
+ clif_delitem(sd,idx,1);
+ clif_additem(sd,idx,1,0);
+ if (ep)
+ pc_equipitem(sd,idx,ep);
+ clif_misceffect(&sd->bl,3);
+ }
+ else {
+ clif_delitem(sd,i,refine);
+ item->refine = 0;
+ if(item->equip)
+ pc_unequipitem(sd,idx,0, BF_NORMAL);
+ clif_refine(sd->fd,sd,1,idx,item->refine);
+ pc_delitem(sd,idx,1,0);
+ clif_misceffect(&sd->bl,2);
+
+ clif_emotion(&sd->bl, 23);
+ }
+ }
+ }
+
+ return !flag;
+}
+
+/*==========================================
* スティル品公開
*------------------------------------------
*/
diff --git a/src/map/pc.h b/src/map/pc.h
index 7861fb43c..372dd72f7 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -89,6 +89,7 @@ int pc_insert_card(struct map_session_data *sd,int idx_card,int idx_equip);
int pc_item_identify(struct map_session_data *sd,int idx);
int pc_item_repair(struct map_session_data *sd,int idx); // [Celest]
+int pc_item_refine(struct map_session_data *sd,int idx); // [Celest]
int pc_steal_item(struct map_session_data *sd,struct block_list *bl);
int pc_steal_coin(struct map_session_data *sd,struct block_list *bl);
diff --git a/src/map/skill.c b/src/map/skill.c
index 536af3bdb..2c7be17ea 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1,4 +1,4 @@
-// $Id: skill.c,v 1.8 2004/11/25 4:02:35 PM Celestia Exp $
+// $Id: skill.c,v 1.8 2004/11/26 5:46:59 PM Celestia Exp $
/* スキル?係 */
#include <stdio.h>
@@ -3718,7 +3718,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
map_freeblock_unlock();
return 1;
}
- clif_item_repair_list(sd);
+ clif_item_repair_list(sd);
}
break;
@@ -3876,22 +3876,38 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
}
break;
+ // Full Strip [Celest]
case ST_FULLSTRIP:
{
struct status_change *tsc_data = battle_get_sc_data(bl);
-
- if(tsc_data && tsc_data[SC_CP_HELM].timer != -1)
- break;
+ int c=0, i, j;
+ int striplist[2][4] = { { 0, 0, 0, 0 },
+ { 0x0002, 0x0020, 0x0010, 0x0100 } };
+
strip_per = 5+2*skilllv+strip_fix/5;
strip_time = skill_get_time(skillid,skilllv)+strip_fix/2;
- if(rand()%100 < strip_per){
+ for (i=0; i<4; i++) {
+ if(tsc_data && tsc_data[SC_CP_WEAPON + i].timer != -1)
+ break;
+ if(rand()%100 < strip_per) {
+ striplist[0][i] = 1;
+ c++;
+ }
+ }
+
+ if (c > 0) {
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,strip_time,0 );
- if(dstsd){
- for(i=0;i<MAX_INVENTORY;i++){
- if(dstsd->status.inventory[i].equip && dstsd->status.inventory[i].equip & 0x0100){
- pc_unequipitem(dstsd,i,0,BF_SKILL);
- break;
+ for (j=0; j<4 && c > 0; j++) {
+ if (striplist[0][j]) {
+ skill_status_change_start(bl,SC_STRIPWEAPON + i,skilllv,0,0,0,strip_time,0 );
+ if(dstsd){
+ for(i=0;i<MAX_INVENTORY;i++){
+ if(dstsd->status.inventory[i].equip && dstsd->status.inventory[i].equip & striplist[1][j]){
+ pc_unequipitem(dstsd,i,0,BF_SKILL);
+ --c;
+ break;
+ }
+ }
}
}
}
@@ -3972,46 +3988,46 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case AM_CP_WEAPON:
{
struct status_change *tsc_data = battle_get_sc_data(bl);
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
if(tsc_data && tsc_data[SC_STRIPWEAPON].timer != -1)
- skill_status_change_end(bl, SC_STRIPWEAPON, -1 );
- skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
+ skill_status_change_end(bl, SC_STRIPWEAPON, -1 );
+ skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
}
break;
case AM_CP_SHIELD:
{
struct status_change *tsc_data = battle_get_sc_data(bl);
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
if(tsc_data && tsc_data[SC_STRIPSHIELD].timer != -1)
- skill_status_change_end(bl, SC_STRIPSHIELD, -1 );
- skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
+ skill_status_change_end(bl, SC_STRIPSHIELD, -1 );
+ skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
}
break;
case AM_CP_ARMOR:
{
struct status_change *tsc_data = battle_get_sc_data(bl);
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
if(tsc_data && tsc_data[SC_STRIPARMOR].timer != -1)
- skill_status_change_end(bl, SC_STRIPARMOR, -1 );
- skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
+ skill_status_change_end(bl, SC_STRIPARMOR, -1 );
+ skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
}
break;
case AM_CP_HELM:
{
struct status_change *tsc_data = battle_get_sc_data(bl);
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
if(tsc_data && tsc_data[SC_STRIPHELM].timer != -1)
- skill_status_change_end(bl, SC_STRIPHELM, -1 );
- skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
+ skill_status_change_end(bl, SC_STRIPHELM, -1 );
+ skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
}
break;
case SA_DISPELL: /* ディスペル */
{
int i;
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
- break;
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ break;
for(i=0;i<136;i++){
if(i==SC_RIDING || i== SC_FALCON || i==SC_HALLUCINATION || i==SC_WEIGHT50
|| i==SC_WEIGHT90 || i==SC_STRIPWEAPON || i==SC_STRIPSHIELD || i==SC_STRIPARMOR
@@ -4421,7 +4437,13 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
}
break;
- // Slim Pitcher [Celest]
+ // Weapon Refining [Celest]
+ case WS_WEAPONREFINE:
+ if(sd)
+ clif_item_refine_list(sd);
+ break;
+
+ // Slim Pitcher
case CR_SLIMPITCHER:
{
if (sd && flag&1) {
@@ -4434,6 +4456,20 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
}
}
break;
+ // Full Chemical Protection
+ case CR_FULLPROTECTION:
+ {
+ int i, skilltime;
+ struct status_change *tsc_data = battle_get_sc_data(bl);
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ skilltime = skill_get_time(skillid,skilllv);
+ for (i=0; i<4; i++) {
+ if(tsc_data && tsc_data[SC_STRIPWEAPON + i].timer != -1)
+ skill_status_change_end(bl, SC_STRIPWEAPON + i, -1 );
+ skill_status_change_start(bl,SC_CP_WEAPON + i,skilllv,0,0,0,skilltime,0 );
+ }
+ }
+ break;
case RG_CLEANER: //AppleGirl
clif_skill_nodamage(src,bl,skillid,skilllv,1);
diff --git a/src/map/skill.h b/src/map/skill.h
index 2a7c17652..01f077158 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -1,4 +1,4 @@
-// $Id: skill.h,v 1.5 2004/09/25 05:32:19 MouseJstr Exp $
+// $Id: skill.h,v 1.5 2004/11/26 5:47:12 PM Celestia Exp $
#ifndef _SKILL_H_
#define _SKILL_H_
@@ -734,6 +734,7 @@ enum {
WE_CALLPARTNER,
NPC_SELFDESTRUCTION2 = 331,
+ ITM_TOMAHAWK = 337,
NPC_DARKCROSS = 338,
LK_AURABLADE = 355,
@@ -855,13 +856,12 @@ enum {
SL_SKE,
SL_SKA,
- // Will assign skill id's later [Celest]
- ST_PRESERVE,
+ ST_PRESERVE = 475,
ST_FULLSTRIP,
WS_WEAPONREFINE,
CR_SLIMPITCHER,
CR_FULLPROTECTION,
- ITM_TOMAHAWK,
+
// moved to common/mmo.h
/* GD_APPROVAL=10000,