|
@@ -47,7 +47,7 @@
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
|
-#define PVP_CALCRANK_INTERVAL 1000 // PVP順位計算の間隔
|
|
|
+#define PVP_CALCRANK_INTERVAL 1000 // PVP calculation interval
|
|
|
static unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL];
|
|
|
static unsigned int max_level[CLASS_COUNT][2];
|
|
|
static unsigned int statp[MAX_LEVEL+1];
|
|
@@ -289,7 +289,7 @@ int pc_banding(struct map_session_data *sd, short skill_lv) {
|
|
|
memset(b_sd, 0, sizeof(b_sd));
|
|
|
i = party_foreachsamemap(pc_check_banding,sd,range,&sd->bl,&c,&b_sd);
|
|
|
|
|
|
- if( c < 1 )
|
|
|
+ if( c < 1 ) //just recalc status no need to recalc hp
|
|
|
{ // No more Royal Guards in Banding found.
|
|
|
if( (sc = status_get_sc(&sd->bl)) != NULL && sc->data[SC_BANDING] )
|
|
|
{
|
|
@@ -559,7 +559,7 @@ int pc_makesavestatus(struct map_session_data *sd)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * 接?暫フ初期�?
|
|
|
+ * Off init ? Connection?
|
|
|
*------------------------------------------*/
|
|
|
int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd)
|
|
|
{
|
|
@@ -833,10 +833,15 @@ bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd,
|
|
|
return false; // Job Change Fail
|
|
|
}
|
|
|
|
|
|
+/*=================================================
|
|
|
+ * Can the player equip the item at index n in inventory
|
|
|
+ * return
|
|
|
+ * 0 = no
|
|
|
+ * 1 = yes
|
|
|
+ *------------------------------------------------*/
|
|
|
int pc_isequip(struct map_session_data *sd,int n)
|
|
|
{
|
|
|
struct item_data *item;
|
|
|
- //?生や養子の場合の元の職業を算出する
|
|
|
|
|
|
nullpo_ret(sd);
|
|
|
|
|
@@ -917,8 +922,8 @@ int pc_isequip(struct map_session_data *sd,int n)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * session idに問題無し
|
|
|
- * char鯖から送られてきたステ?タスを設定
|
|
|
+ * No problem with the session id
|
|
|
+ * set the status that has been sent from char server
|
|
|
*------------------------------------------*/
|
|
|
bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers)
|
|
|
{
|
|
@@ -1037,7 +1042,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
|
|
|
for( i = 0; i < 3; i++ )
|
|
|
sd->hate_mob[i] = -1;
|
|
|
|
|
|
- // 位置の設定
|
|
|
+ //warp player
|
|
|
if ((i=pc_setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, CLR_OUTSIGHT)) != 0) {
|
|
|
ShowError ("Last_point_map %s - id %d not found (error code %d)\n", mapindex_id2name(sd->status.last_point.map), sd->status.last_point.map, i);
|
|
|
|
|
@@ -1272,7 +1277,7 @@ static int pc_calc_skillpoint(struct map_session_data* sd)
|
|
|
|
|
|
|
|
|
/*==========================================
|
|
|
- * ?えられるスキルの計算
|
|
|
+ * Calculation of Skills lvls
|
|
|
*------------------------------------------*/
|
|
|
int pc_calc_skilltree(struct map_session_data *sd)
|
|
|
{
|
|
@@ -2015,7 +2020,7 @@ int pc_bonus_subele(struct map_session_data* sd, unsigned char ele, short rate,
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * ? 備品による能力等のボ?ナス設定
|
|
|
+ * ? �ス�ス�スi�スノゑソス�ス\�スヘ難ソス�スフボ?�スi�スX�スン抵ソス
|
|
|
*------------------------------------------*/
|
|
|
int pc_bonus(struct map_session_data *sd,int type,int val)
|
|
|
{
|
|
@@ -2613,7 +2618,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * ? 備品による能力等のボ?ナス設定
|
|
|
+ * ? �ス�ス�スi�スノゑソス�ス\�スヘ難ソス�スフボ?�スi�スX�スン抵ソス
|
|
|
*------------------------------------------*/
|
|
|
int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|
|
{
|
|
@@ -3438,7 +3443,7 @@ int pc_skill(TBL_PC* sd, int id, int level, int flag)
|
|
|
return 1;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- * カ?ド?入
|
|
|
+ * Append a card to an item ?
|
|
|
*------------------------------------------*/
|
|
|
int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
|
|
|
{
|
|
@@ -3493,18 +3498,18 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
|
|
|
}
|
|
|
|
|
|
//
|
|
|
-// アイテム物
|
|
|
+// Items
|
|
|
//
|
|
|
|
|
|
/*==========================================
|
|
|
- * スキルによる買い値修正
|
|
|
+ * Update buying value by skills
|
|
|
*------------------------------------------*/
|
|
|
int pc_modifybuyvalue(struct map_session_data *sd,int orig_value)
|
|
|
{
|
|
|
int skill,val = orig_value,rate1 = 0,rate2 = 0;
|
|
|
- if((skill=pc_checkskill(sd,MC_DISCOUNT))>0) // ディスカウント
|
|
|
+ if((skill=pc_checkskill(sd,MC_DISCOUNT))>0) // merchant discount
|
|
|
rate1 = 5+skill*2-((skill==10)? 1:0);
|
|
|
- if((skill=pc_checkskill(sd,RG_COMPULSION))>0) // コムパルションディスカウント
|
|
|
+ if((skill=pc_checkskill(sd,RG_COMPULSION))>0) // rogue discount
|
|
|
rate2 = 5+skill*4;
|
|
|
if(rate1 < rate2) rate1 = rate2;
|
|
|
if(rate1)
|
|
@@ -3516,12 +3521,12 @@ int pc_modifybuyvalue(struct map_session_data *sd,int orig_value)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * スキルによる?り値修正
|
|
|
+ * Update selling value by skills
|
|
|
*------------------------------------------*/
|
|
|
int pc_modifysellvalue(struct map_session_data *sd,int orig_value)
|
|
|
{
|
|
|
int skill,val = orig_value,rate = 0;
|
|
|
- if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0) // オ?バ?チャ?ジ
|
|
|
+ if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0) //OverCharge
|
|
|
rate = 5+skill*2-((skill==10)? 1:0);
|
|
|
if(rate)
|
|
|
val = (int)((double)orig_value*(double)(100+rate)/100.);
|
|
@@ -3532,8 +3537,8 @@ int pc_modifysellvalue(struct map_session_data *sd,int orig_value)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * アイテムを買った暫ノ、新しいアイテム欄を使うか、
|
|
|
- * 3万個制限にかかるか確認
|
|
|
+ * Checking if we have enough place on inventory for new item
|
|
|
+ * Make sure to take 30k as limit (for client I guess)
|
|
|
*------------------------------------------*/
|
|
|
int pc_checkadditem(struct map_session_data *sd,int nameid,int amount)
|
|
|
{
|
|
@@ -3566,7 +3571,8 @@ int pc_checkadditem(struct map_session_data *sd,int nameid,int amount)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * 空きアイテム欄の個?
|
|
|
+ * Return number of available place in inventory
|
|
|
+ * Each non stackable item will reduce place by 1
|
|
|
*------------------------------------------*/
|
|
|
int pc_inventoryblank(struct map_session_data *sd)
|
|
|
{
|
|
@@ -3726,7 +3732,7 @@ int pc_getzeny(struct map_session_data *sd,int zeny)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * アイテムを探して、インデックスを返す
|
|
|
+ * Searching a specified itemid in inventory and return his stored index
|
|
|
*------------------------------------------*/
|
|
|
int pc_search_inventory(struct map_session_data *sd,int item_id)
|
|
|
{
|
|
@@ -3738,7 +3744,16 @@ int pc_search_inventory(struct map_session_data *sd,int item_id)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * アイテム追加。個?のみitem構造?の?字を無視
|
|
|
+ * Attempt tp add a new item in inventory
|
|
|
+ * return
|
|
|
+ 0 = success
|
|
|
+ 1 = invalid itemid not found or negative amount
|
|
|
+ 2 = overweight
|
|
|
+ 3 = ?
|
|
|
+ 4 = no free place found
|
|
|
+ 5 = max amount reached
|
|
|
+ 6 = ?
|
|
|
+ 7 = stack limitation
|
|
|
*------------------------------------------*/
|
|
|
int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type)
|
|
|
{
|
|
@@ -3821,7 +3836,10 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * アイテムを減らす
|
|
|
+ * Remove an item at index n from inventory by amount
|
|
|
+ * return
|
|
|
+ * 0 = succes
|
|
|
+ * 1 = invalid itemid or negative amount
|
|
|
*------------------------------------------*/
|
|
|
int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type)
|
|
|
{
|
|
@@ -3849,7 +3867,10 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reas
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * アイテムを落す
|
|
|
+ * Attempt to drop an item
|
|
|
+ * return
|
|
|
+ * 0 = fail
|
|
|
+ * 1 = success
|
|
|
*------------------------------------------*/
|
|
|
int pc_dropitem(struct map_session_data *sd,int n,int amount)
|
|
|
{
|
|
@@ -3890,7 +3911,10 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * アイテムを拾う
|
|
|
+ * Attempt to pickup an item
|
|
|
+ * return
|
|
|
+ * 0 = fail
|
|
|
+ * 1 = success
|
|
|
*------------------------------------------*/
|
|
|
int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
|
|
|
{
|
|
@@ -3903,7 +3927,7 @@ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
|
|
|
nullpo_ret(fitem);
|
|
|
|
|
|
if(!check_distance_bl(&fitem->bl, &sd->bl, 2) && sd->ud.skillid!=BS_GREED)
|
|
|
- return 0; // 距離が遠い
|
|
|
+ return 0; // Distance is too far
|
|
|
|
|
|
if (sd->status.party_id)
|
|
|
p = party_search(sd->status.party_id);
|
|
@@ -3957,6 +3981,12 @@ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+/*==========================================
|
|
|
+ * Can we use the item ?
|
|
|
+ * Return
|
|
|
+ * 0 = no
|
|
|
+ * 1 = yes
|
|
|
+ *------------------------------------------*/
|
|
|
int pc_isUseitem(struct map_session_data *sd,int n)
|
|
|
{
|
|
|
struct item_data *item;
|
|
@@ -3975,7 +4005,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
|
|
|
if( !item->script ) //if it has no script, you can't really consume it!
|
|
|
return 0;
|
|
|
|
|
|
- switch( nameid )
|
|
|
+ switch( nameid ) //@TODO, lot oh harcoded nameid here
|
|
|
{
|
|
|
case 605: // Anodyne
|
|
|
if( map_flag_gvg(sd->bl.m) )
|
|
@@ -4117,7 +4147,10 @@ int pc_isUseitem(struct map_session_data *sd,int n)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * アイテムを使う
|
|
|
+ * Last checks et use item
|
|
|
+ * return
|
|
|
+ * 0 = fail
|
|
|
+ * 1 = success
|
|
|
*------------------------------------------*/
|
|
|
int pc_useitem(struct map_session_data *sd,int n)
|
|
|
{
|
|
@@ -4240,7 +4273,10 @@ int pc_useitem(struct map_session_data *sd,int n)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * カ?トアイテム追加。個?のみitem構造?の?字を無視
|
|
|
+ * Add item on cart for given index
|
|
|
+ * return
|
|
|
+ * 0 = success
|
|
|
+ * 1 = fail
|
|
|
*------------------------------------------*/
|
|
|
int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type)
|
|
|
{
|
|
@@ -4306,7 +4342,10 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * カ?トアイテムを減らす
|
|
|
+ * Delete item on cart for given index
|
|
|
+ * return
|
|
|
+ * 0 = success
|
|
|
+ * 1 = fail
|
|
|
*------------------------------------------*/
|
|
|
int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type)
|
|
|
{
|
|
@@ -4333,7 +4372,10 @@ int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * カ?トへアイテム移動
|
|
|
+ * Transfert item from inventory to cart
|
|
|
+ * return
|
|
|
+ * 0 = fail
|
|
|
+ * 1 = succes
|
|
|
*------------------------------------------*/
|
|
|
int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
|
|
|
{
|
|
@@ -4356,7 +4398,10 @@ int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * カ?ト?のアイテム?確認(個?の差分を返す)
|
|
|
+ * Get number of item on cart
|
|
|
+ * return
|
|
|
+ -1 = itemid not found or no amount found
|
|
|
+ x = remaining itemid on cart after get
|
|
|
*------------------------------------------*/
|
|
|
int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount)
|
|
|
{
|
|
@@ -4372,7 +4417,10 @@ int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * カ?トからアイテム移動
|
|
|
+ * Retrieve an item at index idx from cart
|
|
|
+ * return
|
|
|
+ * 0 = player not found or (FIXME) succes (from pc_cart_delitem)
|
|
|
+ * 1 = failure
|
|
|
*------------------------------------------*/
|
|
|
int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
|
|
|
{
|
|
@@ -4396,7 +4444,7 @@ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * スティル品公開
|
|
|
+ * Display item stolen msg to player sd
|
|
|
*------------------------------------------*/
|
|
|
int pc_show_steal(struct block_list *bl,va_list ap)
|
|
|
{
|
|
@@ -4418,7 +4466,10 @@ int pc_show_steal(struct block_list *bl,va_list ap)
|
|
|
return 0;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- *
|
|
|
+ * Stole an item from bl (mob)
|
|
|
+ * return
|
|
|
+ * 0 = fail
|
|
|
+ * 1 = succes
|
|
|
*------------------------------------------*/
|
|
|
int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv)
|
|
|
{
|
|
@@ -4499,7 +4550,10 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- *
|
|
|
+ * Stole zeny from bl (mob)
|
|
|
+ * return
|
|
|
+ * 0 = fail
|
|
|
+ * 1 = success
|
|
|
*------------------------------------------*/
|
|
|
int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
|
|
|
{
|
|
@@ -4699,7 +4753,11 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * PCのランダムワ?プ
|
|
|
+ * Warp player sd to random location on current map
|
|
|
+ * may fail if no Cell walkable found (1000 attempt)
|
|
|
+ * return
|
|
|
+ * 0 = fail or FIXME succes (from pc_setpos)
|
|
|
+ * x(1|2) = fail
|
|
|
*------------------------------------------*/
|
|
|
int pc_randomwarp(struct map_session_data *sd, clr_type type)
|
|
|
{
|
|
@@ -4710,7 +4768,7 @@ int pc_randomwarp(struct map_session_data *sd, clr_type type)
|
|
|
|
|
|
m=sd->bl.m;
|
|
|
|
|
|
- if (map[sd->bl.m].flag.noteleport) // テレポ?ト禁止
|
|
|
+ if (map[sd->bl.m].flag.noteleport) //Teleport forbiden
|
|
|
return 0;
|
|
|
|
|
|
do{
|
|
@@ -4774,10 +4832,10 @@ int pc_memo(struct map_session_data* sd, int pos)
|
|
|
}
|
|
|
|
|
|
//
|
|
|
-// 武器??
|
|
|
+// Skills
|
|
|
//
|
|
|
/*==========================================
|
|
|
- * スキルの?索 所有していた場合Lvが返る
|
|
|
+ * Return player sd skilllv learned for given skill
|
|
|
*------------------------------------------*/
|
|
|
int pc_checkskill(struct map_session_data *sd,int skill_id)
|
|
|
{
|
|
@@ -4803,13 +4861,13 @@ int pc_checkskill(struct map_session_data *sd,int skill_id)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * 武器?更によるスキルの??チェック
|
|
|
- * 引?:
|
|
|
- * struct map_session_data *sd セッションデ?タ
|
|
|
- * int nameid ?備品ID
|
|
|
- * 返り値:
|
|
|
- * 0 ?更なし
|
|
|
- * -1 スキルを解除
|
|
|
+ * �ス�ス�ス�ス?�スX�スノゑソス�スX�スL�ス�ス�ス�ス??�ス`�スF�スb�スN
|
|
|
+ * �ス�ス?�スF
|
|
|
+ * struct map_session_data *sd �スZ�スb�スV�ス�ス�ス�ス�スf?�ス^
|
|
|
+ * int nameid ?�ス�ス�スiID
|
|
|
+ * �スヤゑソスl�スF
|
|
|
+ * 0 ?�スX�スネゑソス
|
|
|
+ * -1 �スX�スL�ス�ス�ス�ス�ス�ス�ス�ス
|
|
|
*------------------------------------------*/
|
|
|
int pc_checkallowskill(struct map_session_data *sd)
|
|
|
{
|
|
@@ -4859,7 +4917,8 @@ int pc_checkallowskill(struct map_session_data *sd)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * ? 備品のチェック
|
|
|
+ * Return equiped itemid? on player sd at pos
|
|
|
+ * if -1 mean nothing equiped
|
|
|
*------------------------------------------*/
|
|
|
int pc_checkequip(struct map_session_data *sd,int pos)
|
|
|
{
|
|
@@ -5562,7 +5621,7 @@ static void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsi
|
|
|
return;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- * ??値取得
|
|
|
+ * Give x exp at sd player and calculate remaining exp for next lvl
|
|
|
*------------------------------------------*/
|
|
|
int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp,unsigned int job_exp,bool quest)
|
|
|
{
|
|
@@ -5655,8 +5714,10 @@ unsigned int pc_maxjoblv(struct map_session_data *sd)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * base level側必要??値計算
|
|
|
+ * base level exp lookup.
|
|
|
*------------------------------------------*/
|
|
|
+
|
|
|
+///How much bexp do player need for next level
|
|
|
unsigned int pc_nextbaseexp(struct map_session_data *sd)
|
|
|
{
|
|
|
nullpo_ret(sd);
|
|
@@ -5667,6 +5728,7 @@ unsigned int pc_nextbaseexp(struct map_session_data *sd)
|
|
|
return exp_table[pc_class2idx(sd->status.class_)][0][sd->status.base_level-1];
|
|
|
}
|
|
|
|
|
|
+///How much bexp do player need for this level
|
|
|
unsigned int pc_thisbaseexp(struct map_session_data *sd)
|
|
|
{
|
|
|
if(sd->status.base_level>pc_maxbaselv(sd) || sd->status.base_level<=1)
|
|
@@ -5677,8 +5739,13 @@ unsigned int pc_thisbaseexp(struct map_session_data *sd)
|
|
|
|
|
|
|
|
|
/*==========================================
|
|
|
- * job level側必要??値計算
|
|
|
+ * job level exp lookup
|
|
|
+ * return
|
|
|
+ * 0 = not found
|
|
|
+ * x = exp for level
|
|
|
*------------------------------------------*/
|
|
|
+
|
|
|
+///How much jexp do player need for next level
|
|
|
unsigned int pc_nextjobexp(struct map_session_data *sd)
|
|
|
{
|
|
|
nullpo_ret(sd);
|
|
@@ -5688,6 +5755,7 @@ unsigned int pc_nextjobexp(struct map_session_data *sd)
|
|
|
return exp_table[pc_class2idx(sd->status.class_)][1][sd->status.job_level-1];
|
|
|
}
|
|
|
|
|
|
+///How much jexp do player need for next level
|
|
|
unsigned int pc_thisjobexp(struct map_session_data *sd)
|
|
|
{
|
|
|
if(sd->status.job_level>pc_maxjoblv(sd) || sd->status.job_level<=1)
|
|
@@ -5857,7 +5925,8 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * スキルポイント割り振り
|
|
|
+ * Update skilllv for player sd
|
|
|
+ * Skill point allocation
|
|
|
*------------------------------------------*/
|
|
|
int pc_skillup(struct map_session_data *sd,int skill_num)
|
|
|
{
|
|
@@ -6353,6 +6422,9 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h
|
|
|
sd->canlog_tick = gettick();
|
|
|
}
|
|
|
|
|
|
+/*==========================================
|
|
|
+ * Invoked when a player have negative current hp
|
|
|
+ *------------------------------------------*/
|
|
|
int pc_dead(struct map_session_data *sd,struct block_list *src)
|
|
|
{
|
|
|
int i=0,j=0,k=0;
|
|
@@ -6684,10 +6756,10 @@ void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) {
|
|
|
guild_guildaura_refresh(sd,GD_HAWKEYES,guild_checkskill(sd->state.gmaster_flag,GD_HAWKEYES));
|
|
|
}
|
|
|
}
|
|
|
-// script? 連
|
|
|
+// script
|
|
|
//
|
|
|
/*==========================================
|
|
|
- * script用PCステ?タス?み出し
|
|
|
+ * script reading pc status registry
|
|
|
*------------------------------------------*/
|
|
|
int pc_readparam(struct map_session_data* sd,int type)
|
|
|
{
|
|
@@ -6733,7 +6805,7 @@ int pc_readparam(struct map_session_data* sd,int type)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * script用PCステ?タス設定
|
|
|
+ * script set pc status registry
|
|
|
*------------------------------------------*/
|
|
|
int pc_setparam(struct map_session_data *sd,int type,int val)
|
|
|
{
|
|
@@ -6901,7 +6973,9 @@ void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int ty
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * HP/SP回復
|
|
|
+ * HP/SP Recovery
|
|
|
+ * Heal player hp nad/or sp linearly
|
|
|
+ * Calculate bonus by status
|
|
|
*------------------------------------------*/
|
|
|
int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
|
|
|
{
|
|
@@ -6967,7 +7041,8 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * HP/SP回復
|
|
|
+ * HP/SP Recovery
|
|
|
+ * Heal player hp nad/or sp by rate
|
|
|
*------------------------------------------*/
|
|
|
int pc_percentheal(struct map_session_data *sd,int hp,int sp)
|
|
|
{
|
|
@@ -7005,9 +7080,7 @@ int pc_percentheal(struct map_session_data *sd,int hp,int sp)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * 職?更
|
|
|
- * 引? job 職業 0~23
|
|
|
- * upper 通常 0, ?生 1, 養子 2, そのまま -1
|
|
|
+ * Called when player changing job
|
|
|
* Rewrote to make it tidider [Celest]
|
|
|
*------------------------------------------*/
|
|
|
int pc_jobchange(struct map_session_data *sd,int job, int upper)
|
|
@@ -7099,7 +7172,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
|
|
|
for(i=0;i<EQI_MAX;i++) {
|
|
|
if(sd->equip_index[i] >= 0)
|
|
|
if(!pc_isequip(sd,sd->equip_index[i]))
|
|
|
- pc_unequipitem(sd,sd->equip_index[i],2); // ?備外し
|
|
|
+ pc_unequipitem(sd,sd->equip_index[i],2); // unequip invalid item for class
|
|
|
}
|
|
|
|
|
|
//Change look, if disguised, you need to undisguise
|
|
@@ -7170,7 +7243,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * 見た目?更
|
|
|
+ * Tell client player sd has change equipement
|
|
|
*------------------------------------------*/
|
|
|
int pc_equiplookall(struct map_session_data *sd)
|
|
|
{
|
|
@@ -7187,7 +7260,7 @@ int pc_equiplookall(struct map_session_data *sd)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * 見た目?更
|
|
|
+ * Tell client player sd has change look (hair,equip...)
|
|
|
*------------------------------------------*/
|
|
|
int pc_changelook(struct map_session_data *sd,int type,int val)
|
|
|
{
|
|
@@ -7247,7 +7320,7 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * 付?品(鷹,ペコ,カ?ト)設定
|
|
|
+ * Give an option (type) to player (sd) and display it to client
|
|
|
*------------------------------------------*/
|
|
|
int pc_setoption(struct map_session_data *sd,int type)
|
|
|
{
|
|
@@ -7364,7 +7437,7 @@ int pc_setoption(struct map_session_data *sd,int type)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * カ?ト設定
|
|
|
+ * Give player a cart
|
|
|
*------------------------------------------*/
|
|
|
int pc_setcart(struct map_session_data *sd,int type) {
|
|
|
#ifndef NEW_CARTS
|
|
@@ -7414,12 +7487,12 @@ int pc_setcart(struct map_session_data *sd,int type) {
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * 鷹設定
|
|
|
+ * Give player a falcon
|
|
|
*------------------------------------------*/
|
|
|
int pc_setfalcon(TBL_PC* sd, int flag)
|
|
|
{
|
|
|
if( flag ){
|
|
|
- if( pc_checkskill(sd,HT_FALCON)>0 ) // ファルコンマスタリ?スキル所持
|
|
|
+ if( pc_checkskill(sd,HT_FALCON)>0 ) // �スt�ス@�ス�ス�スR�ス�ス�ス}�スX�ス^�ス�ス?�スX�スL�ス�ス�ス�ス�ス�ス
|
|
|
pc_setoption(sd,sd->sc.option|OPTION_FALCON);
|
|
|
} else if( pc_isfalcon(sd) ){
|
|
|
pc_setoption(sd,sd->sc.option&~OPTION_FALCON); // remove falcon
|
|
@@ -7429,12 +7502,12 @@ int pc_setfalcon(TBL_PC* sd, int flag)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * ペコペコ設定
|
|
|
+ * Set player riding
|
|
|
*------------------------------------------*/
|
|
|
int pc_setriding(TBL_PC* sd, int flag)
|
|
|
{
|
|
|
if( flag ){
|
|
|
- if( pc_checkskill(sd,KN_RIDING) > 0 ) // ライディングスキル所持
|
|
|
+ if( pc_checkskill(sd,KN_RIDING) > 0 ) // �ス�ス�スC�スf�スB�ス�ス�スO�スX�スL�ス�ス�ス�ス�ス�ス
|
|
|
pc_setoption(sd, sd->sc.option|OPTION_RIDING);
|
|
|
} else if( pc_isriding(sd) ){
|
|
|
pc_setoption(sd, sd->sc.option&~OPTION_RIDING);
|
|
@@ -7444,7 +7517,7 @@ int pc_setriding(TBL_PC* sd, int flag)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- *
|
|
|
+ * Give player a mado
|
|
|
*------------------------------------------*/
|
|
|
int pc_setmadogear(TBL_PC* sd, int flag)
|
|
|
{
|
|
@@ -7459,7 +7532,7 @@ int pc_setmadogear(TBL_PC* sd, int flag)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * アイテムドロップ可不可判定
|
|
|
+ * Check if player can drop an item
|
|
|
*------------------------------------------*/
|
|
|
int pc_candrop(struct map_session_data *sd, struct item *item)
|
|
|
{
|
|
@@ -7471,7 +7544,8 @@ int pc_candrop(struct map_session_data *sd, struct item *item)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * script用??の値を?む
|
|
|
+ * Read ram register for player sd
|
|
|
+ * get val (int) from reg for player sd
|
|
|
*------------------------------------------*/
|
|
|
int pc_readreg(struct map_session_data* sd, int reg)
|
|
|
{
|
|
@@ -7483,7 +7557,8 @@ int pc_readreg(struct map_session_data* sd, int reg)
|
|
|
return ( i < sd->reg_num ) ? sd->reg[i].data : 0;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- * script用??の値を設定
|
|
|
+ * Set ram register for player sd
|
|
|
+ * memo val(int) at reg for player sd
|
|
|
*------------------------------------------*/
|
|
|
int pc_setreg(struct map_session_data* sd, int reg, int val)
|
|
|
{
|
|
@@ -7511,7 +7586,8 @@ int pc_setreg(struct map_session_data* sd, int reg, int val)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * script用文字列??の値を?む
|
|
|
+ * Read ram register for player sd
|
|
|
+ * get val (str) from reg for player sd
|
|
|
*------------------------------------------*/
|
|
|
char* pc_readregstr(struct map_session_data* sd, int reg)
|
|
|
{
|
|
@@ -7523,7 +7599,8 @@ char* pc_readregstr(struct map_session_data* sd, int reg)
|
|
|
return ( i < sd->regstr_num ) ? sd->regstr[i].data : NULL;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- * script用文字列??の値を設定
|
|
|
+ * Set ram register for player sd
|
|
|
+ * memo val(str) at reg for player sd
|
|
|
*------------------------------------------*/
|
|
|
int pc_setregstr(struct map_session_data* sd, int reg, const char* str)
|
|
|
{
|
|
@@ -7803,7 +7880,7 @@ int pc_setregistry_str(struct map_session_data *sd,const char *reg,const char *v
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * イベントタイマ??理
|
|
|
+ * Exec eventtimer for player sd (retrieved from map_session (id))
|
|
|
*------------------------------------------*/
|
|
|
static int pc_eventtimer(int tid, unsigned int tick, int id, intptr_t data)
|
|
|
{
|
|
@@ -7828,7 +7905,7 @@ static int pc_eventtimer(int tid, unsigned int tick, int id, intptr_t data)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * イベントタイマ?追加
|
|
|
+ * Add eventtimer for player sd ?
|
|
|
*------------------------------------------*/
|
|
|
int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name)
|
|
|
{
|
|
@@ -7846,7 +7923,7 @@ int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * イベントタイマ?削除
|
|
|
+ * Del eventtimer for player sd ?
|
|
|
*------------------------------------------*/
|
|
|
int pc_deleventtimer(struct map_session_data *sd,const char *name)
|
|
|
{
|
|
@@ -7876,7 +7953,7 @@ int pc_deleventtimer(struct map_session_data *sd,const char *name)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * イベントタイマ?カウント値追加
|
|
|
+ * Update eventtimer count for player sd
|
|
|
*------------------------------------------*/
|
|
|
int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick)
|
|
|
{
|
|
@@ -7895,7 +7972,7 @@ int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * イベントタイマ?全削除
|
|
|
+ * Remove all eventtimer for player sd
|
|
|
*------------------------------------------*/
|
|
|
int pc_cleareventtimer(struct map_session_data *sd)
|
|
|
{
|
|
@@ -8068,7 +8145,7 @@ int pc_load_combo(struct map_session_data *sd) {
|
|
|
return ret;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- * Attempt to equip item in inventory index 'n' in the EQP_ 'req_pos'
|
|
|
+ * Equip item on player sd at req_pos from inventory index n
|
|
|
*------------------------------------------*/
|
|
|
int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
|
|
|
{
|
|
@@ -8269,7 +8346,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * ? 備した物を外す
|
|
|
+ * Called when attemting to unequip an item from player
|
|
|
* type:
|
|
|
* 0 - only unequip
|
|
|
* 1 - calculate status after unequipping
|
|
@@ -8432,8 +8509,8 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * アイテムのindex番?を詰めたり
|
|
|
- * ? 備品の?備可能チェックを行なう
|
|
|
+ * Checking if player (sd) have unauthorize, invalide item
|
|
|
+ * on inventory, cart, equiped for the map (item_noequip)
|
|
|
*------------------------------------------*/
|
|
|
int pc_checkitem(struct map_session_data *sd)
|
|
|
{
|
|
@@ -8513,7 +8590,7 @@ int pc_checkitem(struct map_session_data *sd)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * PVP順位計算用(foreachinarea)
|
|
|
+ * Update PVP rank for sd1 in cmp to sd2
|
|
|
*------------------------------------------*/
|
|
|
int pc_calc_pvprank_sub(struct block_list *bl,va_list ap)
|
|
|
{
|
|
@@ -8532,7 +8609,8 @@ int pc_calc_pvprank_sub(struct block_list *bl,va_list ap)
|
|
|
return 0;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- * PVP順位計算
|
|
|
+ * Calculate new rank beetween all present players (map_foreachinarea)
|
|
|
+ * and display result
|
|
|
*------------------------------------------*/
|
|
|
int pc_calc_pvprank(struct map_session_data *sd)
|
|
|
{
|
|
@@ -8547,7 +8625,7 @@ int pc_calc_pvprank(struct map_session_data *sd)
|
|
|
return sd->pvp_rank;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- * PVP順位計算(timer)
|
|
|
+ * Calculate next sd ranking calculation from config
|
|
|
*------------------------------------------*/
|
|
|
int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr_t data)
|
|
|
{
|
|
@@ -8569,7 +8647,10 @@ int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr_t data)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * sdは結婚しているか(?婚の場合は相方のchar_idを返す)
|
|
|
+ * Checking if sd is married
|
|
|
+ * Return
|
|
|
+ * partner_id = yes,
|
|
|
+ * 0 = no
|
|
|
*------------------------------------------*/
|
|
|
int pc_ismarried(struct map_session_data *sd)
|
|
|
{
|
|
@@ -8581,7 +8662,10 @@ int pc_ismarried(struct map_session_data *sd)
|
|
|
return 0;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- * sdがdstsdと結婚(dstsd→sdの結婚?理も同暫ノ行う)
|
|
|
+ * Marry player sd to player dstsd
|
|
|
+ * return
|
|
|
+ * -1 = fail
|
|
|
+ * 0 = success
|
|
|
*------------------------------------------*/
|
|
|
int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd)
|
|
|
{
|
|
@@ -8596,6 +8680,9 @@ int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd)
|
|
|
|
|
|
/*==========================================
|
|
|
* Divorce sd from its partner
|
|
|
+ * return
|
|
|
+ * -1 = fail
|
|
|
+ * 0 = success
|
|
|
*------------------------------------------*/
|
|
|
int pc_divorce(struct map_session_data *sd)
|
|
|
{
|
|
@@ -8634,7 +8721,7 @@ int pc_divorce(struct map_session_data *sd)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * sdの相方のmap_session_dataを返す
|
|
|
+ * Get sd partner charid. (Married partner)
|
|
|
*------------------------------------------*/
|
|
|
struct map_session_data *pc_get_partner(struct map_session_data *sd)
|
|
|
{
|
|
@@ -8645,6 +8732,9 @@ struct map_session_data *pc_get_partner(struct map_session_data *sd)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
+/*==========================================
|
|
|
+ * Get sd father charid. (Need to be baby)
|
|
|
+ *------------------------------------------*/
|
|
|
struct map_session_data *pc_get_father (struct map_session_data *sd)
|
|
|
{
|
|
|
if (sd && sd->class_&JOBL_BABY && sd->status.father > 0)
|
|
@@ -8654,6 +8744,9 @@ struct map_session_data *pc_get_father (struct map_session_data *sd)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
+/*==========================================
|
|
|
+ * Get sd mother charid. (Need to be baby)
|
|
|
+ *------------------------------------------*/
|
|
|
struct map_session_data *pc_get_mother (struct map_session_data *sd)
|
|
|
{
|
|
|
if (sd && sd->class_&JOBL_BABY && sd->status.mother > 0)
|
|
@@ -8663,6 +8756,9 @@ struct map_session_data *pc_get_mother (struct map_session_data *sd)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
+/*==========================================
|
|
|
+ * Get sd children charid. (Need to be married)
|
|
|
+ *------------------------------------------*/
|
|
|
struct map_session_data *pc_get_child (struct map_session_data *sd)
|
|
|
{
|
|
|
if (sd && pc_ismarried(sd) && sd->status.child > 0)
|
|
@@ -8672,6 +8768,9 @@ struct map_session_data *pc_get_child (struct map_session_data *sd)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
+/*==========================================
|
|
|
+ * Set player sd to bleed. (losing hp and/or sp each diff_tick)
|
|
|
+ *------------------------------------------*/
|
|
|
void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick)
|
|
|
{
|
|
|
int hp = 0, sp = 0;
|
|
@@ -8733,7 +8832,7 @@ void pc_regen (struct map_session_data *sd, unsigned int diff_tick)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * セ?ブポイントの保存
|
|
|
+ * Memo player sd savepoint. (map,x,y)
|
|
|
*------------------------------------------*/
|
|
|
int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
|
|
|
{
|
|
@@ -8747,7 +8846,7 @@ int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * 自動セ?ブ (timer??)
|
|
|
+ * Save 1 player data at autosave intervalle
|
|
|
*------------------------------------------*/
|
|
|
int pc_autosave(int tid, unsigned int tick, int id, intptr_t data)
|
|
|
{
|
|
@@ -8864,7 +8963,7 @@ void pc_overheat(struct map_session_data *sd, int val) {
|
|
|
skill = cap_value(pc_checkskill(sd,NC_MAINFRAME),0,4);
|
|
|
if( sd->sc.data[SC_OVERHEAT_LIMITPOINT] ) {
|
|
|
heat += sd->sc.data[SC_OVERHEAT_LIMITPOINT]->val1;
|
|
|
- status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,-1);
|
|
|
+ status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,INVALID_TIMER);
|
|
|
}
|
|
|
|
|
|
heat = max(0,heat); // Avoid negative HEAT
|
|
@@ -9067,11 +9166,8 @@ int pc_split_atoui(char* str, unsigned int* val, char sep, int max)
|
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
|
- * DB reading.
|
|
|
- * exp.txt - required experience values
|
|
|
- * skill_tree.txt - skill tree for every class
|
|
|
- * attr_fix.txt - elemental adjustment table
|
|
|
- * statpoint.txt - status points per base level
|
|
|
+ * sub DB reading.
|
|
|
+ * fonction used to read skill_tree.txt
|
|
|
*------------------------------------------*/
|
|
|
static bool pc_readdb_skilltree(char* fields[], int columns, int current)
|
|
|
{
|
|
@@ -9121,13 +9217,19 @@ static bool pc_readdb_skilltree(char* fields[], int columns, int current)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+/*==========================================
|
|
|
+ * pc DB reading.
|
|
|
+ * exp.txt - required experience values
|
|
|
+ * skill_tree.txt - skill tree for every class
|
|
|
+ * attr_fix.txt - elemental adjustment table
|
|
|
+ *------------------------------------------*/
|
|
|
int pc_readdb(void)
|
|
|
{
|
|
|
int i,j,k;
|
|
|
FILE *fp;
|
|
|
char line[24000],*p;
|
|
|
|
|
|
- // 必要??値?み?み
|
|
|
+ //reset
|
|
|
memset(exp_table,0,sizeof(exp_table));
|
|
|
memset(max_level,0,sizeof(max_level));
|
|
|
|
|
@@ -9212,12 +9314,11 @@ int pc_readdb(void)
|
|
|
}
|
|
|
ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","exp.txt");
|
|
|
|
|
|
- // スキルツリ?
|
|
|
+ // Reset and read skilltree
|
|
|
memset(skill_tree,0,sizeof(skill_tree));
|
|
|
-
|
|
|
sv_readdb(db_path, DBPATH"skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree);
|
|
|
|
|
|
- // ?性修正テ?ブル
|
|
|
+ // Reset then read attr_fix
|
|
|
for(i=0;i<4;i++)
|
|
|
for(j=0;j<ELE_MAX;j++)
|
|
|
for(k=0;k<ELE_MAX;k++)
|
|
@@ -9269,7 +9370,7 @@ int pc_readdb(void)
|
|
|
fclose(fp);
|
|
|
ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","attr_fix.txt");
|
|
|
|
|
|
- // スキルツリ?
|
|
|
+ // reset then read statspoint
|
|
|
memset(statp,0,sizeof(statp));
|
|
|
i=1;
|
|
|
|
|
@@ -9400,7 +9501,7 @@ void pc_itemcd_do(struct map_session_data *sd, bool load) {
|
|
|
return;
|
|
|
}
|
|
|
/*==========================================
|
|
|
- * pc? 係初期化
|
|
|
+ * pc Init/Terminate
|
|
|
*------------------------------------------*/
|
|
|
void do_final_pc(void) {
|
|
|
|