summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.cpp2
-rw-r--r--src/map/battle.cpp10
-rw-r--r--src/map/chat.cpp2
-rw-r--r--src/map/chrif.cpp2
-rw-r--r--src/map/clif.cpp2
-rw-r--r--src/map/intif.cpp2
-rw-r--r--src/map/itemdb.cpp2
-rw-r--r--src/map/magic-expr.cpp2
-rw-r--r--src/map/magic-interpreter-base.cpp2
-rw-r--r--src/map/magic-stmt.cpp2
-rw-r--r--src/map/magic.cpp2
-rw-r--r--src/map/map.cpp2
-rw-r--r--src/map/map.hpp6
-rw-r--r--src/map/mob.cpp16
-rw-r--r--src/map/npc.cpp6
-rw-r--r--src/map/party.cpp2
-rw-r--r--src/map/path.cpp2
-rw-r--r--src/map/pc.cpp187
-rw-r--r--src/map/script.cpp13
-rw-r--r--src/map/skill-pools.cpp2
-rw-r--r--src/map/skill.cpp2
-rw-r--r--src/map/storage.cpp2
-rw-r--r--src/map/tmw.cpp2
-rw-r--r--src/map/trade.cpp4
24 files changed, 125 insertions, 151 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 13685df..41a38f0 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -37,6 +37,8 @@
#include "tmw.hpp"
#include "trade.hpp"
+#include "../poison.hpp"
+
#define ATCOMMAND_FUNC(x) static \
int atcommand_##x(const int fd, struct map_session_data* sd, const char* command, const char* message)
ATCOMMAND_FUNC(setup);
diff --git a/src/map/battle.cpp b/src/map/battle.cpp
index 1e5ca05..1a0d12b 100644
--- a/src/map/battle.cpp
+++ b/src/map/battle.cpp
@@ -19,6 +19,8 @@
#include "pc.hpp"
#include "skill.hpp"
+#include "../poison.hpp"
+
int attr_fix_table[4][10][10];
struct Battle_Config battle_config;
@@ -1780,7 +1782,7 @@ struct Damage battle_calc_mob_weapon_attack(struct block_list *src,
BF flag;
int ac_flag = 0;
ATK dmg_lv = ATK::ZERO;
- int t_mode = 0, t_size = 1, s_race = 0, s_ele = 0;
+ int t_mode = 0, s_race = 0, s_ele = 0;
eptr<struct status_change, StatusChange> sc_data, t_sc_data;
//return前の処理があるので情報出力部のみ変更
@@ -1800,7 +1802,6 @@ struct Damage battle_calc_mob_weapon_attack(struct block_list *src,
tsd = (struct map_session_data *) target;
else if (target->type == BL_MOB)
tmd = (struct mob_data *) target;
- t_size = battle_get_size(target);
t_mode = battle_get_mode(target);
t_sc_data = battle_get_sc_data(target);
@@ -2183,7 +2184,6 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
int damage, damage2, type, div_, blewcount =
skill_get_blewcount(skill_num, skill_lv);
BF flag;
- int skill;
ATK dmg_lv = ATK::ZERO;
int t_mode = 0, t_race = 0, t_size = 1, s_race = 7, s_ele = 0;
eptr<struct status_change, StatusChange> sc_data, t_sc_data;
@@ -2338,7 +2338,7 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
}
if (sd->double_rate > 0 && skill_num == SkillID::ZERO && skill_lv >= 0)
- da = bool(MRAND(100) < sd->double_rate);
+ da = MRAND(100) < sd->double_rate;
// 過剰精錬ボーナス
if (sd->overrefine > 0)
@@ -2860,12 +2860,10 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
{ // 二刀流か?
int dmg = damage, dmg2 = damage2;
// 右手修練(60% 〜 100%) 右手全般
- skill = 0;
damage = damage * 50 / 100;
if (dmg > 0 && damage < 1)
damage = 1;
// 左手修練(40% 〜 80%) 左手全般
- skill = 0;
damage2 = damage2 * 30 / 100;
if (dmg2 > 0 && damage2 < 1)
damage2 = 1;
diff --git a/src/map/chat.cpp b/src/map/chat.cpp
index 9530bfc..dcb6e51 100644
--- a/src/map/chat.cpp
+++ b/src/map/chat.cpp
@@ -12,6 +12,8 @@
#include "npc.hpp"
#include "pc.hpp"
+#include "../poison.hpp"
+
static
int chat_triggerevent(struct chat_data *cd);
static
diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp
index ef4c160..1f70a02 100644
--- a/src/map/chrif.cpp
+++ b/src/map/chrif.cpp
@@ -25,6 +25,8 @@
#include "npc.hpp"
#include "pc.hpp"
+#include "../poison.hpp"
+
static
const int packet_len_table[0x20] = {
60, 3, 10, 27, 22, -1, 6, -1, // 2af8-2aff
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index f715210..e26e64e 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -39,6 +39,8 @@
#include "tmw.hpp"
#include "trade.hpp"
+#include "../poison.hpp"
+
#define DUMP_UNKNOWN_PACKET 1
#define EMOTE_IGNORED 0x0e
diff --git a/src/map/intif.cpp b/src/map/intif.cpp
index 9d44200..7c42cfc 100644
--- a/src/map/intif.cpp
+++ b/src/map/intif.cpp
@@ -27,6 +27,8 @@
#include "pc.hpp"
#include "storage.hpp"
+#include "../poison.hpp"
+
static
const int packet_len_table[] = {
-1, -1, 27, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp
index fc3f59e..7ca6055 100644
--- a/src/map/itemdb.cpp
+++ b/src/map/itemdb.cpp
@@ -15,6 +15,8 @@
#include "pc.hpp"
#include "script.hpp"
+#include "../poison.hpp"
+
#define MAX_RANDITEM 2000
// ** ITEMDB_OVERRIDE_NAME_VERBOSE **
diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp
index 6712af3..def1ece 100644
--- a/src/map/magic-expr.cpp
+++ b/src/map/magic-expr.cpp
@@ -8,6 +8,8 @@
#include "itemdb.hpp"
#include "magic-expr-eval.hpp"
+#include "../poison.hpp"
+
#define IS_SOLID(c) ((c) == 1 || (c) == 5)
int map_is_solid(int m, int x, int y)
diff --git a/src/map/magic-interpreter-base.cpp b/src/map/magic-interpreter-base.cpp
index 57f6fe6..79f77da 100644
--- a/src/map/magic-interpreter-base.cpp
+++ b/src/map/magic-interpreter-base.cpp
@@ -3,6 +3,8 @@
#include "magic-interpreter.hpp"
#include "magic-interpreter-aux.hpp"
+#include "../poison.hpp"
+
static
void set_int_p(val_t *v, int i, TY t)
{
diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp
index e911f92..d93c44c 100644
--- a/src/map/magic-stmt.cpp
+++ b/src/map/magic-stmt.cpp
@@ -5,6 +5,8 @@
#include "magic-interpreter.hpp"
#include "magic-interpreter-aux.hpp"
+#include "../poison.hpp"
+
#define INVISIBLE_NPC 127 /* used for local spell effects */
//#define DEBUG
diff --git a/src/map/magic.cpp b/src/map/magic.cpp
index d50d5a7..09b1928 100644
--- a/src/map/magic.cpp
+++ b/src/map/magic.cpp
@@ -5,6 +5,8 @@
#include "magic-interpreter.hpp"
+#include "../poison.hpp"
+
#undef DEBUG
static
diff --git a/src/map/map.cpp b/src/map/map.cpp
index 4e6cb66..1fd9bb9 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -33,6 +33,8 @@
#include "storage.hpp"
#include "trade.hpp"
+#include "../poison.hpp"
+
// 極力 staticでローカルに収める
static
struct dbt *id_db = NULL;
diff --git a/src/map/map.hpp b/src/map/map.hpp
index d4f1445..b2a7127 100644
--- a/src/map/map.hpp
+++ b/src/map/map.hpp
@@ -19,10 +19,6 @@
#include "script.hpp" // change to script.t.hpp
#include "skill.t.hpp"
-#define MAX_PC_CLASS (1+6+6+1+6+1+1+1+1+4023)
-#define PC_CLASS_BASE 0
-#define PC_CLASS_BASE2 (PC_CLASS_BASE + 4001)
-#define PC_CLASS_BASE3 (PC_CLASS_BASE2 + 22)
#define MAX_NPC_PER_MAP 512
#define BLOCK_SIZE 8
#define AREA_SIZE battle_config.area_size
@@ -235,7 +231,7 @@ struct map_session_data
int npc_amount;
int npc_stack, npc_stackmax;
const ScriptCode *npc_script, *npc_scriptroot;
- char *npc_stackbuf;
+ struct script_data *npc_stackbuf;
char npc_str[256];
struct
{
diff --git a/src/map/mob.cpp b/src/map/mob.cpp
index 75e59d8..4b68cd9 100644
--- a/src/map/mob.cpp
+++ b/src/map/mob.cpp
@@ -21,6 +21,8 @@
#include "pc.hpp"
#include "skill.hpp"
+#include "../poison.hpp"
+
#define MIN_MOBTHINKTIME 100
#define MOB_LAZYMOVEPERC 50 // Move probability in the negligent mode MOB (rate of 1000 minute)
@@ -3136,7 +3138,6 @@ int mob_warp(struct mob_data *md, int m, int x, int y, int type)
}
else
{
- m = md->bl.m;
if (battle_config.error_log == 1)
PRINTF("MOB %d warp failed, mob_class = %d\n", md->bl.id, md->mob_class);
}
@@ -3463,15 +3464,6 @@ void mobskill_castend_pos(timer_id tid, tick_t tick, custom_id_t id, custom_data
if (md->sc_data[SC_BERSERK].timer != -1) //バーサーク
return;
- if (battle_config.monster_skill_reiteration == 0)
- {
- range = -1;
- }
- if (battle_config.monster_skill_nofootset == 1)
- {
- range = -1;
- }
-
if (battle_config.monster_land_skill_limit == 1)
{
maxcount = skill_get_maxcount(md->skillid);
@@ -3890,7 +3882,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick,
// 自分の周囲
if (ms[ii].target >= MST_AROUND1)
{
- int bx = x, by = y, i = 0, c, m = bl->m;
+ int bx, by, i = 0, c, m = bl->m;
// the enum values for radii are adjacent
int r = int(ms[i].target) - int(MST_AROUND1);
do
@@ -3911,7 +3903,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick,
// 相手の周囲
if (ms[ii].target >= MST_AROUND5)
{
- int bx = x, by = y, i = 0, c, m = bl->m;
+ int bx, by, i = 0, c, m = bl->m;
int r = int(ms[i].target) - int(MST_AROUND5) + 1;
do
{
diff --git a/src/map/npc.cpp b/src/map/npc.cpp
index 900a077..876b0fd 100644
--- a/src/map/npc.cpp
+++ b/src/map/npc.cpp
@@ -22,6 +22,8 @@
#include "script.hpp"
#include "skill.hpp"
+#include "../poison.hpp"
+
struct npc_src_list
{
struct npc_src_list *next;
@@ -76,7 +78,7 @@ void npc_enable_sub(struct block_list *bl, struct npc_data *nd)
memcpy(name, nd->name, sizeof(nd->name));
if (sd->areanpc_id == nd->bl.id)
- return;
+ return; // TODO fix leak of 'name'
sd->areanpc_id = nd->bl.id;
npc_event(sd, strcat(name, "::OnTouch"), 0);
}
@@ -686,7 +688,7 @@ int npc_touch_areanpc(struct map_session_data *sd, int m, int x, int y)
memcpy(name, map[m].npc[i]->name, 50);
if (sd->areanpc_id == map[m].npc[i]->bl.id)
- return 1;
+ return 1; // TODO fix leak of 'name'
sd->areanpc_id = map[m].npc[i]->bl.id;
if (npc_event(sd, strcat(name, "::OnTouch"), 0) > 0)
npc_click(sd, map[m].npc[i]->bl.id);
diff --git a/src/map/party.cpp b/src/map/party.cpp
index 98bb2be..1b646de 100644
--- a/src/map/party.cpp
+++ b/src/map/party.cpp
@@ -17,6 +17,8 @@
#include "skill.hpp"
#include "tmw.hpp"
+#include "../poison.hpp"
+
#define PARTY_SEND_XYHP_INVERVAL 1000 // 座標やHP送信の間隔
static
diff --git a/src/map/path.cpp b/src/map/path.cpp
index 596332c..1a8b5b9 100644
--- a/src/map/path.cpp
+++ b/src/map/path.cpp
@@ -7,6 +7,8 @@
#include "battle.hpp"
#include "map.hpp"
+#include "../poison.hpp"
+
//#define PATH_STANDALONETEST
#define MAX_HEAP 150
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index b136ba4..23618c5 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -28,6 +28,8 @@
#include "storage.hpp"
#include "trade.hpp"
+#include "../poison.hpp"
+
#define PVP_CALCRANK_INTERVAL 1000 // PVP順位計算の間隔
//define it here, since the ifdef only occurs in this file
@@ -59,20 +61,42 @@
timer_id day_timer_tid;
timer_id night_timer_tid;
+static //const
+int max_weight_base_0 = 20000;
+static //const
+int hp_coefficient_0 = 0;
+static //const
+int hp_coefficient2_0 = 500;
static
-int max_weight_base[MAX_PC_CLASS];
-static
-int hp_coefficient[MAX_PC_CLASS];
-static
-int hp_coefficient2[MAX_PC_CLASS];
-static
-int hp_sigma_val[MAX_PC_CLASS][MAX_LEVEL];
+int hp_sigma_val_0[MAX_LEVEL];
+static //const
+int sp_coefficient_0 = 100;
+
+// coefficients for each weapon type
+// (not all used)
+static //const
+int aspd_base_0[17] =
+{
+ 650,
+ 700,
+ 750,
+ 600,
+ 2000,
+ 2000,
+ 800,
+ 2000,
+ 700,
+ 700,
+ 650,
+ 900,
+ 2000,
+ 2000,
+ 2000,
+ 2000,
+ 2000,
+};
static
-int sp_coefficient[MAX_PC_CLASS];
-static
-int aspd_base[MAX_PC_CLASS][20];
-static
-char job_bonus[3][MAX_PC_CLASS][MAX_LEVEL];
+char job_bonus_0[3][MAX_LEVEL];
static
int exp_table[14][MAX_LEVEL];
static
@@ -87,7 +111,7 @@ struct
SkillID id;
short lv;
} need[6];
-} skill_tree[3][MAX_PC_CLASS][100];
+} skill_tree_0_0[100];
static
int atkmods[3][20]; // 武器ATKサイズ修正(size_fix.txt)
@@ -1011,7 +1035,7 @@ void pc_calc_skilltree(struct map_session_data *sd)
flag = 0;
SkillID id;
for (int i = 0;
- (id = skill_tree[0][0][i].id) != SkillID::ZERO
+ (id = skill_tree_0_0[i].id) != SkillID::ZERO
&& id != SkillID::NEGATIVE;
i++)
{
@@ -1020,10 +1044,9 @@ void pc_calc_skilltree(struct map_session_data *sd)
{
for (j = 0; j < 5; j++)
{
- if (skill_tree[0][0][i].need[j].id != SkillID::ZERO
- && pc_checkskill(sd,
- skill_tree[0][0][i].need[j].id) < \
- skill_tree[0][0][i].need[j].lv)
+ if (skill_tree_0_0[i].need[j].id != SkillID::ZERO
+ && pc_checkskill(sd, skill_tree_0_0[i].need[j].id)
+ < skill_tree_0_0[i].need[j].lv)
f = 0;
}
}
@@ -1135,7 +1158,7 @@ int pc_calcstatus(struct map_session_data *sd, int first)
pc_calc_skilltree(sd); // スキルツリーの計算
- sd->max_weight = max_weight_base[0] + sd->status.attrs[ATTR::STR] * 300;
+ sd->max_weight = max_weight_base_0 + sd->status.attrs[ATTR::STR] * 300;
if (first & 1)
{
@@ -1665,17 +1688,17 @@ int pc_calcstatus(struct map_session_data *sd, int first)
// 二刀流 ASPD 修正
if (sd->status.weapon <= 16)
- sd->aspd += aspd_base[0][sd->status.weapon]
+ sd->aspd += aspd_base_0[sd->status.weapon]
- (sd->paramc[ATTR::AGI] * 4 + sd->paramc[ATTR::DEX])
- * aspd_base[0][sd->status.weapon] / 1000;
+ * aspd_base_0[sd->status.weapon] / 1000;
else
sd->aspd += (
- (aspd_base[0][sd->weapontype1]
+ (aspd_base_0[sd->weapontype1]
- (sd->paramc[ATTR::AGI] * 4 + sd->paramc[ATTR::DEX])
- * aspd_base[0][sd->weapontype1] / 1000)
- + (aspd_base[0][sd->weapontype2]
+ * aspd_base_0[sd->weapontype1] / 1000)
+ + (aspd_base_0[sd->weapontype2]
- (sd->paramc[ATTR::AGI] * 4 + sd->paramc[ATTR::DEX])
- * aspd_base[0][sd->weapontype2] / 1000)
+ * aspd_base_0[sd->weapontype2] / 1000)
)
* 140 / 200;
@@ -1708,8 +1731,8 @@ int pc_calcstatus(struct map_session_data *sd, int first)
sd->status.max_hp += (
3500
- + bl * hp_coefficient2[0]
- + hp_sigma_val[0][(bl > 0) ? bl - 1 : 0]
+ + bl * hp_coefficient2_0
+ + hp_sigma_val_0[(bl > 0) ? bl - 1 : 0]
) / 100 * (100 + sd->paramc[ATTR::VIT]) / 100
+ (sd->parame[ATTR::VIT] - sd->paramcard[ATTR::VIT]);
if (sd->hprate != 100)
@@ -1731,7 +1754,7 @@ int pc_calcstatus(struct map_session_data *sd, int first)
sd->status.max_hp = 1; // end
// 最大SP計算
- sd->status.max_sp += ((sp_coefficient[0] * bl) + 1000)
+ sd->status.max_sp += ((sp_coefficient_0 * bl) + 1000)
/ 100 * (100 + sd->paramc[ATTR::INT]) / 100
+ (sd->parame[ATTR::INT] - sd->paramcard[ATTR::INT]);
if (sd->sprate != 100)
@@ -3430,13 +3453,12 @@ int pc_steal_coin(struct map_session_data *sd, struct block_list *bl)
{
if (sd != NULL && bl != NULL && bl->type == BL_MOB)
{
- int rate, skill;
+ int rate;
struct mob_data *md = (struct mob_data *) bl;
if (md && !md->state.steal_coin_flag
&& md->sc_data[SC_STONE].timer == -1
&& md->sc_data[SC_FREEZE].timer == -1)
{
- skill = 0;
rate = (sd->status.base_level - mob_db[md->mob_class].lv) * 3
+ sd->paramc[ATTR::DEX] * 2 + sd->paramc[ATTR::LUK] * 2;
if (MRAND(1000) < rate)
@@ -4634,7 +4656,7 @@ int pc_allskillup(struct map_session_data *sd)
{
SkillID id;
for (int i = 0;
- (id = skill_tree[0][0][i].id) != SkillID::ZERO
+ (id = skill_tree_0_0[i].id) != SkillID::ZERO
&& id != SkillID::NEGATIVE;
i++)
{
@@ -7120,44 +7142,6 @@ int pc_readdb(void)
fclose_(fp);
PRINTF("read db/exp.txt done\n");
- // JOB補正数値1
- fp = fopen_("db/job_db1.txt", "r");
- if (fp == NULL)
- {
- PRINTF("can't read db/job_db1.txt\n");
- return 1;
- }
- i = 0;
- while (fgets(line, sizeof(line) - 1, fp))
- {
- char *split[50];
- if (line[0] == '/' && line[1] == '/')
- continue;
- for (j = 0, p = line; j < 21 && p; j++)
- {
- split[j] = p;
- p = strchr(p, ',');
- if (p)
- *p++ = 0;
- }
- if (j < 21)
- continue;
- max_weight_base[i] = atoi(split[0]);
- hp_coefficient[i] = atoi(split[1]);
- hp_coefficient2[i] = atoi(split[2]);
- sp_coefficient[i] = atoi(split[3]);
- for (j = 0; j < 17; j++)
- aspd_base[i][j] = atoi(split[j + 4]);
- i++;
-// -- moonsoul (below two lines added to accommodate high numbered new class ids)
- if (i == 24)
- i = 4001;
- if (i == MAX_PC_CLASS)
- break;
- }
- fclose_(fp);
- PRINTF("read db/job_db1.txt done\n");
-
// JOBボーナス
fp = fopen_("db/job_db2.txt", "r");
if (fp == NULL)
@@ -7174,52 +7158,19 @@ int pc_readdb(void)
{
if (sscanf(p, "%d", &k) == 0)
break;
- job_bonus[0][i][j] = k;
- job_bonus[2][i][j] = k; //養子職のボーナスは分からないので仮
+ job_bonus_0[i][j] = k;
p = strchr(p, ',');
if (p)
p++;
}
i++;
-// -- moonsoul (below two lines added to accommodate high numbered new class ids)
- if (i == 24)
- i = 4001;
- if (i == MAX_PC_CLASS)
- break;
+ break;
}
fclose_(fp);
PRINTF("read db/job_db2.txt done\n");
- // JOBボーナス2 転生職用
- fp = fopen_("db/job_db2-2.txt", "r");
- if (fp == NULL)
- {
- PRINTF("can't read db/job_db2-2.txt\n");
- return 1;
- }
- i = 0;
- while (fgets(line, sizeof(line) - 1, fp))
- {
- if (line[0] == '/' && line[1] == '/')
- continue;
- for (j = 0, p = line; j < MAX_LEVEL && p; j++)
- {
- if (sscanf(p, "%d", &k) == 0)
- break;
- job_bonus[1][i][j] = k;
- p = strchr(p, ',');
- if (p)
- p++;
- }
- i++;
- if (i == MAX_PC_CLASS)
- break;
- }
- fclose_(fp);
- PRINTF("read db/job_db2-2.txt done\n");
-
// スキルツリー
- memset(skill_tree, 0, sizeof(skill_tree));
+ memset(skill_tree_0_0, '\0', sizeof(skill_tree_0_0));
fp = fopen_("db/skill_tree.txt", "r");
if (fp == NULL)
{
@@ -7241,17 +7192,16 @@ int pc_readdb(void)
if (j < 13)
continue;
i = atoi(split[0]);
- for (j = 0; skill_tree[0][i][j].id != SkillID::ZERO; j++);
- skill_tree[0][i][j].id = SkillID(atoi(split[1]));
- skill_tree[0][i][j].max = atoi(split[2]);
- skill_tree[2][i][j].id = SkillID(atoi(split[1])); //養子職は良く分からないので暫定
- skill_tree[2][i][j].max = atoi(split[2]); //養子職は良く分からないので暫定
+ if (i != 0)
+ continue;
+ for (j = 0; skill_tree_0_0[j].id != SkillID::ZERO; j++)
+ {}
+ skill_tree_0_0[j].id = SkillID(atoi(split[1]));
+ skill_tree_0_0[j].max = atoi(split[2]);
for (k = 0; k < 5; k++)
{
- skill_tree[0][i][j].need[k].id = SkillID(atoi(split[k * 2 + 3]));
- skill_tree[0][i][j].need[k].lv = atoi(split[k * 2 + 4]);
- skill_tree[2][i][j].need[k].id = SkillID(atoi(split[k * 2 + 3])); //養子職は良く分からないので暫定
- skill_tree[2][i][j].need[k].lv = atoi(split[k * 2 + 4]); //養子職は良く分からないので暫定
+ skill_tree_0_0[j].need[k].id = SkillID(atoi(split[k * 2 + 3]));
+ skill_tree_0_0[j].need[k].lv = atoi(split[k * 2 + 4]);
}
}
fclose_(fp);
@@ -7391,16 +7341,15 @@ int pc_readdb(void)
static
int pc_calc_sigma(void)
{
- int i, j, k;
+ int j, k;
- for (i = 0; i < MAX_PC_CLASS; i++)
{
- memset(hp_sigma_val[i], 0, sizeof(hp_sigma_val[i]));
+ memset(hp_sigma_val_0, 0, sizeof(hp_sigma_val_0));
for (k = 0, j = 2; j <= MAX_LEVEL; j++)
{
- k += hp_coefficient[i] * j + 50;
+ k += hp_coefficient_0 * j + 50;
k -= k % 100;
- hp_sigma_val[i][j - 1] = k;
+ hp_sigma_val_0[j - 1] = k;
}
}
return 0;
diff --git a/src/map/script.cpp b/src/map/script.cpp
index e774080..093ced9 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -34,6 +34,8 @@
#include "skill.hpp"
#include "storage.hpp"
+#include "../poison.hpp"
+
//#define DEBUG_FUNCIN
//#define DEBUG_DISP
//#define DEBUG_RUN
@@ -2061,11 +2063,12 @@ void builtin_checkweight(ScriptState *st)
amount = conv_num(st, &(st->stack->stack_data[st->start + 3]));
if (amount <= 0 || nameid < 500)
- { //if get wrong item ID or amount<=0, don't count weight of non existing items
+ {
+ //if get wrong item ID or amount<=0, don't count weight of non existing items
push_val(st->stack, ScriptCode::INT, 0);
+ return;
}
- sd = script_rid2sd(st);
if (itemdb_weight(nameid) * amount + sd->weight > sd->max_weight)
{
push_val(st->stack, ScriptCode::INT, 0);
@@ -2228,11 +2231,11 @@ void builtin_delitem(ScriptState *st)
amount = conv_num(st, &(st->stack->stack_data[st->start + 3]));
if (nameid < 500 || amount <= 0)
- { //by Lupus. Don't run FOR if u got wrong item ID or amount<=0
+ {
+ //by Lupus. Don't run FOR if u got wrong item ID or amount<=0
//PRINTF("wrong item ID or amount<=0 : delitem %i,\n",nameid,amount);
return;
}
- sd = script_rid2sd(st);
for (i = 0; i < MAX_INVENTORY; i++)
{
@@ -4833,7 +4836,7 @@ void run_script_main(const ScriptCode *script, int pos_, int, int,
{
if (sd->npc_stackbuf)
free(sd->npc_stackbuf);
- sd->npc_stackbuf = (char *)
+ sd->npc_stackbuf = (struct script_data *)
calloc(sizeof(stack->stack_data[0]) * stack->sp_max, 1);
memcpy(sd->npc_stackbuf, stack->stack_data,
sizeof(stack->stack_data[0]) * stack->sp_max);
diff --git a/src/map/skill-pools.cpp b/src/map/skill-pools.cpp
index c26d9cc..6f2db8a 100644
--- a/src/map/skill-pools.cpp
+++ b/src/map/skill-pools.cpp
@@ -21,6 +21,8 @@
#include "pc.hpp"
#include "script.hpp"
+#include "../poison.hpp"
+
SkillID skill_pool_skills[MAX_POOL_SKILLS];
int skill_pool_skills_size = 0;
diff --git a/src/map/skill.cpp b/src/map/skill.cpp
index aef0712..bab0db2 100644
--- a/src/map/skill.cpp
+++ b/src/map/skill.cpp
@@ -21,6 +21,8 @@
#include "pc.hpp"
#include "script.hpp"
+#include "../poison.hpp"
+
#define SKILLUNITTIMER_INVERVAL 100
// This table appears to be wrong
diff --git a/src/map/storage.cpp b/src/map/storage.cpp
index d212c9d..151c8b4 100644
--- a/src/map/storage.cpp
+++ b/src/map/storage.cpp
@@ -18,6 +18,8 @@
#include "itemdb.hpp"
#include "pc.hpp"
+#include "../poison.hpp"
+
static
struct dbt *storage_db;
diff --git a/src/map/tmw.cpp b/src/map/tmw.cpp
index c08c161..84c84ef 100644
--- a/src/map/tmw.cpp
+++ b/src/map/tmw.cpp
@@ -26,6 +26,8 @@
#include "storage.hpp"
#include "trade.hpp"
+#include "../poison.hpp"
+
static
void tmw_AutoBan(struct map_session_data *sd, const char *reason, int length);
static
diff --git a/src/map/trade.cpp b/src/map/trade.cpp
index 6b44752..8881ea1 100644
--- a/src/map/trade.cpp
+++ b/src/map/trade.cpp
@@ -13,6 +13,8 @@
#include "pc.hpp"
#include "storage.hpp"
+#include "../poison.hpp"
+
/*==========================================
* 取引要請を相手に送る
*------------------------------------------
@@ -166,12 +168,10 @@ void trade_tradeadditem(struct map_session_data *sd, int index, int amount)
target_sd->max_weight)
{
clif_tradeitemok(sd, index, 0, 1); //fail to add item -- the player was over weighted.
- amount = 0; // [MouseJstr]
}
else if (free <= 0)
{
clif_tradeitemok(sd, index, 0, 2); //fail to add item -- no free slots at receiver
- amount = 0; // peavey
}
else
{