Index: conf/atcommand_athena.conf
===================================================================
--- conf/atcommand_athena.conf (revision 15963)
+++ conf/atcommand_athena.conf (working copy)
@@ -58,4 +58,4 @@
/* Commands help file */
help: {
@include "conf/help.txt"
-}
\ No newline at end of file
+}
Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c (revision 15963)
+++ src/map/atcommand.c (working copy)
@@ -52,6 +52,10 @@
#define ACMD_FUNC(x) static int atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message)
#define MAX_MSG 1000
+/// Atcommand suggestion settings
+#define MAX_SUGGESTIONS 10
+#define FULL_MATCH 1
+
typedef struct AtCommandInfo AtCommandInfo;
typedef struct AliasInfo AliasInfo;
@@ -79,6 +83,7 @@
static AtCommandInfo* get_atcommandinfo_byname(const char *name); // @help
static const char* atcommand_checkalias(const char *aliasname); // @help
+static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand); // @help
//-----------------------------------------------------------
// Return the message string of the specified number by [Yor]
@@ -1657,11 +1662,13 @@
if (!pc_can_use_command(sd, command_name, COMMAND_ATCOMMAND)) {
sprintf(atcmd_output, msg_txt(153), message); // "%s is Unknown Command"
clif_displaymessage(fd, atcmd_output);
+ atcommand_get_suggestions(sd, command_name, true);
return -1;
}
if (!config_setting_lookup_string(help, command_name, &text)) {
clif_displaymessage(fd, "There is no help for this command_name.");
+ atcommand_get_suggestions(sd, command_name, true);
return -1;
}
@@ -6251,7 +6258,7 @@
};
int i;
ARR_FIND( 0, ARRAYLENGTH(emo), i, stricmp(message, emo[i]) == 0 );
- if( i == E_DICE1 ) i = rand()%6 + E_DICE1; // randomize /dice
+ if( i == E_DICE1 ) i = rnd()%6 + E_DICE1; // randomize /dice
if( i < ARRAYLENGTH(emo) )
{
if (sd->emotionlasttime + 1 >= time(NULL)) { // not more than 1 per second
@@ -8744,6 +8751,66 @@
return aliasname;
}
+/// AtCommand suggestion
+static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand)
+{
+ DBIterator* atcommand_iter = db_iterator(atcommand_db);
+ DBIterator* alias_iter = db_iterator(atcommand_alias_db);
+ AtCommandInfo* command_info = NULL;
+ AliasInfo* alias_info = NULL;
+ AtCommandType type;
+ char* suggestions[MAX_SUGGESTIONS];
+ int count = 0;
+
+ if (atcommand)
+ type = COMMAND_ATCOMMAND;
+ else
+ type = COMMAND_CHARCOMMAND;
+
+ for (command_info = dbi_first(atcommand_iter); dbi_exists(atcommand_iter) && count < MAX_SUGGESTIONS; command_info = dbi_next(atcommand_iter)) {
+#if FULL_MATCH
+ if ( strstr(command_info->command, name) != NULL && pc_can_use_command(sd, command_info->command, type) )
+#else
+ if ( strstr(command_info->command, name) == command_info->command && pc_can_use_command(sd, command_info->command, type) )
+#endif
+ {
+ suggestions[count] = command_info->command;
+ ++count;
+ }
+ }
+
+ for (alias_info = dbi_first(alias_iter); dbi_exists(alias_iter) && count < MAX_SUGGESTIONS; alias_info = dbi_next(alias_iter)) {
+#if FULL_MATCH
+ if ( strstr(alias_info->alias, name) != NULL && pc_can_use_command(sd, alias_info->command->command, type) )
+#else
+ if ( strstr(alias_info->alias, name) == alias_info->alias && pc_can_use_command(sd, alias_info->command->command, type) )
+#endif
+ {
+ suggestions[count] = alias_info->alias;
+ ++count;
+ }
+ }
+
+ if (count > 0)
+ {
+ char buffer[512];
+ int i;
+
+ strcpy(buffer,"Maybe you meant:\n");
+
+ for(i=0; i < count; ++i)
+ {
+ strcat(buffer,suggestions[i]);
+ strcat(buffer," ");
+ }
+
+ clif_displaymessage(sd->fd, buffer);
+ }
+
+ dbi_destroy(atcommand_iter);
+ dbi_destroy(alias_iter);
+}
+
/// Executes an at-command.
bool is_atcommand(const int fd, struct map_session_data* sd, const char* message, int type)
{
@@ -8842,6 +8909,7 @@
if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission
sprintf(output, msg_txt(153), command); // "%s is Unknown Command."
clif_displaymessage(fd, output);
+ atcommand_get_suggestions(sd, command + 1, *message == atcommand_symbol);
return true;
} else
return false;
@@ -8998,4 +9066,4 @@
void do_final_atcommand(void)
{
atcommand_db_clear();
-}
\ No newline at end of file
+}
Index: src/map/script.c
===================================================================
--- src/map/script.c (revision 15963)
+++ src/map/script.c (working copy)
@@ -4226,6 +4226,7 @@
sd->npc_menu -= menu_countoptions(text, sd->npc_menu, &menu);
if( sd->npc_menu <= 0 )
break;// entry found
+ pc_setregstr(sd, add_str("@options$"),text);
}
pc_setreg(sd, add_str("@menu"), menu);
script_pushint(st, menu);
@@ -5467,10 +5468,10 @@
*------------------------------------------*/
BUILDIN_FUNC(countitem2)
{
- int nameid, iden, ref, attr, c1, c2, c3, c4;
int count = 0;
int i;
struct item_data* id = NULL;
+ struct item tmp_it;
struct script_data* data;
TBL_PC* sd = script_rid2sd(st);
@@ -5498,22 +5499,19 @@
return 1;
}
- nameid = id->nameid;
- iden = script_getnum(st,3);
- ref = script_getnum(st,4);
- attr = script_getnum(st,5);
- c1 = (short)script_getnum(st,6);
- c2 = (short)script_getnum(st,7);
- c3 = (short)script_getnum(st,8);
- c4 = (short)script_getnum(st,9);
+ tmp_it.nameid = id->nameid;
+ tmp_it.identify = script_getnum(st,3);
+ tmp_it.refine = script_getnum(st,4);
+ tmp_it.attribute = script_getnum(st,5);
+ tmp_it.card[0] = (short)script_getnum(st,6);
+ tmp_it.card[1] = (short)script_getnum(st,7);
+ tmp_it.card[2] = (short)script_getnum(st,8);
+ tmp_it.card[3] = (short)script_getnum(st,9);
for(i = 0; i < MAX_INVENTORY; i++)
- if (sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] != NULL &&
- sd->status.inventory[i].amount > 0 && sd->status.inventory[i].nameid == nameid &&
- sd->status.inventory[i].identify == iden && sd->status.inventory[i].refine == ref &&
- sd->status.inventory[i].attribute == attr && sd->status.inventory[i].card[0] == c1 &&
- sd->status.inventory[i].card[1] == c2 && sd->status.inventory[i].card[2] == c3 &&
- sd->status.inventory[i].card[3] == c4
+ if ( (&sd->status.inventory[i] != NULL)
+ && sd->status.inventory[i].amount > 0
+ && compare_item(&sd->status.inventory[i],&tmp_it,1)
)
count += sd->status.inventory[i].amount;
@@ -6384,7 +6382,7 @@
return 0;
}
/*==========================================
- *wèIDÌPTŒæŸ
+ * return the name of a partyid
*------------------------------------------*/
BUILDIN_FUNC(getpartyname)
{
@@ -9073,7 +9071,8 @@
}
/*==========================================
- * óÔÙíÏ«ðvZµœmŠðÔ·
+ * To get rate of a sc type, actually I don't really get it since we returning tick but oh well..
+ * @TODO that fonction doesn't take an consideration last status_change_start altering so...
*------------------------------------------*/
BUILDIN_FUNC(getscrate)
{
@@ -9616,7 +9615,9 @@
}
/*==========================================
- * RIDÌA^b`
+ * Attach un joueurs au script, st.rid
+ * Permet a un script d'executer des actions
+ * requierant un joueur autrement que par contact direct.
*------------------------------------------*/
BUILDIN_FUNC(attachrid)
{
Index: src/map/elemental.c
===================================================================
--- src/map/elemental.c (revision 15963)
+++ src/map/elemental.c (working copy)
@@ -9,6 +9,7 @@
#include "../common/mmo.h"
#include "../common/showmsg.h"
#include "../common/utils.h"
+#include "../common/random.h"
#include "log.h"
#include "clif.h"
@@ -247,12 +248,15 @@
case SC_UPHEAVAL_OPTION:
case SC_CIRCLE_OF_FIRE_OPTION:
case SC_TIDAL_WEAPON_OPTION:
- if( bl ) status_change_end(bl,type,-1); // Master
- status_change_end(&ed->bl,type-1,-1); // Elemental Spirit
+ if( bl ) status_change_end(bl,type,INVALID_TIMER); // Master
+ status_change_end(&ed->bl,type-1,INVALID_TIMER); // Elemental Spirit
break;
case SC_ZEPHYR:
- if( bl ) status_change_end(bl,type,-1);
+ if( bl ) status_change_end(bl,type,INVALID_TIMER);
break;
+ default:
+ ShowWarning("Invalide SC=%d in elemental_clean_single_effect\n",type);
+ break;
}
}
if( skill_get_unit_id(skill_num,0) )
@@ -345,8 +349,8 @@
if( elemental_skillnotok(skillnum, ed) )
return 0;
-
- if( ed->ud.skilltimer != -1 )
+
+ if( ed->ud.skilltimer != INVALID_TIMER )
return 0;
else if( DIFF_TICK(tick, ed->ud.canact_tick) < 0 )
return 0;
@@ -409,8 +413,8 @@
if( elemental_skillnotok(skillnum, ed) )
return 0;
-
- if( ed->ud.skilltimer != -1 )
+
+ if( ed->ud.skilltimer != INVALID_TIMER )
return 0;
else if( DIFF_TICK(gettick(), ed->ud.canact_tick) < 0 )
return 0;
@@ -562,11 +566,11 @@
return 0;
ed->last_thinktime = tick;
-
- if( ed->ud.skilltimer != -1 )
+
+ if( ed->ud.skilltimer != INVALID_TIMER )
return 0;
-
- if( ed->ud.walktimer != -1 && ed->ud.walkpath.path_pos <= 2 )
+
+ if( ed->ud.walktimer != INVALID_TIMER && ed->ud.walkpath.path_pos <= 2 )
return 0; //No thinking when you just started to walk.
if(ed->ud.walkpath.path_pos < ed->ud.walkpath.path_len && ed->ud.target == sd->bl.id)
@@ -582,13 +586,13 @@
master_dist = distance_bl(&sd->bl, &ed->bl);
if( master_dist > AREA_SIZE ) { // Master out of vision range.
elemental_unlocktarget(ed);
- unit_warp(&ed->bl,sd->bl.m,sd->bl.x,sd->bl.y,3);
+ unit_warp(&ed->bl,sd->bl.m,sd->bl.x,sd->bl.y,CLR_TELEPORT);
return 0;
} else if( master_dist > MAX_ELEDISTANCE ) { // Master too far, chase.
short x = sd->bl.x, y = sd->bl.y;
if( ed->target_id )
elemental_unlocktarget(ed);
- if( ed->ud.walktimer != -1 && ed->ud.target == sd->bl.id )
+ if( ed->ud.walktimer != INVALID_TIMER && ed->ud.target == sd->bl.id )
return 0; //Already walking to him
if( DIFF_TICK(tick, ed->ud.canmove_tick) < 0 )
return 0; //Can't move yet.
@@ -608,14 +612,15 @@
return 1;
}
- if( battle_check_range(&ed->bl,target,ed->db->range2) && rand()%100 < 2 ) { // 2% chance to cast attack skill.
+ if( battle_check_range(&ed->bl,target,view_range) && rnd()%100 < 2 ) // 2% chance to cast attack skill.
+ {
if( elemental_action(ed,target,tick) )
return 1;
}
//Attempt to attack.
//At this point we know the target is attackable, we just gotta check if the range matches.
- if( ed->ud.target == target->id && ed->ud.attacktimer != -1 ) //Already locked.
+ if( ed->ud.target == target->id && ed->ud.attacktimer != INVALID_TIMER ) //Already locked.
return 1;
if( battle_check_range(&ed->bl, target, ed->base_status.rhw.range) ) {//Target within range, engage
@@ -639,7 +644,7 @@
return 0;
}
-static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr data) {
+static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr_t data) {
map_foreachpc(elemental_ai_sub_foreachclient,tick);
return 0;
Index: src/map/battle.c
===================================================================
--- src/map/battle.c (revision 15963)
+++ src/map/battle.c (working copy)
@@ -183,7 +183,7 @@
return bl_list[rnd()%c];
}
-// _??[WÌx
+// ᅵ_??[ᅵWᅵÌxᅵᅵ
struct delay_damage {
struct block_list *src;
int target;
@@ -266,6 +266,7 @@
return 0;
}
+
int battle_attr_ratio(int atk_elem,int def_type, int def_lv)
{
@@ -340,7 +341,8 @@
}
/*==========================================
- * _??[W??IvZ
+ * Main battle_calc function
+ * primary call
*------------------------------------------*/
int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv)
{
@@ -394,7 +396,7 @@
(skill_num && skill_get_ele(skill_num, skill_lv) == ELE_GHOST) ||
(!skill_num && (status_get_status_data(src))->rhw.ele == ELE_GHOST)
)
- status_change_end(bl,SC_WHITEIMPRISON,-1); // Those skills do damage and removes effect
+ status_change_end(bl,SC_WHITEIMPRISON, INVALID_TIMER); // Those skills do damage and removes effect
else
{
d->dmg_lv = ATK_BLOCK;
@@ -468,7 +470,7 @@
clif_millenniumshield(sd,sce->val2);
sce->val3 = 1000; // Next Shield
} else
- status_change_end(bl,SC_MILLENNIUMSHIELD,-1); // All shields down
+ status_change_end(bl,SC_MILLENNIUMSHIELD, INVALID_TIMER); // All shields down
}
return 0;
}
@@ -556,11 +558,11 @@
if( sc->data[SC_DEEPSLEEP] ) {
damage += damage / 2; // 1.5 times more damage while in Deep Sleep.
- status_change_end(bl,SC_DEEPSLEEP,-1);
+ status_change_end(bl,SC_DEEPSLEEP, INVALID_TIMER);
}
if( sc->data[SC_VOICEOFSIREN] )
- status_change_end(bl,SC_VOICEOFSIREN,-1);
+ status_change_end(bl,SC_VOICEOFSIREN, INVALID_TIMER);
}
@@ -632,9 +634,9 @@
//Finally added to remove the status of immobile when aimedbolt is used. [Jobbie]
if( skill_num == RA_AIMEDBOLT && (sc->data[SC_BITE] || sc->data[SC_ANKLE] || sc->data[SC_ELECTRICSHOCKER]) )
{
- status_change_end(bl, SC_BITE, -1);
- status_change_end(bl, SC_ANKLE, -1);
- status_change_end(bl, SC_ELECTRICSHOCKER, -1);
+ status_change_end(bl, SC_BITE, INVALID_TIMER);
+ status_change_end(bl, SC_ANKLE, INVALID_TIMER);
+ status_change_end(bl, SC_ELECTRICSHOCKER, INVALID_TIMER);
}
//Finally Kyrie because it may, or not, reduce damage to 0.
@@ -652,7 +654,7 @@
if (!damage) return 0;
- if( (sce = sc->data[SC_LIGHTNINGWALK]) && flag&BF_LONG && rand()%100 < sce->val1 ) {
+ if( (sce = sc->data[SC_LIGHTNINGWALK]) && flag&BF_LONG && rnd()%100 < sce->val1 ) {
int dx[8]={0,-1,-1,-1,0,1,1,1};
int dy[8]={1,1,0,-1,-1,-1,0,1};
int dir = map_calc_dir(bl, src->x, src->y);
@@ -661,7 +663,7 @@
unit_setdir(bl, dir);
}
d->dmg_lv = ATK_DEF;
- status_change_end(bl, SC_LIGHTNINGWALK, -1);
+ status_change_end(bl, SC_LIGHTNINGWALK, INVALID_TIMER);
return 0;
}
@@ -674,20 +676,20 @@
if( sd && (sce = sc->data[SC_FORCEOFVANGUARD]) && flag&BF_WEAPON && rnd()%100 < sce->val2 )
pc_addspiritball(sd,skill_get_time(LG_FORCEOFVANGUARD,sce->val1),sce->val3);
- if( sc->data[SC__DEADLYINFECT] && damage > 0 && rand()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
+ if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
status_change_spread(bl, src); // Deadly infect attacked side
if( sc && sc->data[SC__SHADOWFORM] ) {
struct block_list *s_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2);
if( !s_bl ) { // If the shadow form target is not present remove the sc.
- status_change_end(bl, SC__SHADOWFORM, -1);
+ status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
} else if( status_isdead(s_bl) || !battle_check_target(src,s_bl,BCT_ENEMY)) { // If the shadow form target is dead or not your enemy remove the sc in both.
- status_change_end(bl, SC__SHADOWFORM, -1);
+ status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
if( s_bl->type == BL_PC )
((TBL_PC*)s_bl)->shadowform_id = 0;
} else {
if( (--sc->data[SC__SHADOWFORM]->val3) < 0 ) { // If you have exceded max hits supported, remove the sc in both.
- status_change_end(bl, SC__SHADOWFORM, -1);
+ status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
if( s_bl->type == BL_PC )
((TBL_PC*)s_bl)->shadowform_id = 0;
} else {
@@ -730,7 +732,7 @@
}
if( sc->data[SC_POISONINGWEAPON] && skill_num != GC_VENOMPRESSURE && (flag&BF_WEAPON) && damage > 0 && rnd()%100 < sc->data[SC_POISONINGWEAPON]->val3 )
sc_start(bl,sc->data[SC_POISONINGWEAPON]->val2,100,sc->data[SC_POISONINGWEAPON]->val1,skill_get_time2(GC_POISONINGWEAPON,sc->data[SC_POISONINGWEAPON]->val1));
- if( sc->data[SC__DEADLYINFECT] && damage > 0 && rand()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
+ if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
status_change_spread(src, bl);
}
@@ -768,7 +770,7 @@
mobskill_event((TBL_MOB*)bl,src,gettick(),MSC_SKILLUSED|(skill_num<<16));
}
if( sd ) {
- if( (sd->sc.option&OPTION_MADOGEAR) && rand()%100 < 50 ) {
+ if( (sd->sc.option&OPTION_MADOGEAR) && rnd()%100 < 50 ) {
short element = skill_get_ele(skill_num, skill_lv);
if( !skill_num || element == -1 ) { //Take weapon's element
struct status_data *sstatus = NULL;
@@ -900,7 +902,7 @@
}
/*==========================================
- * HP/SPzûÌvZ
+ * HP/SP drain calculation
*------------------------------------------*/
static int battle_calc_drain(int damage, int rate, int per)
{
@@ -919,7 +921,7 @@
}
/*==========================================
- * ?Cû_??[W
+ * Passif skill dammages increases
*------------------------------------------*/
int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type)
{
@@ -1589,11 +1591,11 @@
i*=i;
ATK_ADD(i); //Add str bonus.
switch (tstatus->size) { //Size-fix. Is this modified by weapon perfection?
- case 0: //Small: 125%
+ case SZ_SMALL: //Small: 125%
ATK_RATE(125);
break;
//case 1: //Medium: 100%
- case 2: //Large: 75%
+ case SZ_BIG: //Large: 75%
ATK_RATE(75);
break;
}
@@ -1610,8 +1612,8 @@
sd->inventory_data[index] &&
sd->inventory_data[index]->type == IT_ARMOR)
ATK_ADD(sd->inventory_data[index]->weight/10);
- break;
- } else
+ }
+ else
ATK_ADD(sstatus->rhw.atk2); //Else use Atk2
break;
case HFLI_SBR44: //[orn]
@@ -2123,9 +2125,9 @@
break;
case NC_ARMSCANNON:
switch( tstatus->size ) {
- case 0: skillratio += 100 + 500 * skill_lv; break;// Small
- case 1: skillratio += 100 + 400 * skill_lv; break;// Medium
- case 2: skillratio += 100 + 300 * skill_lv; break;// Large
+ case SZ_SMALL: skillratio += 100 + 500 * skill_lv; break;// Small
+ case SZ_MEDIUM: skillratio += 100 + 400 * skill_lv; break;// Medium
+ case SZ_BIG: skillratio += 100 + 300 * skill_lv; break;// Large
}
if( status_get_lv(src) > 100 ) skillratio += skillratio * (status_get_lv(src) - 100) / 200; // Base level bonus.
//NOTE: Their's some other factors that affects damage, but not sure how exactly. Will recheck one day. [Rytech]
@@ -3299,10 +3301,10 @@
skillratio += 10*skill_lv-30;
break;
case SL_STIN:
- skillratio += (tstatus->size?-99:10*skill_lv); //target size must be small (0) for full damage.
+ skillratio += (tstatus->size!=SZ_SMALL?-99:10*skill_lv); //target size must be small (0) for full damage.
break;
case SL_STUN:
- skillratio += (tstatus->size!=2?5*skill_lv:-99); //Full damage is dealt on small/medium targets
+ skillratio += (tstatus->size!=SZ_BIG?5*skill_lv:-99); //Full damage is dealt on small/medium targets
break;
case SL_SMA:
skillratio += -60 + status_get_lv(src); //Base damage is 40% + lv%
@@ -3708,7 +3710,7 @@
}
/*==========================================
- * »ÌŒ_??[WvZ
+ * Calcule les degat d'une attaque Misc selon le skill
*------------------------------------------*/
struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag)
{
@@ -3765,7 +3767,7 @@
{
int level = sd?sd->status.base_level:status_get_lv(src);
md.damage = skill_lv*sstatus->dex*(3+level/100)*(1+sstatus->int_/35);
- md.damage+= md.damage*(rand()%20-10)/100;
+ md.damage+= md.damage*(rnd()%20-10)/100;
md.damage+= 40*(sd?pc_checkskill(sd,RA_RESEARCHTRAP):0);
}
break;
@@ -4022,7 +4024,7 @@
return md;
}
/*==========================================
- * _??[WvZê??p
+ * ᅵ_??[ᅵWᅵvᅵZᅵê?ᅵᅵ?ᅵp
*------------------------------------------*/
struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int count)
{
@@ -4079,12 +4081,12 @@
rd1 = min(damage,status_get_max_hp(bl)) * sc->data[SC_DEATHBOUND]->val2 / 100; // Amplify damage.
*dmg = rd1 * 30 / 100; // Received damge = 30% of amplifly damage.
clif_skill_damage(src,bl,gettick(), status_get_amotion(src), 0, -30000, 1, RK_DEATHBOUND, sc->data[SC_DEATHBOUND]->val1,6);
- status_change_end(bl,SC_DEATHBOUND,-1);
+ status_change_end(bl,SC_DEATHBOUND, INVALID_TIMER);
rdamage += rd1;
if (rdamage < 1) rdamage = 1;
}
}
- if( sc && sc->data[SC_CRESCENTELBOW] && !(flag&BF_SKILL) && !is_boss(src) && rand()%100 < sc->data[SC_CRESCENTELBOW]->val2 )
+ if( sc && sc->data[SC_CRESCENTELBOW] && !(flag&BF_SKILL) && !is_boss(src) && rnd()%100 < sc->data[SC_CRESCENTELBOW]->val2 )
{ // Stimated formula from test
rdamage += (int)((*dmg) + (*dmg) * status_get_hp(src) * 2.15 / 100000);
if( rdamage < 1 ) rdamage = 1;
@@ -4180,7 +4182,7 @@
return 0;
}
/*==========================================
- * Ê??U??ÜÆß
+ * ᅵᅵ??Uᅵᅵ?ᅵᅵ?ï¿œÜÆï¿œ
*------------------------------------------*/
enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* target, unsigned int tick, int flag) {
struct map_session_data *sd = NULL, *tsd = NULL;
@@ -4247,13 +4249,13 @@
}
}
}
+ if(sc && sc->count){
+ if (sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2))
+ status_change_end(src, SC_CLOAKING, INVALID_TIMER);
- if (sc && sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2))
- status_change_end(src, SC_CLOAKING, INVALID_TIMER);
-
- if (sc && sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&2))
- status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER);
-
+ if (sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&2))
+ status_change_end(src,SC_CLOAKINGEXCEED,INVALID_TIMER);
+ }
if( tsc && tsc->data[SC_AUTOCOUNTER] && status_check_skilluse(target, src, KN_AUTOCOUNTER, 1) )
{
int dir = map_calc_dir(target,src->x,src->y);
@@ -4322,7 +4324,7 @@
return ATK_MISS;
}
if( sc->data[SC_GT_ENERGYGAIN] ) {
- if( sd && rand()%100 < 10 + 5 * sc->data[SC_GT_ENERGYGAIN]->val1)
+ if( sd && rnd()%100 < 10 + 5 * sc->data[SC_GT_ENERGYGAIN]->val1)
pc_addspiritball(sd,
skill_get_time(MO_CALLSPIRITS, sc->data[SC_GT_ENERGYGAIN]->val1),
sc->data[SC_GT_ENERGYGAIN]->val1);
@@ -4344,9 +4346,9 @@
if( --(sc->data[SC_SPELLFIST]->val1) >= 0 )
wd = battle_calc_attack(BF_MAGIC,src,target,sc->data[SC_SPELLFIST]->val3,sc->data[SC_SPELLFIST]->val4,flag);
else
- status_change_end(src,SC_SPELLFIST,-1);
+ status_change_end(src,SC_SPELLFIST,INVALID_TIMER);
}
- if( sc->data[SC_GIANTGROWTH] && (wd.flag&BF_SHORT) && rand()%100 < sc->data[SC_GIANTGROWTH]->val2 )
+ if( sc->data[SC_GIANTGROWTH] && (wd.flag&BF_SHORT) && rnd()%100 < sc->data[SC_GIANTGROWTH]->val2 )
wd.damage *= 3; // Triple Damage
}
if (sd && sd->state.arrow_atk) //Consume arrow.
@@ -4452,7 +4454,7 @@
}
}
if (sd) {
- if( wd.flag&BF_SHORT && sc && sc->data[SC__AUTOSHADOWSPELL] && rand()%100 < sc->data[SC__AUTOSHADOWSPELL]->val3 &&
+ if( wd.flag&BF_SHORT && sc && sc->data[SC__AUTOSHADOWSPELL] && rnd()%100 < sc->data[SC__AUTOSHADOWSPELL]->val3 &&
sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id != 0 && sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].flag == SKILL_FLAG_PLAGIARIZED )
{
int r_skill = sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id,
@@ -4509,6 +4511,10 @@
status_change_end(target, SC_POISONREACT, INVALID_TIMER);
}
}
+ if (sc && sc->data[SC_CAMOUFLAGE] && !(sc->data[SC_CAMOUFLAGE]->val3&2)){ //moved so basic attack get critical bonus
+ status_change_end(src,SC_CAMOUFLAGE,INVALID_TIMER);
+ }
+
map_freeblock_unlock();
return wd.dmg_lv;
}
@@ -4685,6 +4691,7 @@
return 0; // Disable guardians/emperiums owned by Guilds on non-woe times.
break;
}
+ default: break; //other type doesn't have slave yet
}
switch( src->type )
@@ -4701,9 +4708,9 @@
int inf2 = 0;
if (!su->group)
return 0;
+ inf2 = skill_get_inf2(su->group->skill_id);
if( battle_config.vs_traps_bctall && (target->type&battle_config.vs_traps_bctall) &&
- (inf2 = skill_get_inf2(su->group->skill_id))&INF2_TRAP &&
- map_flag_vs(src->m) )
+ inf2&INF2_TRAP && map_flag_vs(src->m) )
return 1;//traps may target everyone
if (su->group->src_id == target->id) {
if (inf2&INF2_NO_TARGET_SELF)
@@ -4853,7 +4860,7 @@
return (flag&state)?1:-1;
}
/*==========================================
- * Ëö»è
+ * ᅵËᅵᅵᅵᅵᅵ
*------------------------------------------*/
bool battle_check_range(struct block_list *src, struct block_list *bl, int range)
{
Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 15963)
+++ src/map/skill.c (working copy)
@@ -955,7 +955,7 @@
status_zap(bl, 0, rate);
break;
case SL_STUN:
- if (tstatus->size==1) //Only stuns mid-sized mobs.
+ if (tstatus->size==SZ_MEDIUM) //Only stuns mid-sized mobs.
sc_start(bl,SC_STUN,(30+10*skilllv),skilllv,skill_get_time(skillid,skilllv));
break;
@@ -1186,11 +1186,11 @@
case NC_PILEBUNKER:
if( rnd()%100 < 5 + 15*skilllv )
{ //Deactivatable Statuses: Kyrie Eleison, Auto Guard, Steel Body, Assumptio, and Millennium Shield
- status_change_end(bl, SC_KYRIE, -1);
- status_change_end(bl, SC_AUTOGUARD, -1);
- status_change_end(bl, SC_STEELBODY, -1);
- status_change_end(bl, SC_ASSUMPTIO, -1);
- status_change_end(bl, SC_MILLENNIUMSHIELD, -1);
+ status_change_end(bl, SC_KYRIE, INVALID_TIMER);
+ status_change_end(bl, SC_AUTOGUARD, INVALID_TIMER);
+ status_change_end(bl, SC_STEELBODY, INVALID_TIMER);
+ status_change_end(bl, SC_ASSUMPTIO, INVALID_TIMER);
+ status_change_end(bl, SC_MILLENNIUMSHIELD, INVALID_TIMER);
}
break;
case NC_FLAMELAUNCHER:
@@ -1260,7 +1260,7 @@
if( dstsd )
skill_addtimerskill(src,tick+status_get_amotion(src),bl->id,0,0,skillid,skilllv,BF_WEAPON,0);
else if( dstmd && !is_boss(bl) )
- sc_start(bl, SC_STUN, 100, skilllv, 1000 + 1000 * (rand()%3));
+ sc_start(bl, SC_STUN, 100, skilllv, 1000 + 1000 * (rnd()%3));
break;
case SR_GENTLETOUCH_QUIET:
sc_start(bl, SC_SILENCE, 2 * skilllv, skilllv, skill_get_time(skillid, skilllv));
@@ -1269,7 +1269,7 @@
sc_start(bl, SC_FEAR, 5 + 5 * skilllv, skilllv, skill_get_time(skillid, skilllv));
break;
case WM_SOUND_OF_DESTRUCTION:
- if( rand()%100 < 5 + 5 * skilllv ) { // Temporarly Check Until We Get the Official Formula
+ if( rnd()%100 < 5 + 5 * skilllv ) { // Temporarly Check Until We Get the Official Formula
status_change_end(bl, SC_DANCING, INVALID_TIMER);
status_change_end(bl, SC_RICHMANKIM, INVALID_TIMER);
status_change_end(bl, SC_ETERNALCHAOS, INVALID_TIMER);
@@ -1323,7 +1323,7 @@
sc_start(bl, SC_MELON_BOMB, 100, skilllv, skill_get_time(GN_SLINGITEM, skilllv)); // Reduces ASPD and moviment speed
break;
case 13264:
- sc_start(bl, SC_BANANA_BOMB, 100, skilllv, skill_get_time(GN_SLINGITEM, skilllv)); // Reduces LUK À?Needed confirm it, may be it's bugged in kRORE?
+ sc_start(bl, SC_BANANA_BOMB, 100, skilllv, skill_get_time(GN_SLINGITEM, skilllv)); // Reduces LUK ᅵ?Needed confirm it, may be it's bugged in kRORE?
sc_start(bl, SC_BANANA_BOMB_SITDOWN, 75, skilllv, skill_get_time(GN_SLINGITEM_RANGEMELEEATK,skilllv)); // Sitdown for 3 seconds.
break;
}
@@ -2635,7 +2635,7 @@
struct status_change *ssc = status_get_sc(src);
if( ssc && ssc->data[SC_POISONINGWEAPON] && rnd()%100 < 70 + 5*skilllv ) {
sc_start(bl,ssc->data[SC_POISONINGWEAPON]->val2,100,ssc->data[SC_POISONINGWEAPON]->val1,skill_get_time2(GC_POISONINGWEAPON,ssc->data[SC_POISONINGWEAPON]->val1));
- status_change_end(src,SC_POISONINGWEAPON,-1);
+ status_change_end(src,SC_POISONINGWEAPON,INVALID_TIMER);
clif_skill_nodamage(src,bl,skillid,skilllv,1);
}
}
@@ -2666,12 +2666,12 @@
}
/*==========================================
- * XLÍ??U?p(map_foreachinarea©çÄÎêé)
- * flagÉ¢Ä?F16?i?ðmF
+ * ᅵXᅵLᅵᅵᅵᅵ??U?ᅵp(map_foreachinareaᅵᅵᅵᅵÄÎᅵᅵ)
+ * flagᅵÉÂᅵᅵᅵ?F16?i?ᅵᅵᅵmᅵF
* MSB <- 00fTffff ->LSB
- * T =^?QbgI?p(BCT_*)
- * ffff=©RÉgpÂ\
- * 0 =\ñ?B0ÉÅè
+ * T =ᅵ^?ᅵQᅵbᅵgᅵI?ᅵp(BCT_*)
+ * ffff=ᅵᅵᅵRᅵÉgᅵpᅵÂ\
+ * 0 =ᅵ\ᅵᅵ?B0ᅵÉÅᅵ
*------------------------------------------*/
typedef int (*SkillFunc)(struct block_list *, struct block_list *, int, int, unsigned int, int);
int skill_area_sub (struct block_list *bl, va_list ap)
@@ -3096,10 +3096,10 @@
if( j )
{
i = applyeffects[rnd()%j];
- status_change_start(target, i, 10000, skl->skill_lv,
+ sc_start4(target, i, 100, skl->skill_lv,
(i == SC_BURNING ? 1000 : 0),
(i == SC_BURNING ? src->id : 0),
- 0, skill_get_time(WL_TETRAVORTEX,skl->skill_lv), 0);
+ 0, skill_get_time(WL_TETRAVORTEX,skl->skill_lv) );
}
}
}
@@ -3119,9 +3119,11 @@
break;
case LG_MOONSLASHER:
case SR_WINDMILL:
- if( target->type == BL_PC ) {
- struct map_session_data *tsd = NULL;
- if( (tsd = ((TBL_PC*)target)) && !pc_issit(tsd) ) {
+ if( target->type == BL_PC )
+ {
+ TBL_PC *tsd = BL_CAST(BL_PC,target);
+ if( tsd && !pc_issit(tsd) )
+ {
pc_setsit(tsd);
skill_sit(tsd,1);
clif_sitting(&tsd->bl);
@@ -4001,7 +4003,7 @@
else
{
skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
- status_change_end(src,SC_ROLLINGCUTTER,-1);
+ status_change_end(src,SC_ROLLINGCUTTER,INVALID_TIMER);
}
break;
@@ -4147,7 +4149,7 @@
if( j == 0 )
{ // No Spheres
- clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
+ clif_skill_fail(sd,skillid,USESKILL_FAIL_SUMMON_NONE,0);
break;
}
@@ -4231,9 +4233,10 @@
{ //TODO: Need a confirmation if the other type of hidden status is included to be scanned. [Jobbie]
if( rnd()%100 < 50 )
sc_start(bl, SC_INFRAREDSCAN, 10000, skilllv, skill_get_time(skillid, skilllv));
- status_change_end(bl, SC_HIDING, -1);
- status_change_end(bl, SC_CLOAKING, -1);
- status_change_end(bl, SC_CLOAKINGEXCEED, -1); // Need confirm it.
+ status_change_end(bl, SC_HIDING, INVALID_TIMER);
+ status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
+ status_change_end(bl, SC_CHASEWALK, INVALID_TIMER);
+ status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER); // Need confirm it.
}
else
{
@@ -4296,30 +4299,36 @@
break;
case SR_HOWLINGOFLION:
- status_change_end(bl, SC_SWINGDANCE, -1);
- status_change_end(bl, SC_SYMPHONYOFLOVER, -1);
- status_change_end(bl, SC_MOONLITSERENADE, -1);
- status_change_end(bl, SC_RUSHWINDMILL, -1);
- status_change_end(bl, SC_ECHOSONG, -1);
- status_change_end(bl, SC_HARMONIZE, -1);
- status_change_end(bl, SC_SIRCLEOFNATURE, -1);
- status_change_end(bl, SC_SATURDAYNIGHTFEVER, -1);
- status_change_end(bl, SC_DANCEWITHWUG, -1);
- status_change_end(bl, SC_LERADSDEW, -1);
- status_change_end(bl, SC_MELODYOFSINK, -1);
- status_change_end(bl, SC_BEYONDOFWARCRY, -1);
- status_change_end(bl, SC_UNLIMITEDHUMMINGVOICE, -1);
+ {
+ struct status_change *tsc = status_get_sc(bl);
+ if(tsc && tsc->count){
+ int i=0;
+ const enum sc_type scs[] = {
+ SC_SWINGDANCE, SC_SYMPHONYOFLOVER,
+ SC_MOONLITSERENADE, SC_RUSHWINDMILL, SC_ECHOSONG, SC_HARMONIZE,
+ SC_DEEPSLEEP, SC_VOICEOFSIREN, SC_SATURDAYNIGHTFEVER, SC_GLOOMYDAY, //Group B
+ SC_UNLIMITEDHUMMINGVOICE, SC_SONGOFMANA, SC_DANCEWITHWUG,
+ SC_BEYONDOFWARCRY, SC_MELODYOFSINK, SC_LERADSDEW, SC_SIRCLEOFNATURE //Group B Wanderer
+ };
+
+ for (i = 0; i < ARRAYLENGTH(scs); i++){
+ if(i==SC_SATURDAYNIGHTFEVER) tsc->data[i]->val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
+ if (tsc->data[scs[i]])
+ status_change_end(bl, scs[i], INVALID_TIMER);
+ }
+ }
skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, flag);
+ }
break;
case SR_EARTHSHAKER:
if( flag&1 ) {
struct status_change *tsc = status_get_sc(bl);
if( tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CHASEWALK] || tsc->data[SC_CLOAKING] || tsc->data[SC_CLOAKINGEXCEED]) ) {
- status_change_end(bl, SC_HIDING, -1);
- status_change_end(bl, SC_CLOAKING, -1);
- status_change_end(bl, SC_CHASEWALK, -1);
- status_change_end(bl, SC_CLOAKINGEXCEED, -1);
+ status_change_end(bl, SC_HIDING, INVALID_TIMER);
+ status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
+ status_change_end(bl, SC_CHASEWALK, INVALID_TIMER);
+ status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
sc_start(bl,SC_STUN, 25 + 5 * skilllv,skilllv,skill_get_time(skillid,skilllv));//Does it apply the stun chance to targets knocked out of hiding, or it applys allways? [Rytech]
skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, flag);
} else
@@ -4330,7 +4339,7 @@
break;
case WM_LULLABY_DEEPSLEEP:
- if( rand()%100 < 88 + 2 * skilllv )
+ if( rnd()%100 < 88 + 2 * skilllv )
sc_start(bl,status_skill2sc(skillid),100,skilllv,skill_get_time(skillid,skilllv));
break;
@@ -4338,10 +4347,10 @@
struct status_change *tsc = status_get_sc(bl);
if( tsc && tsc->data[SC_POISON] ) {
skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, flag);
- status_change_end(bl, SC_POISON, -1);
+ status_change_end(bl, SC_POISON, INVALID_TIMER);
}
else if( sd )
- clif_skill_fail(sd, skillid, 0, 0);
+ clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0);
}
break;
@@ -4355,7 +4364,7 @@
break;
case GN_CRAZYWEED:
- if( rand()%100 < 75 ) {
+ if( rnd()%100 < 75 ) {
if( bl->type == BL_SKILL ) {
struct skill_unit *su = (struct skill_unit *)bl;
if( !su )
@@ -4399,7 +4408,7 @@
int i = skill_get_splash(skillid,skilllv);
clif_skill_nodamage(src,battle_get_master(src),skillid,skilllv,1);
clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6);
- if( rand()%100 < 30 )
+ if( rnd()%100 < 30 )
map_foreachinrange(skill_area_sub,bl,i,BL_CHAR,src,skillid,skilllv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id);
else
skill_attack(skill_get_type(skillid),src,src,bl,skillid,skilllv,tick,flag);
@@ -4409,7 +4418,7 @@
case EL_ROCK_CRUSHER:
clif_skill_nodamage(src,battle_get_master(src),skillid,skilllv,1);
clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6);
- if( rand()%100 < 50 )
+ if( rnd()%100 < 50 )
skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
else
skill_attack(BF_WEAPON,src,src,bl,EL_ROCK_CRUSHER_ATK,skilllv,tick,flag);
@@ -4422,7 +4431,7 @@
int i = skill_get_splash(skillid,skilllv);
clif_skill_nodamage(src,battle_get_master(src),skillid,skilllv,1);
clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6);
- if( rand()%100 < 30 )
+ if( rnd()%100 < 30 )
map_foreachinrange(skill_area_sub,bl,i,BL_CHAR,src,skillid,skilllv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id);
else
skill_attack(skill_get_type(skillid),src,src,bl,skillid,skilllv,tick,flag);
@@ -4451,7 +4460,7 @@
if( (sc && sc->data[type2]) || (tsc && tsc->data[type]) ) {
elemental_clean_single_effect(ele, skillid);
}
- if( rand()%100 < 50 )
+ if( rnd()%100 < 50 )
skill_attack(skill_get_type(skillid),src,src,bl,skillid,skilllv,tick,flag);
else {
sc_start(src,type2,100,skilllv,skill_get_time(skillid,skilllv));
@@ -5435,8 +5444,8 @@
case NC_EMERGENCYCOOL:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- status_change_end(src,SC_OVERHEAT_LIMITPOINT,-1);
- status_change_end(src,SC_OVERHEAT,-1);
+ status_change_end(src,SC_OVERHEAT_LIMITPOINT,INVALID_TIMER);
+ status_change_end(src,SC_OVERHEAT,INVALID_TIMER);
break;
case SR_WINDMILL:
case GN_CART_TORNADO:
@@ -7446,9 +7455,9 @@
if( (tsc && (tsc->data[SC_FREEZE] || tsc->data[SC_STONE] ||
tsc->data[SC_BLIND]))&& (rnd()%100 < 30+5*skilllv) )
{
- status_change_end(bl, SC_FREEZE, -1);
- status_change_end(bl, SC_STONE, -1);
- status_change_end(bl, SC_BLIND, -1);
+ status_change_end(bl, SC_FREEZE, INVALID_TIMER);
+ status_change_end(bl, SC_STONE, INVALID_TIMER);
+ status_change_end(bl, SC_BLIND, INVALID_TIMER);
}
// Success rate only applies to the curing effect and not stat bonus.
clif_skill_nodamage(bl, bl, skillid, skilllv,
@@ -7465,9 +7474,9 @@
if( (tsc && (tsc->data[SC_SLEEP] || tsc->data[SC_STUN] ||
tsc->data[SC_SILENCE]))&& (rnd()%100 < 30+5*skilllv) )
{
- status_change_end(bl, SC_SLEEP, -1);
- status_change_end(bl, SC_STUN, -1);
- status_change_end(bl, SC_SILENCE, -1);
+ status_change_end(bl, SC_SLEEP, INVALID_TIMER);
+ status_change_end(bl, SC_STUN, INVALID_TIMER);
+ status_change_end(bl, SC_SILENCE, INVALID_TIMER);
}
clif_skill_nodamage(bl, bl, skillid, skilllv,
sc_start(bl, type, 100, skilllv, skill_get_time(skillid, skilllv)));
@@ -7540,7 +7549,7 @@
break;
}
if(i==SC_BERSERK /*|| i==SC_SATURDAYNIGHTFEVER*/) tsc->data[i]->val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
- status_change_end(bl,(sc_type)i,-1);
+ status_change_end(bl,(sc_type)i,INVALID_TIMER);
}
break;
}
@@ -7606,7 +7615,7 @@
break; // Already work on this target
if( tsc && tsc->data[SC_STONE] )
- status_change_end(bl,SC_STONE,-1);
+ status_change_end(bl,SC_STONE,INVALID_TIMER);
else
status_change_start(bl,SC_STONE,10000,skilllv,0,0,1000,(8+2*skilllv)*1000,2);
}
@@ -7622,7 +7631,7 @@
else
{
rate = 1;
- status_change_end(bl,SC_STONE,-1);
+ status_change_end(bl,SC_STONE,INVALID_TIMER);
}
if( rate )
@@ -7732,7 +7741,7 @@
case RA_WUGDASH:
if( tsce ) {
- clif_skill_nodamage(src,bl,skillid,skilllv,status_change_end(bl, type, -1));
+ clif_skill_nodamage(src,bl,skillid,skilllv,status_change_end(bl, type, INVALID_TIMER));
map_freeblock_unlock();
return 0;
}
@@ -7822,7 +7831,7 @@
clif_skill_nodamage(src,bl,skillid,1,1);
}
else
- clif_skill_fail(sd,skillid,0x15,0);
+ clif_skill_fail(sd,skillid,USESKILL_FAIL_GC_WEAPONBLOCKING,0);
}
break;
@@ -7840,11 +7849,11 @@
if( tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] ||
tsc->data[SC_CHASEWALK] || tsc->data[SC_CLOAKINGEXCEED] ||
tsc->data[SC__INVISIBILITY]) ) {
- status_change_end(bl, SC_HIDING, -1);
- status_change_end(bl, SC_CLOAKING, -1);
- status_change_end(bl, SC_CHASEWALK, -1);
- status_change_end(bl, SC_CLOAKINGEXCEED, -1);
- status_change_end(bl, SC__INVISIBILITY, -1);
+ status_change_end(bl, SC_HIDING, INVALID_TIMER);
+ status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
+ status_change_end(bl, SC_CHASEWALK, INVALID_TIMER);
+ status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
+ status_change_end(bl, SC__INVISIBILITY, INVALID_TIMER);
sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv));
sc_start(bl,SC_BLIND,53 + 2 * skilllv,skilllv,skill_get_time(skillid,skilllv));
@@ -7894,7 +7903,7 @@
case LG_REFLECTDAMAGE:
if( tsc && tsc->data[type] )
- status_change_end(bl,type,-1);
+ status_change_end(bl,type,INVALID_TIMER);
else
sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv));
clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -7930,7 +7939,7 @@
clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6);
if( rate < brate )
map_foreachinrange(skill_area_sub,src,skill_get_splash(skillid,skilllv),BL_CHAR,src,skillid,skilllv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id);
- status_change_end(bl,SC_SHIELDSPELL_DEF,-1);
+ status_change_end(bl,SC_SHIELDSPELL_DEF, INVALID_TIMER);
break;
case 2:
val = 10 * shield_data->def; // % Reflected damage.
@@ -7958,7 +7967,7 @@
clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6);
if( rate < brate )
map_foreachinrange(skill_area_sub,src,skill_get_splash(skillid,skilllv),BL_CHAR,src,skillid,skilllv,tick,flag|BCT_ENEMY|2,skill_castend_damage_id);
- status_change_end(bl,SC_SHIELDSPELL_MDEF,-1);
+ status_change_end(bl,SC_SHIELDSPELL_MDEF,INVALID_TIMER);
break;
case 2:
sc_start(bl,SC_SHIELDSPELL_MDEF,100,opt,-1);
@@ -8149,7 +8158,7 @@
if( !status_isdead(bl) )
break;
- if( rand()%100 < 88 + 2 * skilllv ) {
+ if( rnd()%100 < 88 + 2 * skilllv ) {
int heal = tstatus->sp;
if( heal <= 0 )
heal = 1;
@@ -8196,7 +8205,7 @@
status_fix_damage(src,bl,9999,clif_damage(src,bl,tick,0,0,9999,0,0,0));
} else if( sd ) {
if( !sd->status.party_id ) {
- clif_skill_fail(sd,skillid,0x11,0);
+ clif_skill_fail(sd,skillid,USESKILL_FAIL_NEED_HELPER,0);
break;
}
if( map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid,skilllv),
@@ -8246,9 +8255,9 @@
case WM_RANDOMIZESPELL: {
int improv_skillid = 0, improv_skilllv;
do {
- i = rand() % MAX_SKILL_IMPROVISE_DB;
+ i = rnd() % MAX_SKILL_IMPROVISE_DB;
improv_skillid = skill_improvise_db[i].skillid;
- } while( improv_skillid == 0 || rand()%10000 >= skill_improvise_db[i].per );
+ } while( improv_skillid == 0 || rnd()%10000 >= skill_improvise_db[i].per );
improv_skilllv = 4 + skilllv;
clif_skill_nodamage (src, bl, skillid, skilllv, 1);
@@ -8777,7 +8786,7 @@
if (ud->state.running && ud->skillid == TK_JUMPKICK)
{
ud->state.running = 0;
- status_change_end(src, SC_RUN, -1);
+ status_change_end(src, SC_RUN, INVALID_TIMER);
flag = 1;
}
@@ -9505,7 +9514,7 @@
}
clif_skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skillid,skilllv,6);
skill_unitsetting(src, skillid, skilllv, x, y, flag);
- status_change_end(src,SC_POISONINGWEAPON,-1);
+ status_change_end(src,SC_POISONINGWEAPON,INVALID_TIMER);
break;
/**
* Arch Bishop
@@ -9609,7 +9618,7 @@
case LG_BANDING:
if( sc && sc->data[SC_BANDING] )
- status_change_end(src,SC_BANDING,-1);
+ status_change_end(src,SC_BANDING, INVALID_TIMER);
else if( (sg = skill_unitsetting(src,skillid,skilllv,src->x,src->y,0)) != NULL ) {
sc_start4(src,SC_BANDING,100,skilllv,0,0,sg->group_id,skill_get_time(skillid,skilllv));
if( sd ) pc_banding(sd,skilllv);
@@ -9678,11 +9687,11 @@
}
}
break;
-
+
case SO_FIREWALK:
case SO_ELECTRICWALK:
if( sc && sc->data[type] )
- status_change_end(src,type,-1);
+ status_change_end(src,type,INVALID_TIMER);
clif_skill_nodamage(src, src ,skillid, skilllv,
sc_start2(src, type, 100, skillid, skilllv, skill_get_time(skillid, skilllv)));
break;
@@ -11052,18 +11061,14 @@
}
hp = tstatus->max_hp * hp / 100;
sp = tstatus->max_sp * sp / 100;
- status_heal(bl, hp, sp, 0);
- if( tstatus->hp < tstatus->max_hp )
- clif_skill_nodamage(&src->bl, bl, AL_HEAL, hp, 1);
- if( tstatus->sp < tstatus->max_sp )
- clif_skill_nodamage(&src->bl, bl, MG_SRECOVERY, sp, 1);
+ status_heal(bl, hp, sp, 2);
sc_start(bl, type, 100, sg->skill_lv, (sg->interval * 3) + 100);
}
// Reveal hidden players every 5 seconds.
if( sg->val2 % 5 == 0 ) {
// TODO: check if other hidden status can be removed.
- status_change_end(bl,SC_HIDING,-1);
- status_change_end(bl,SC_CLOAKING,-1);
+ status_change_end(bl,SC_HIDING, INVALID_TIMER);
+ status_change_end(bl,SC_CLOAKING, INVALID_TIMER);
}
}
/* Enable this if kRO fix the current skill. Currently no damage on undead and demon monster. [Jobbie]
@@ -11105,7 +11110,7 @@
if( tsc ) {
if( !sg->val2 ) {
int sec = skill_get_time2(sg->skill_id, sg->skill_lv);
- if( status_change_start(bl, type, 10000, sg->skill_lv, 0, 0, 0, sec, 0) ) {
+ if( sc_start(bl, type, 100, sg->skill_lv, sec) ) {
const struct TimerData* td = tsc->data[type]?get_timer(tsc->data[type]->timer):NULL;
if( td )
sec = DIFF_TICK(td->tick, tick);
@@ -12172,7 +12177,7 @@
case SC_MANHOLE:
case SC_DIMENSIONDOOR:
if( sc && sc->data[SC_MAGNETICFIELD] ) {
- clif_skill_fail(sd,skill,0,0);
+ clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12180,7 +12185,7 @@
int count;
count = skill_check_pc_partner(sd, skill, &lv, skill_get_splash(skill,lv), 0);
if( count < 1 ) {
- clif_skill_fail(sd,skill,0x11,0);
+ clif_skill_fail(sd,skill,USESKILL_FAIL_NEED_HELPER,0);
return 0;
} else
require.sp -= require.sp * 20 * count / 100; // -20% each W/M in the party.
@@ -12190,19 +12195,19 @@
case SO_ELECTRICWALK: // Can't be casted until you've walked all cells.
if( sc && sc->data[SC_PROPERTYWALK] &&
sc->data[SC_PROPERTYWALK]->val3 < skill_get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) ) {
- clif_skill_fail(sd,skill,0x0,0);
+ clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case SO_EL_CONTROL:
if( !sd->status.ele_id || !sd->ed ) {
- clif_skill_fail(sd,skill,0x00,0);
+ clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case RETURN_TO_ELDICASTES:
if( sd->sc.option&OPTION_MADOGEAR ) { //Cannot be used if Mado is equipped.
- clif_skill_fail(sd,skill,0,0);
+ clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -13929,7 +13934,7 @@
if( !wall )
{
if( sce->val1 < 3 ) //End camouflage.
- status_change_end(bl, SC_CAMOUFLAGE, -1);
+ status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER);
else
if( sce->val3&1 )
{ //Remove wall bonus
@@ -14042,7 +14047,7 @@
case RA_ELECTRICSHOCKER: {
struct block_list* target = map_id2bl(group->val2);
if( target )
- status_change_end(target, SC_ELECTRICSHOCKER, -1);
+ status_change_end(target, SC_ELECTRICSHOCKER, INVALID_TIMER);
}
break;
case SC_MAELSTROM:
@@ -14237,7 +14242,7 @@
struct status_change *sc = NULL;
if( (sc = status_get_sc(src)) != NULL && sc->data[SC_NEUTRALBARRIER_MASTER] ) {
sc->data[SC_NEUTRALBARRIER_MASTER]->val2 = 0;
- status_change_end(src,SC_NEUTRALBARRIER_MASTER,-1);
+ status_change_end(src,SC_NEUTRALBARRIER_MASTER, INVALID_TIMER);
}
}
break;
@@ -14246,7 +14251,7 @@
struct status_change *sc = NULL;
if( (sc = status_get_sc(src)) != NULL && sc->data[SC_STEALTHFIELD_MASTER] ) {
sc->data[SC_STEALTHFIELD_MASTER]->val2 = 0;
- status_change_end(src,SC_STEALTHFIELD_MASTER,-1);
+ status_change_end(src,SC_STEALTHFIELD_MASTER, INVALID_TIMER);
}
}
break;
@@ -14255,7 +14260,7 @@
struct status_change *sc = NULL;
if( (sc = status_get_sc(src)) && sc->data[SC_BANDING] ) {
sc->data[SC_BANDING]->val4 = 0;
- status_change_end(src,SC_BANDING,-1);
+ status_change_end(src,SC_BANDING, INVALID_TIMER);
}
}
break;
@@ -15118,10 +15123,10 @@
qty = 3;
break; //3 items to make at once.
case 9:
- qty = 3 + rand()%3;
+ qty = 3 + rnd()%3;
break; //3~5 items to make at once.
case 10:
- qty = 4 + rand()%3;
+ qty = 4 + rnd()%3;
break; //4~6 items to make at once.
default:
qty = 2;
@@ -15237,8 +15242,8 @@
tmp_item.amount = 0;
if( skill_id == GN_MIX_COOKING && firstQty > 1 ) {// Mix Cooking level 2.
// Success. As I see the chance as level 2 is global, not indiviual.
- if( rand()%10000 < make_per )
- tmp_item.amount = 5 + rand()%5;
+ if( rnd()%10000 < make_per )
+ tmp_item.amount = 5 + rnd()%5;
} else {
for (i=0; i< qty; i++) { //Apply quantity modifiers.
if (rnd()%10000 < make_per || qty == 1) { //Success
@@ -15357,11 +15362,11 @@
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = nameid;
do {
- i = rand()%5;
+ i = rnd()%5;
tmp_item.nameid = products[i][0];
}
- while( rand()%10000 >= products[i][1] );
- tmp_item.amount = (firstQty > 1 )? 5 + rand()%5 : 1; // When it fails it gives a random amount of items.
+ while( rnd()%10000 >= products[i][1] );
+ tmp_item.amount = (firstQty > 1 )? 5 + rnd()%5 : 1; // When it fails it gives a random amount of items.
tmp_item.identify = 1;
if( pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE) ) {
clif_additem(sd,0,0,flag);
@@ -15521,7 +15526,7 @@
int i, j, points, skillid, preserved = 0, max_preserve;
nullpo_ret(sd);
- if( sd->sc.data[SC_STOP] ) status_change_end(&sd->bl,SC_STOP,-1);
+ if( sd->sc.data[SC_STOP] ) status_change_end(&sd->bl,SC_STOP,INVALID_TIMER);
if( nameid <= 0 ) return 0;
if( pc_search_inventory(sd,nameid) < 0 )
@@ -15571,13 +15576,13 @@
return 1;
}
+
int skill_select_menu(struct map_session_data *sd,int flag,int skill_id) {
int id, lv, prob, aslvl = 0;
nullpo_ret(sd);
-
if (sd->sc.data[SC_STOP]) {
aslvl = sd->sc.data[SC_STOP]->val1;
- status_change_end(&sd->bl,SC_STOP,-1);
+ status_change_end(&sd->bl,SC_STOP,INVALID_TIMER);
}
if( (id = sd->status.skill[skill_id].id) == 0 || sd->status.skill[skill_id].flag != SKILL_FLAG_PLAGIARIZED ||
@@ -15592,6 +15597,7 @@
sc_start4(&sd->bl,SC__AUTOSHADOWSPELL,100,id,lv,prob,0,skill_get_time(SC_AUTOSHADOWSPELL,aslvl));
return 0;
}
+
int skill_elementalanalysis(struct map_session_data* sd, int n, int skill_lv, unsigned short* item_list) {
int i;
@@ -15610,8 +15616,8 @@
if( skill_lv == 2 )
del_amount -= (del_amount % 10);
- add_amount = (skill_lv == 1) ? del_amount * (5 + rand()%5) : del_amount / 10 ;
-
+ add_amount = (skill_lv == 1) ? del_amount * (5 + rnd()%5) : del_amount / 10 ;
+
if( (nameid = sd->status.inventory[idx].nameid) <= 0 || del_amount > sd->status.inventory[idx].amount ) {
clif_skill_fail(sd,SO_EL_ANALYSIS,0,0);
return 1;
@@ -15638,7 +15644,7 @@
return 1;
}
- if( skill_lv == 2 && rand()%100 < 25 ) { // At level 2 have a fail chance. You loose your items if it fails.
+ if( skill_lv == 2 && rnd()%100 < 25 ) { // At level 2 have a fail chance. You loose your items if it fails.
clif_skill_fail(sd,SO_EL_ANALYSIS,0,0);
return 1;
}
Index: src/map/unit.c
===================================================================
--- src/map/unit.c (revision 15963)
+++ src/map/unit.c (working copy)
@@ -7,6 +7,7 @@
#include "../common/db.h"
#include "../common/malloc.h"
#include "../common/random.h"
+
#include "unit.h"
#include "map.h"
#include "path.h"
@@ -136,8 +137,7 @@
return 0;
}
ud->walktimer = INVALID_TIMER;
- if( bl->prev == NULL ) return 0; // block_list ©ç²¯Ä¢éÌÅÚ®â~·é
-
+ if( bl->prev == NULL ) return 0; // Stop moved because it is missing from the block_list
if(ud->walkpath.path_pos>=ud->walkpath.path_len)
return 0;
@@ -155,7 +155,7 @@
if(map_getcell(bl->m,x+dx,y+dy,CELL_CHKNOPASS))
return unit_walktoxy_sub(bl);
- // oVJȏ
+ // ᅵoᅵVᅵᅵᅵJᅵᅵᅵᅵ
map_foreachinmovearea(clif_outsight, bl, AREA_SIZE, dx, dy, sd?BL_ALL:BL_PC, bl);
@@ -309,8 +309,8 @@
map_random_dir(bl, &ud->to_x, &ud->to_y);
if(ud->walktimer != INVALID_TIMER) {
- // »Ýà¢Ä¢éÅÌÚInÏXÈÌÅ}XÚÌSÉœÉ
- // timerÖ©çunit_walktoxy_subðÄÔæ€É·é
+ // ᅵᅵᅵÝᅵᅵᅵᅵÄᅵᅵᅵÅᅵᅵÌÚIᅵnᅵÏXᅵÈÌÅ}ᅵXᅵÚÌᅵᅵSᅵÉᅵᅵᅵᅵᅵᅵᅵ
+ // timerᅵÖᅵᅵᅵᅵᅵunit_walktoxy_subᅵᅵᅵÄÔæ€ï¿œÉᅵᅵᅵ
ud->state.change_walk_target = 1;
return 1;
}
@@ -491,7 +491,7 @@
nullpo_ret(bl);
if (!unit_can_move(bl)) {
- status_change_end(bl,SC_WUGDASH,-1);
+ status_change_end(bl,SC_WUGDASH,INVALID_TIMER);
return 0;
}
@@ -516,7 +516,7 @@
if(to_x == bl->x && to_y == bl->y) {
unit_bl2ud(bl)->state.running = 0;
- status_change_end(bl,SC_WUGDASH,-1);
+ status_change_end(bl,SC_WUGDASH, INVALID_TIMER);
if( sd ){
clif_fixpos(bl);
@@ -533,7 +533,7 @@
if (i==0) {
unit_bl2ud(bl)->state.running = 0;
- status_change_end(bl,SC_WUGDASH,-1);
+ status_change_end(bl,SC_WUGDASH,INVALID_TIMER);
if( sd ){
clif_fixpos(bl);
@@ -1004,8 +1004,8 @@
int temp = 0;
nullpo_ret(src);
- if(status_isdead(src))
- return 0; // ñŢȢ©
+ if( status_isdead(src) )
+ return 0; //Do not continue source is dead
sd = BL_CAST(BL_PC, src);
ud = unit_bl2ud(src);
@@ -1091,7 +1091,7 @@
return 0;
tstatus = status_get_status_data(target);
- //ŒOÌXLóµÌL^
+ //The previous record of skill status
if(sd) {
switch(skill_num){
case SA_CASTCANCEL:
@@ -1126,11 +1126,10 @@
break;
case WL_WHITEIMPRISON:
if( battle_check_target(src,target,BCT_SELF|BCT_ENEMY) < 0 ) {
- clif_skill_fail(sd,skill_num,0xb,0);
+ clif_skill_fail(sd,skill_num,USESKILL_FAIL_TOTARGET,0);
return 0;
}
break;
-
}
if (!skill_check_condition_castbegin(sd, skill_num, skill_lv))
return 0;
@@ -1293,11 +1292,11 @@
status_change_end(src,SC_CLOAKINGEXCEED, INVALID_TIMER);
if (!src->prev) return 0;
} else if( sc->data[SC_CAMOUFLAGE] && skill_num != RA_CAMOUFLAGE )
- status_change_end(src,SC_CAMOUFLAGE,-1);
+ status_change_end(src,SC_CAMOUFLAGE, INVALID_TIMER);
if( sc->data[SC_CURSEDCIRCLE_ATKER] ) {
sc->data[SC_CURSEDCIRCLE_ATKER]->val3 = 1;
- status_change_end(src,SC_CURSEDCIRCLE_ATKER,-1);
+ status_change_end(src,SC_CURSEDCIRCLE_ATKER, INVALID_TIMER);
}
}
@@ -1336,7 +1335,7 @@
nullpo_ret(src);
- if(!src->prev) return 0; // map ãɶݷé©
+ if(!src->prev) return 0; // Exists on the map
if(status_isdead(src)) return 0;
sd = BL_CAST(BL_PC, src);
@@ -1373,7 +1372,7 @@
return 0;
}
- /* ËöÆáQš`FbN */
+ /* Check range and obstacle */
bl.type = BL_NUL;
bl.m = src->m;
bl.x = skill_x;
@@ -1425,7 +1424,7 @@
if( sc->data[SC_CURSEDCIRCLE_ATKER] ) {
sc->data[SC_CURSEDCIRCLE_ATKER]->val3 = 1;
- status_change_end(src,SC_CURSEDCIRCLE_ATKER,-1);
+ status_change_end(src,SC_CURSEDCIRCLE_ATKER, INVALID_TIMER);
}
}
@@ -1476,8 +1475,8 @@
}
/*==========================================
- * Uv
- * typeª1Èçp±U
+ * Attack request
+ * If type is an ongoing attack
*------------------------------------------*/
int unit_attack(struct block_list *src,int target_id,int continuous)
{
@@ -1564,7 +1563,7 @@
{
nullpo_retr(false, bl);
- if( bl->x==x && bl->y==y ) // ¯¶}X
+ if( bl->x==x && bl->y==y ) //Same place
return true;
return path_search(NULL,bl->m,bl->x,bl->y,x,y,easy,CELL_CHKNOREACH);
@@ -1608,7 +1607,7 @@
return path_search(NULL,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH);
}
/*==========================================
- * Calculates position of Pet/Mercenary/Homunculus
+ * Calculates position of Pet/Mercenary/Homunculus/Elemental
*------------------------------------------*/
int unit_calc_pos(struct block_list *bl, int tx, int ty, int dir)
{
@@ -1666,7 +1665,7 @@
}
/*==========================================
- * PCÌU (timerÖ)
+ * Attack of the PC (function timer)
*------------------------------------------*/
static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int tick)
{
@@ -1871,7 +1870,7 @@
return 1;
}
-// unit_data Ìú»
+// unit_data initialization process
void unit_dataset(struct block_list *bl)
{
struct unit_data *ud;
@@ -1930,7 +1929,7 @@
}
/*==========================================
- * ©œÚÌTCYðÏX·é
+ * To change the size of the object (player or mob only)
*------------------------------------------*/
int unit_changeviewsize(struct block_list *bl,short size)
{
Index: src/map/battle.h
===================================================================
--- src/map/battle.h (revision 15963)
+++ src/map/battle.h (working copy)
@@ -14,7 +14,7 @@
ATK_DEF // attack connected
} damage_lv;
-// _[W
+// dammage structure
struct Damage {
int damage,damage2;
int type,div_;
@@ -47,7 +47,7 @@
int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag);
int battle_calc_bg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag);
-enum { // ÅIvZÌtO
+enum { //Attack type for battle calc
BF_WEAPON = 0x0001,
BF_MAGIC = 0x0002,
BF_MISC = 0x0004,
Index: src/map/skill.h
===================================================================
--- src/map/skill.h (revision 15963)
+++ src/map/skill.h (working copy)
@@ -87,7 +87,7 @@
int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE];
};
-// XLf?^x?X
+// Database skills
struct s_skill_db {
char name[NAME_LENGTH];
char desc[40];
@@ -116,7 +116,7 @@
extern struct s_skill_db skill_db[MAX_SKILL_DB];
#define MAX_SKILL_UNIT_LAYOUT 50
-#define MAX_SQUARE_LAYOUT 5 // 11*11ÌjbgzuªÅå
+#define MAX_SQUARE_LAYOUT 5 // 11*11 Placement of a maximum unit
#define MAX_SKILL_UNIT_COUNT ((MAX_SQUARE_LAYOUT*2+1)*(MAX_SQUARE_LAYOUT*2+1))
struct s_skill_unit_layout {
int count;
@@ -194,7 +194,7 @@
UF_DUALMODE = 0x0800, // Spells should trigger both ontimer and onplace/onout/onleft effects.
};
-// ACeì¬f?^x?X
+// Create Database item
struct s_skill_produce_db {
int nameid, trigger;
int req_skill,req_skill_lv,itemlv;
@@ -202,14 +202,14 @@
};
extern struct s_skill_produce_db skill_produce_db[MAX_SKILL_PRODUCE_DB];
-// îì¬f?^x?X
+// Creating database arrow
struct s_skill_arrow_db {
int nameid, trigger;
int cre_id[MAX_ARROW_RESOURCE],cre_amount[MAX_ARROW_RESOURCE];
};
extern struct s_skill_arrow_db skill_arrow_db[MAX_SKILL_ARROW_DB];
-// AuJ_uf?^x?X
+// Abracadabra database
struct s_skill_abra_db {
int skillid;
int req_lv;
@@ -226,7 +226,8 @@
//Returns the cast type of the skill: ground cast, castend damage, castend no damage
enum { CAST_GROUND, CAST_DAMAGE, CAST_NODAMAGE };
int skill_get_casttype(int id); //[Skotlex]
-// XLf?^x?XÖÌANZT
+
+// Accessor to the skills database
//
int skill_get_index( int id );
int skill_get_type( int id );
@@ -276,13 +277,13 @@
int skill_cleartimerskill(struct block_list *src);
int skill_addtimerskill(struct block_list *src,unsigned int tick,int target,int x,int y,int skill_id,int skill_lv,int type,int flag);
-// ÇÁ?Ê
+// Results? Added
int skill_additional_effect( struct block_list* src, struct block_list *bl,int skillid,int skilllv,int attack_type,int dmg_lv,unsigned int tick);
int skill_counter_additional_effect( struct block_list* src, struct block_list *bl,int skillid,int skilllv,int attack_type,unsigned int tick);
int skill_blown(struct block_list* src, struct block_list* target, int count, int direction, int flag);
int skill_break_equip(struct block_list *bl, unsigned short where, int rate, int flag);
int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int lv, int time);
-// jbgXL
+// Skills unit
struct skill_unit_group* skill_id2group(int group_id);
struct skill_unit_group *skill_unitsetting(struct block_list* src, short skillid, short skilllv, short x, short y, int flag);
struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2);
@@ -317,7 +318,7 @@
// Guild skills [celest]
int skill_guildaura_sub (struct map_session_data* sd, int id, int strvit, int agidex);
-// r¥LZ
+// Chant canceled
int skill_castcancel(struct block_list *bl,int type);
int skill_sit (struct map_session_data *sd, int type);
@@ -331,7 +332,7 @@
bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce);
-// Xe?^XÙí
+// Abnormal status
int skill_enchant_elemental_end(struct block_list *bl, int type);
int skillnotok(int skillid, struct map_session_data *sd);
int skillnotok_hom(int skillid, struct homun_data *hd);
@@ -339,13 +340,13 @@
int skill_chastle_mob_changetarget(struct block_list *bl,va_list ap);
-// ACeì¬
+// Item creation
int skill_can_produce_mix( struct map_session_data *sd, int nameid, int trigger, int qty);
int skill_produce_mix( struct map_session_data *sd, int skill_id, int nameid, int slot1, int slot2, int slot3, int qty );
int skill_arrow_create( struct map_session_data *sd,int nameid);
-// mobXLÌœß
+// skills for the mob
int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag );
int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag );
int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skilllv,unsigned int tick,int flag);
Index: src/map/unit.h
===================================================================
--- src/map/unit.h (revision 15963)
+++ src/map/unit.h (working copy)
@@ -66,60 +66,60 @@
unsigned dead_sit : 2;
};
-// PC, MOB, PET ɀʷéðPÂÉÜÆßévæ
+// PC, MOB, PET Planning process into one that is common to
-// àsJn
-// ßèlÍA0 ( ¬÷ ), 1 ( žs )
+// walk initiation
+// The return value is 0 (success), 1 (failure)
int unit_walktoxy( struct block_list *bl, short x, short y, int easy);
int unit_walktobl( struct block_list *bl, struct block_list *target, int range, int easy);
int unit_run(struct block_list *bl);
int unit_calc_pos(struct block_list *bl, int tx, int ty, int dir);
-// àsâ~
-// typeÍȺÌgÝí¹ :
-// 1: ÊuîñÌM( ±ÌÖÌãÉÊuîñðM·éêÍsv )
-// 2: _[WfBCLè
-// 4: sŸ(MOBÌÝH)
+// Stop walking
+// The combination of the following type:
+// 1: (If you want to send the location information after this function is not required) transmission of location information
+// 2: Damaged delay
+// 4: Unknown (only MOB?)
int unit_stop_walking(struct block_list *bl,int type);
int unit_can_move(struct block_list *bl);
int unit_is_walking(struct block_list *bl);
int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int type);
int unit_escape(struct block_list *bl, struct block_list *target, short dist);
-// Êu̧ڮ(«òεÈÇ)
+// Position of forced move (such as a blow)
int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath);
int unit_warp(struct block_list *bl, short map, short x, short y, clr_type type);
int unit_setdir(struct block_list *bl,unsigned char dir);
uint8 unit_getdir(struct block_list *bl);
int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag);
-// »±ÜÅàsÅœÇè
¯é©Ì»è
+// Determination of walking path until you reach in there
bool unit_can_reach_pos(struct block_list *bl,int x,int y,int easy);
bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, int easy, short *x, short *y);
-// UÖA
+// Attack-related
int unit_stop_attack(struct block_list *bl);
int unit_attack(struct block_list *src,int target_id,int continuous);
int unit_cancel_combo(struct block_list *bl);
-// XLgp
+// Using the skill
int unit_skilluse_id(struct block_list *src, int target_id, short skill_num, short skill_lv);
int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, short skill_num, short skill_lv);
-// XLgp( â³ÏÝLXgÔALZsÂÝèt« )
+// Skill use (corrected cast time, not with setting Cancel)
int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, short skill_lv, int casttime, int castcancel);
int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, short skill_num, short skill_lv, int casttime, int castcancel);
-// r¥LZ
+// Chant canceled
int unit_skillcastcancel(struct block_list *bl,int type);
int unit_counttargeted(struct block_list *bl,int target_lv);
-// unit_data Ìú»
+// unit_data Initialization process
void unit_dataset(struct block_list *bl);
int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int tick,int sdelay,int ddelay,int damage,int div,int type,int damage2);
-// »ÌŒ
+// Other
struct unit_data* unit_bl2ud(struct block_list *bl);
void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype);
void unit_free_pc(struct map_session_data *sd);
@@ -128,7 +128,7 @@
int unit_free(struct block_list *bl, clr_type clrtype);
int unit_changeviewsize(struct block_list *bl,short size);
-// ú»[`
+// Initialization routine
int do_init_unit(void);
int do_final_unit(void);
/**
Index: src/map/mercenary.c
===================================================================
--- src/map/mercenary.c (revision 15963)
+++ src/map/mercenary.c (working copy)
@@ -371,7 +371,7 @@
const enum sc_type scs[] = { SC_MERC_FLEEUP, SC_MERC_ATKUP, SC_MERC_HPUP, SC_MERC_SPUP, SC_MERC_HITUP };
int index = rnd() % ARRAYLENGTH(scs);
- status_change_start(&md->bl, scs[index], 10000, rnd()%5, 0, 0, 0, 600000, 0);
+ sc_start(&md->bl, scs[index], 100, rnd()%5, 600000);
return 0;
}
Index: src/map/storage.c
===================================================================
--- src/map/storage.c (revision 15963)
+++ src/map/storage.c (working copy)
@@ -27,7 +27,7 @@
static DBMap* guild_storage_db; // int guild_id -> struct guild_storage*
/*==========================================
- * qÉàACe\[g
+ * Sort items in the warehouse
*------------------------------------------*/
static int storage_comp_item(const void *_i1, const void *_i2)
{
@@ -54,9 +54,9 @@
}
/*==========================================
- * ú»Æ©
+ * Init/Terminate
*------------------------------------------*/
-int do_init_storage(void) // map.c::do_init()©çÄÎêé
+int do_init_storage(void) // Called from map.c::do_init()
{
guild_storage_db=idb_alloc(DB_OPT_RELEASE_DATA);
return 1;
@@ -110,14 +110,18 @@
return 0;
}
-// helper function
-int compare_item(struct item *a, struct item *b)
+/* helper function
+ * checking if 2 item structure are identique
+ * flag :
+ * 1 = not checking expire_time
+ */
+int compare_item(struct item *a, struct item *b, short flag)
{
if( a->nameid == b->nameid &&
a->identify == b->identify &&
a->refine == b->refine &&
a->attribute == b->attribute &&
- a->expire_time == b->expire_time )
+ (flag&1 || (a->expire_time == b->expire_time) ))
{
int i;
for (i = 0; i < MAX_SLOTS && (a->card[i] == b->card[i]); i++);
@@ -150,7 +154,7 @@
{//Stackable
for( i = 0; i < MAX_STORAGE; i++ )
{
- if( compare_item(&stor->items[i], item_data) )
+ if( compare_item(&stor->items[i], item_data,0) )
{// existing items found, stack them
if( amount > MAX_AMOUNT - stor->items[i].amount )
return 1;
@@ -404,7 +408,7 @@
if(itemdb_isstackable2(data)){ //Stackable
for(i=0;i<MAX_GUILD_STORAGE;i++){
- if(compare_item(&stor->items[i], item_data)) {
+ if(compare_item(&stor->items[i], item_data, 0)) {
if(stor->items[i].amount+amount > MAX_AMOUNT)
return 1;
stor->items[i].amount+=amount;
Index: src/map/storage.h
===================================================================
--- src/map/storage.h (revision 15963)
+++ src/map/storage.h (working copy)
@@ -23,6 +23,7 @@
void do_reconnect_storage(void);
void storage_storage_quit(struct map_session_data *sd, int flag);
+int compare_item(struct item *a, struct item *b, short flag);
struct guild_storage* guild2storage(int guild_id);
int guild_storage_delete(int guild_id);
int storage_guild_storageopen(struct map_session_data *sd);
Index: src/map/buyingstore.c
===================================================================
--- src/map/buyingstore.c (revision 15963)
+++ src/map/buyingstore.c (working copy)
@@ -6,6 +6,7 @@
#include "../common/showmsg.h" // ShowWarning
#include "../common/socket.h" // RBUF*
#include "../common/strlib.h" // safestrncpy
+#include "../common/nullpo.h" //security check
#include "atcommand.h" // msg_txt
#include "battle.h" // battle_config.*
#include "buyingstore.h" // struct s_buyingstore
@@ -46,6 +47,8 @@
bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
{
+ nullpo_retr(sd,false);
+
if( !battle_config.feature_buying_store || sd->state.vending || sd->state.buyingstore || sd->state.trading || slots == 0 )
{
return false;
@@ -90,6 +93,7 @@
{// canceled, or no items
return;
}
+ nullpo_retv(sd);
if( !battle_config.feature_buying_store || pc_istrading(sd) || sd->buyingstore.slots == 0 || count > sd->buyingstore.slots || zenylimit <= 0 || zenylimit > sd->status.zeny || !storename[0] )
{// disabled or invalid input
Index: src/map/mob.c
===================================================================
--- src/map/mob.c (revision 15963)
+++ src/map/mob.c (working copy)
@@ -223,10 +223,10 @@
//FIXME: This implementation is not stable, npc scripts will stop working once MAX_MOB_DB changes value! [Skotlex]
if(data->class_ > 2*MAX_MOB_DB){ // large/tiny mobs [Valaris]
- data->state.size=2;
+ data->state.size=SZ_BIG;
data->class_ -= 2*MAX_MOB_DB;
} else if (data->class_ > MAX_MOB_DB) {
- data->state.size=1;
+ data->state.size=SZ_MEDIUM;
data->class_ -= MAX_MOB_DB;
}
@@ -239,12 +239,12 @@
if( i )
{
- if( i&2 )
- data->state.size = 1;
- else if( i&4 )
- data->state.size = 2;
- if( i&8 )
- data->state.ai = 1;
+ if (i&2)
+ data->state.size=SZ_MEDIUM;
+ else if (i&4)
+ data->state.size=SZ_BIG;
+ if (i&8)
+ data->state.ai=1;
}
data->eventname[0] = '\0'; //Clear event as it is not used.
}
@@ -2197,9 +2197,9 @@
}
// change experience for different sized monsters [Valaris]
- if(md->special_state.size==1)
+ if(md->special_state.size==SZ_MEDIUM)
per /=2.;
- else if(md->special_state.size==2)
+ else if(md->special_state.size==SZ_BIG)
per *=2.;
if( md->dmglog[i].flag == MDLF_PET )
@@ -2313,9 +2313,9 @@
}
// change drops depending on monsters size [Valaris]
- if(md->special_state.size==1 && drop_rate >= 2)
+ if(md->special_state.size==SZ_MEDIUM && drop_rate >= 2)
drop_rate/=2;
- else if(md->special_state.size==2)
+ else if(md->special_state.size==SZ_BIG)
drop_rate*=2;
if (src) {
//Drops affected by luk as a fixed increase [Valaris]
@@ -2722,7 +2722,7 @@
}
/*==========================================
- * mobñ
+ * mob heal, permet d'update la barre d'hp d'un mob pour le joueur
*------------------------------------------*/
void mob_heal(struct mob_data *md,unsigned int heal)
{
@@ -2763,7 +2763,7 @@
}
/*==========================================
- * æÊàÌæèª«ÌvZp(foreachinarea)
+ * Permet de savoir si un mob est le slave d'un mobid
*------------------------------------------*/
int mob_countslave_sub(struct block_list *bl,va_list ap)
{
@@ -2778,7 +2778,7 @@
}
/*==========================================
- * æÊàÌæèª«ÌvZ
+ * Permet de compter le nombre de slave d'un mob sur la map
*------------------------------------------*/
int mob_countslave(struct block_list *bl)
{
@@ -2884,7 +2884,7 @@
}
/*==========================================
- *MOBskill©çYskillidÌskillidxðÔ·
+ * MOBskill lookup
*------------------------------------------*/
int mob_skillid2skillidx(int class_,int skillid)
{
@@ -3896,7 +3896,7 @@
class_=atoi(str[0]);
- if(mob_db(class_) == mob_dummy) // lªÙíÈçµÈ¢B
+ if(mob_db(class_) == mob_dummy) // invalid class (probably undefined in db)
{
ShowWarning("mob_readdb_mobavail: Unknown mob id %d.\n", class_);
return false;
Index: src/map/clif.c
===================================================================
--- src/map/clif.c (revision 15963)
+++ src/map/clif.c (working copy)
@@ -196,7 +196,7 @@
static int clif_parse (int fd);
/*==========================================
- * mapIÌipÝè
+ * mapᅵIᅵᅵipᅵÝᅵ
*------------------------------------------*/
int clif_setip(const char* ip)
{
@@ -1367,9 +1367,9 @@
case BL_NPC:
{
TBL_NPC *nd = ((TBL_NPC*)bl);
- if( nd->size == 2 )
+ if( nd->size == SZ_BIG )
clif_specialeffect(&nd->bl,423,AREA);
- else if( nd->size == 1 )
+ else if( nd->size == SZ_MEDIUM )
clif_specialeffect(&nd->bl,421,AREA);
}
break;
@@ -1564,9 +1564,9 @@
case BL_MOB:
{
TBL_MOB *md = ((TBL_MOB*)bl);
- if(md->special_state.size==2) // tiny/big mobs [Valaris]
+ if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
clif_specialeffect(&md->bl,423,AREA);
- else if(md->special_state.size==1)
+ else if(md->special_state.size==SZ_MEDIUM)
clif_specialeffect(&md->bl,421,AREA);
}
break;
@@ -3162,7 +3162,7 @@
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0x013c));
WFIFOW(fd,0)=0x013c;
- WFIFOW(fd,2)=val+2;//îÌACeID
+ WFIFOW(fd,2)=val+2;//Item ID of the arrow
WFIFOSET(fd,packet_len(0x013c));
}
@@ -4050,18 +4050,18 @@
TBL_NPC* nd = (TBL_NPC*)bl;
if( nd->chat_id )
clif_dispchat((struct chat_data*)map_id2bl(nd->chat_id),sd->fd);
- if( nd->size == 2 )
+ if( nd->size == SZ_BIG )
clif_specialeffect_single(bl,423,sd->fd);
- else if( nd->size == 1 )
+ else if( nd->size == SZ_MEDIUM )
clif_specialeffect_single(bl,421,sd->fd);
}
break;
case BL_MOB:
{
TBL_MOB* md = (TBL_MOB*)bl;
- if(md->special_state.size==2) // tiny/big mobs [Valaris]
+ if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
clif_specialeffect_single(bl,423,sd->fd);
- else if(md->special_state.size==1)
+ else if(md->special_state.size==SZ_MEDIUM)
clif_specialeffect_single(bl,421,sd->fd);
}
break;
@@ -11725,22 +11725,22 @@
switch( RFIFOL(fd,2) )
{
- case 0: // Mhî{îñA¯¿GÎîñ
+ case 0: // ᅵMᅵᅵᅵhᅵᅵ{ᅵᅵᅵAᅵᅵᅵᅵᅵGᅵÎᅵᅵ
clif_guild_basicinfo(sd);
clif_guild_allianceinfo(sd);
break;
- case 1: // o[XgAðEŒXg
+ case 1: // ᅵᅵᅵᅵᅵoᅵ[ᅵᅵᅵXᅵgᅵAᅵᅵEᅵᅵᅵᅵᅵXᅵg
clif_guild_positionnamelist(sd);
clif_guild_memberlist(sd);
break;
- case 2: // ðEŒXgAðEîñXg
+ case 2: // ᅵᅵEᅵᅵᅵᅵᅵXᅵgᅵAᅵᅵEᅵᅵñXᅵg
clif_guild_positionnamelist(sd);
clif_guild_positioninfolist(sd);
break;
- case 3: // XLXg
+ case 3: // ᅵXᅵLᅵᅵᅵᅵᅵXᅵg
clif_guild_skillinfo(sd);
break;
- case 4: // ÇúXg
+ case 4: // ᅵÇᅵXᅵg
clif_guild_expulsionlist(sd);
break;
default:
@@ -15857,7 +15857,7 @@
sd->menuskill_id = SC_AUTOSHADOWSPELL;
sd->menuskill_val = c;
} else {
- status_change_end(&sd->bl,SC_STOP,-1);
+ status_change_end(&sd->bl,SC_STOP, INVALID_TIMER);
clif_skill_fail(sd,SC_AUTOSHADOWSPELL,0x15,0);
}
@@ -16159,7 +16159,7 @@
#endif
#if PACKETVER < 2
3, 28, 19, 11, 3, -1, 9, 5, 52, 51, 56, 58, 41, 2, 6, 6,
-#elif PACKETVER < 20071106 // 78-7b TÈ~ lv99GtFNgp
+#elif PACKETVER < 20071106 // 78-7b ᅵTᅵᅵᅵÈ~ lv99ᅵGᅵtᅵFᅵNᅵgᅵp
3, 28, 19, 11, 3, -1, 9, 5, 54, 53, 58, 60, 41, 2, 6, 6,
#elif PACKETVER <= 20081217 // change in 0x78 and 0x7c
3, 28, 19, 11, 3, -1, 9, 5, 55, 53, 58, 60, 42, 2, 6, 6,
@@ -16194,7 +16194,7 @@
6, 3,106, 10, 10, 34, 0, 6, 8, 4, 4, 4, 29, -1, 10, 6,
#if PACKETVER < 1
90, 86, 24, 6, 30,102, 8, 4, 8, 4, 14, 10, -1, 6, 2, 6,
-#else // 196 comodoÈ~ óÔ\ŠACRp
+#else // 196 comodoᅵÈ~ ᅵᅵÔ\ᅵᅵᅵAᅵCᅵRᅵᅵᅵp
90, 86, 24, 6, 30,102, 9, 4, 8, 4, 14, 10, -1, 6, 2, 6,
#endif
#if PACKETVER < 20081126
Index: src/map/chat.c
===================================================================
--- src/map/chat.c (revision 15963)
+++ src/map/chat.c (working copy)
@@ -156,11 +156,11 @@
pc_setchatid(sd,cd->bl.id);
- clif_joinchatok(sd,cd); // VœÉQÁµœlÉÍSõÌXg
- clif_addchat(cd,sd); // ùÉÉœlÉÍÇÁµœlÌñ
- clif_dispchat(cd,0); // üÍÌlÉÍlÏ»ñ
+ clif_joinchatok(sd,cd); //To the person who newly joined the list of all
+ clif_addchat(cd,sd); //Reports To the person who already in the chat
+ clif_dispchat(cd,0); //Reported number of changes to the people around
- chat_triggerevent(cd); // Cxg
+ chat_triggerevent(cd); //Event
return 0;
}
@@ -372,7 +372,7 @@
}
/*==========================================
- * KèlÈãÅCxgªè`³êÄéÈçÀs
+ * Trigger npc event when we enter the chatroom
*------------------------------------------*/
int chat_triggerevent(struct chat_data *cd)
{
Index: src/map/mob.h
===================================================================
--- src/map/mob.h (revision 15963)
+++ src/map/mob.h (working copy)
@@ -63,6 +63,12 @@
MDLF_PET,
};
+enum size {
+ SZ_SMALL = 0,
+ SZ_MEDIUM,
+ SZ_BIG,
+};
+
struct mob_skill {
enum MobSkillState state;
short skill_id,skill_lv;
Index: src/map/itemdb.c
===================================================================
--- src/map/itemdb.c (revision 15963)
+++ src/map/itemdb.c (working copy)
@@ -50,7 +50,7 @@
}
/*==========================================
- * ŒOÅõ
+ * Retourne l'item data a partir du nom de l'item.
*------------------------------------------*/
struct item_data* itemdb_searchname(const char *str)
{
@@ -135,7 +135,7 @@
/*==========================================
- * nACeõ
+ * Retourne un item id random appartenant au groupe.
*------------------------------------------*/
int itemdb_searchrandomid(int group)
{
@@ -584,7 +584,7 @@
}
/*==========================================
- * õ§Àt@CÇÝoµ
+ * Read item forbiden by mapflag restricted
*------------------------------------------*/
static bool itemdb_read_noequip(char* str[], int columns, int current)
{// <nameid>,<mode>
@@ -870,7 +870,8 @@
}
/*==========================================
- * ACef[^x[XÌÇÝÝ
+ * Reading item from item db
+ * item_db2 overwriting item_db
*------------------------------------------*/
static int itemdb_readdb(void)
{
Index: src/map/guild.c
===================================================================
--- src/map/guild.c (revision 15963)
+++ src/map/guild.c (working copy)
@@ -39,12 +39,12 @@
struct eventlist *next;
};
-// MhÌEXPLbV
ÌtbV
ÉÖA·éè
-#define GUILD_SEND_XY_INVERVAL 5000 // ÀWâgoMÌÔu
-#define GUILD_PAYEXP_INVERVAL 10000 // Ôu(LbV
ÌÅå¶¶ÔA~b)
-#define GUILD_PAYEXP_LIST 8192 // LbV
ÌÅå
+//Constant related to the flash of the Guild EXP cache
+#define GUILD_SEND_XY_INVERVAL 5000 // Interval of sending coordinates and HP
+#define GUILD_PAYEXP_INVERVAL 10000 //Interval (maximum survival time of the cache, in milliseconds)
+#define GUILD_PAYEXP_LIST 8192 //The maximum number of cache
-// MhÌEXPLbV
+//Guild EXP cache
struct guild_expcache {
int guild_id, account_id, char_id;
uint64 exp;
@@ -91,7 +91,7 @@
return guild_skill_tree[id-GD_SKILLBASE].max;
}
-// MhXLª é©mF
+// Retrive skilllv learned by guild
int guild_checkskill(struct guild *g,int id)
{
int idx = id-GD_SKILLBASE;
@@ -110,8 +110,7 @@
skillid = atoi(split[0]);
id = skillid - GD_SKILLBASE;
- if( id < 0 || id >= MAX_GUILDSKILL )
- {
+ if (id < 0 || id >= MAX_GUILDSKILL) {
ShowWarning("guild_read_guildskill_tree_db: Invalid skill id %d.\n", skillid);
return false;
}
@@ -119,13 +118,12 @@
guild_skill_tree[id].id = skillid;
guild_skill_tree[id].max = atoi(split[1]);
- if( guild_skill_tree[id].id == GD_GLORYGUILD && battle_config.require_glory_guild && guild_skill_tree[id].max == 0 )
- {// enable guild's glory when required for emblems
+ if (guild_skill_tree[id].id == GD_GLORYGUILD && battle_config.require_glory_guild && guild_skill_tree[id].max == 0) {
+ // enable guild's glory when required for emblems
guild_skill_tree[id].max = 1;
}
- for( k = 0; k < MAX_GUILD_SKILL_REQUIRE; k++ )
- {
+ for (k = 0; k < MAX_GUILD_SKILL_REQUIRE; k++) {
guild_skill_tree[id].need[k].id = atoi(split[k*2+2]);
guild_skill_tree[id].need[k].lv = atoi(split[k*2+3]);
}
@@ -147,8 +145,7 @@
if (idx < 0 || idx >= MAX_GUILDSKILL)
return 0;
- for(i=0;i<MAX_GUILD_SKILL_REQUIRE;i++)
- {
+ for (i = 0; i < MAX_GUILD_SKILL_REQUIRE; i++) {
if(guild_skill_tree[idx].need[i].id == 0) break;
if(guild_skill_tree[idx].need[i].lv > guild_checkskill(g,guild_skill_tree[idx].need[i].id))
return 0;
@@ -261,7 +258,7 @@
return( i < g->max_member ) ? g->member[i].position : -1;
}
-// o[îñÌì¬
+//Creation of member information
void guild_makemember(struct guild_member *m,struct map_session_data *sd)
{
nullpo_retv(sd);
@@ -283,7 +280,7 @@
}
/**
- * MhÌEXPLbV
ðinterIÉtbV
·é
+ * Server cache to be flushed to inter the Guild EXP
* @see DBApply
*/
int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
@@ -392,7 +389,7 @@
return 1;
}
-// ì¬ÂÛ
+//Whether or not to create guilde
int guild_created(int account_id,int guild_id)
{
struct map_session_data *sd=map_id2sd(account_id);
@@ -400,7 +397,7 @@
if(sd==NULL)
return 0;
if(!guild_id) {
- clif_guild_created(sd,2); // 쬞si¯ŒMh¶Ýj
+ clif_guild_created(sd,2); // Creation failure (presence of the same name Guild)
return 0;
}
//struct guild *g;
@@ -411,13 +408,13 @@
return 0;
}
-// îñv
+//Information request
int guild_request_info(int guild_id)
{
return intif_guild_request_info(guild_id);
}
-// Cxgt«îñv
+//Information request with event
int guild_npc_request_info(int guild_id,const char *event)
{
if( guild_search(guild_id) )
@@ -442,7 +439,7 @@
return guild_request_info(guild_id);
}
-// ®LÌmF
+//Confirmation of the character belongs to guild
int guild_check_member(struct guild *g)
{
int i;
@@ -469,7 +466,7 @@
return 0;
}
-// îñŸžsi»ÌIDÌLðS¢®É·éj
+//Delete association with guild_id for all characters
int guild_recv_noinfo(int guild_id)
{
struct map_session_data *sd;
@@ -486,7 +483,7 @@
return 0;
}
-// îñŸ
+//Get and display information for all member
int guild_recv_info(struct guild *sg)
{
struct guild *g,before;
@@ -504,7 +501,7 @@
idb_put(guild_db,sg->guild_id,g);
before=*sg;
- // ÅÌ[hÈÌÅ[U[Ì`FbNðs€
+ //Perform the check on the user because the first load
guild_check_member(sg);
if ((sd = map_nick2sd(sg->master)) != NULL)
{
@@ -539,32 +536,32 @@
bm++;
}
- for(i=0;i<g->max_member;i++){ // îñÌM
+ for(i=0;i<g->max_member;i++){ //Transmission of information at all members
sd = g->member[i].sd;
if( sd==NULL )
continue;
if( before.guild_lv!=g->guild_lv || bm!=m ||
before.max_member!=g->max_member ){
- clif_guild_basicinfo(sd); // î{îñM
- clif_guild_emblem(sd,g); // GuM
+ clif_guild_basicinfo(sd); //Submit basic information
+ clif_guild_emblem(sd,g); //Submit emblem
}
- if(bm!=m){ // o[îñM
+ if(bm!=m){ //Send members information
clif_guild_memberlist(g->member[i].sd);
}
if( before.skill_point!=g->skill_point)
- clif_guild_skillinfo(sd); // XLîñM
+ clif_guild_skillinfo(sd); //Submit information skills
- if( guild_new ){ // ¢MÈç®îñàé
+ if( guild_new ){ // Send information and affiliation if unsent
clif_guild_belonginfo(sd,g);
clif_guild_notice(sd,g);
sd->guild_emblem_id=g->emblem_id;
}
}
- // Cxg̶
+ //Occurrence of an event
if (guild_infoevent_db->remove(guild_infoevent_db, db_i2key(sg->guild_id), &data))
{
struct eventlist *ev = db_data2ptr(&data), *ev2;
@@ -579,8 +576,9 @@
return 0;
}
-
-// MhÖÌ©U
+/*=============================================
+ * Player sd send a guild invatation to player tsd to join his guild
+ *--------------------------------------------*/
int guild_invite(struct map_session_data *sd,struct map_session_data *tsd)
{
struct guild *g;
@@ -616,7 +614,7 @@
return 0;
}
- // èõmF
+ //search an empty spot in guild
ARR_FIND( 0, g->max_member, i, g->member[i].account_id == 0 );
if(i==g->max_member){
clif_guild_inviteack(sd,3);
@@ -714,7 +712,9 @@
g->member[i].sd = sd;
}
-// MhoªÇÁ³êœ
+/*==========================================
+ * Add a player to a given guild_id
+ *----------------------------------------*/
int guild_member_added(int guild_id,int account_id,int char_id,int flag)
{
struct map_session_data *sd= map_id2sd(account_id),*sd2;
@@ -724,7 +724,7 @@
return 0;
if(sd==NULL || sd->guild_invite==0){
- // L€Éo^ūȩÁœœßEÞvðo·
+ // cancel if player not present or invalide guild_id invitation
if (flag == 0) {
ShowError("guild: member added error %d is not online\n",account_id);
intif_guild_leave(guild_id,account_id,char_id,0,"** Data Error **");
@@ -735,13 +735,13 @@
sd->guild_invite = 0;
sd->guild_invite_account = 0;
- if(flag==1){ // žs
+ if(flag==1){ //failure
if( sd2!=NULL )
clif_guild_inviteack(sd2,3);
return 0;
}
- // ¬÷
+ //if all ok adding player to guild
sd->status.guild_id = g->guild_id;
sd->guild_emblem_id = g->emblem_id;
//Packets which were sent in the previous 'guild_sent' implementation.
@@ -759,7 +759,9 @@
return 0;
}
-// MhEÞv
+/*==========================================
+ * Player request leaving a given guild_id
+ *----------------------------------------*/
int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
{
struct guild *g;
@@ -780,7 +782,9 @@
return 0;
}
-// MhÇúv
+/*==========================================
+ * Request remove a player to a given guild_id
+ *----------------------------------------*/
int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
{
struct map_session_data *tsd;
@@ -917,7 +921,7 @@
}
if(idx == -1 || c == 0) {
- // MhÌo[OÈÌÅÇúµ¢·é
+ //Treat char_id who doesn't match guild_id (not found as member)
struct map_session_data *sd = map_id2sd(account_id);
if(sd && sd->status.char_id == char_id) {
sd->status.guild_id=0;
@@ -953,7 +957,10 @@
return 0;
}
-// MhïbM
+
+/*====================================================
+ * Send a message to whole guild
+ *---------------------------------------------------*/
int guild_send_message(struct map_session_data *sd,const char *mes,int len)
{
nullpo_ret(sd);
@@ -968,7 +975,10 @@
return 0;
}
-// MhïbóM
+
+/*====================================================
+ * Guild receive a message, will be displayed to whole member
+ *---------------------------------------------------*/
int guild_recv_message(int guild_id,int account_id,const char *mes,int len)
{
struct guild *g;
@@ -977,12 +987,18 @@
clif_guild_message(g,account_id,mes,len);
return 0;
}
-// MhoÌðEÏX
+
+/*====================================================
+ * Member changing position in guild
+ *---------------------------------------------------*/
int guild_change_memberposition(int guild_id,int account_id,int char_id,short idx)
{
return intif_guild_change_memberinfo(guild_id,account_id,char_id,GMI_POSITION,&idx,sizeof(idx));
}
-// MhoÌðEÏXÊm
+
+/*====================================================
+ * Notification of new position for member
+ *---------------------------------------------------*/
int guild_memberposition_changed(struct guild *g,int idx,int pos)
{
nullpo_ret(g);
@@ -995,7 +1011,10 @@
clif_charnameupdate(g->member[idx].sd);
return 0;
}
-// MhðEÏX
+
+/*====================================================
+ * Change guild title or member
+ *---------------------------------------------------*/
int guild_change_position(int guild_id,int idx,
int mode,int exp_mode,const char *name)
{
@@ -1009,7 +1028,10 @@
safestrncpy(p.name,name,NAME_LENGTH);
return intif_guild_position(guild_id,idx,&p);
}
-// MhðEÏXÊm
+
+/*====================================================
+ * Notification of member has changed his guild tiltle
+ *---------------------------------------------------*/
int guild_position_changed(int guild_id,int idx,struct guild_position *p)
{
struct guild *g=guild_search(guild_id);
@@ -1025,7 +1047,10 @@
clif_charnameupdate(g->member[i].sd);
return 0;
}
-// MhmÏX
+
+/*====================================================
+ * Change guild notice
+ *---------------------------------------------------*/
int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2)
{
nullpo_ret(sd);
@@ -1034,7 +1059,10 @@
return 0;
return intif_guild_notice(guild_id,mes1,mes2);
}
-// MhmÏXÊm
+
+/*====================================================
+ * Notification of guild has changed his notice
+ *---------------------------------------------------*/
int guild_notice_changed(int guild_id,const char *mes1,const char *mes2)
{
int i;
@@ -1052,7 +1080,10 @@
}
return 0;
}
-// MhGuÏX
+
+/*====================================================
+ * Change guild emblem
+ *---------------------------------------------------*/
int guild_change_emblem(struct map_session_data *sd,int len,const char *data)
{
struct guild *g;
@@ -1066,7 +1097,10 @@
return intif_guild_emblem(sd->status.guild_id,len,data);
}
-// MhGuÏXÊm
+
+/*====================================================
+ * Notification of guild emblem changed
+ *---------------------------------------------------*/
int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
{
int i;
@@ -1146,7 +1180,9 @@
return db_ptr2data(c);
}
-// MhÌEXPã[
+/*====================================================
+ * return Taxed experience from player sd to guild
+ *---------------------------------------------------*/
unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
{
struct guild *g;
@@ -1178,7 +1214,11 @@
return exp;
}
-// Celest
+/*====================================================
+ * Player sd pay a tribue experience exp to his guild
+ * Add this experience to guild exp
+ * [Celest]
+ *---------------------------------------------------*/
int guild_getexp(struct map_session_data *sd,int exp)
{
struct guild_expcache *c;
@@ -1195,7 +1235,9 @@
return exp;
}
-// XL|CgèUè
+/*====================================================
+ * Ask to increase guildskill skill_num
+ *---------------------------------------------------*/
int guild_skillup(TBL_PC* sd, int skill_num)
{
struct guild* g;
@@ -1216,7 +1258,10 @@
return 0;
}
-// XL|CgèUèÊm
+
+/*====================================================
+ * Notification of guildskill skill_num increase request
+ *---------------------------------------------------*/
int guild_skillupack(int guild_id,int skill_num,int account_id)
{
struct map_session_data *sd=map_id2sd(account_id);
@@ -1263,7 +1308,14 @@
}
return;
}
-// Mh¯¿Ÿ
+
+
+/*====================================================
+ * Count number of relation the guild have
+ * flag :
+ * 0 = allied
+ * 1 = ennemy
+ *---------------------------------------------------*/
int guild_get_alliance_count(struct guild *g,int flag)
{
int i,c;
@@ -1302,7 +1354,9 @@
return( i < MAX_GUILDALLIANCE ) ? 1 : 0;
}
-// Mh¯¿v
+/*====================================================
+ * Player sd, asking player tsd an alliance between there 2 guild
+ *---------------------------------------------------*/
int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
{
struct guild *g[2];
@@ -1343,7 +1397,7 @@
return 0;
}
- for(i=0;i<MAX_GUILDALLIANCE;i++){ // ·Åɯ¿óÔ©mF
+ for(i=0;i<MAX_GUILDALLIANCE;i++){ // check if already allied
if( g[0]->alliance[i].guild_id==tsd->status.guild_id &&
g[0]->alliance[i].opposition==0){
clif_guild_allianceack(sd,0);
@@ -1357,7 +1411,10 @@
clif_guild_reqalliance(tsd,sd->status.account_id,g[0]->name);
return 0;
}
-// Mh©UÖÌÔ
+
+/*====================================================
+ * Player sd, awsser to player tsd (account_id) for an alliance request
+ *---------------------------------------------------*/
int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
{
struct map_session_data *tsd;
@@ -1369,13 +1426,13 @@
return 0;
}
- if(sd->guild_alliance!=tsd->status.guild_id) // ©UÆMhIDªá€
+ if(sd->guild_alliance!=tsd->status.guild_id) // proposed guild_id alliance doesn't match tsd guildid
return 0;
- if(flag==1){ // ³ø
+ if(flag==1){ // consent
int i;
- struct guild *g,*tg; // ¯¿ÄmF
+ struct guild *g,*tg; // Reconfirm the number of alliance
g=guild_search(sd->status.guild_id);
tg=guild_search(tsd->status.guild_id);
@@ -1403,11 +1460,11 @@
tsd->status.account_id,sd->status.account_id,9 );
}
- // interIÖ¯¿v¿
+ // inform other servers
intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
sd->status.account_id,tsd->status.account_id,0 );
return 0;
- }else{ // Û
+ }else{ // deny
sd->guild_alliance=0;
sd->guild_alliance_account=0;
if(tsd!=NULL)
@@ -1416,7 +1473,9 @@
return 0;
}
-// MhÖWðÁ
+/*====================================================
+ * Player sd asking to break alliance with guild guild_id
+ *---------------------------------------------------*/
int guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
{
nullpo_ret(sd);
@@ -1430,7 +1489,10 @@
return 0;
}
-// MhGÎ
+
+/*====================================================
+ * Player sd, asking player tsd a formal ennemy relation between there 2 guild
+ *---------------------------------------------------*/
int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd)
{
struct guild *g;
@@ -1451,9 +1513,9 @@
return 0;
}
- for(i=0;i<MAX_GUILDALLIANCE;i++){ // ·ÅÉÖWðÁÄ¢é©mF
+ for(i=0;i<MAX_GUILDALLIANCE;i++){ // checking relations
if(g->alliance[i].guild_id==tsd->status.guild_id){
- if(g->alliance[i].opposition==1){ // ·ÅÉGÎ
+ if(g->alliance[i].opposition==1){ // check if not already hostile
clif_guild_oppositionack(sd,2);
return 0;
}
@@ -1465,13 +1527,15 @@
}
}
- // interIÉGÎv¿
+ // inform other serv
intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
sd->status.account_id,tsd->status.account_id,1 );
return 0;
}
-// Mh¯¿/GÎÊm
+/*====================================================
+ * Notification of a relationship between 2 guild
+ *---------------------------------------------------*/
int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag,const char *name1,const char *name2)
{
struct guild *g[2];
@@ -1495,14 +1559,14 @@
sd[0]->guild_alliance_account=0;
}
- if(flag&0x70){ // žs
+ if(flag&0x70){ // failure
for(i=0;i<2-(flag&1);i++)
if( sd[i]!=NULL )
clif_guild_allianceack(sd[i],((flag>>4)==i+1)?3:4);
return 0;
}
- if(!(flag&0x08)){ // ÖWÇÁ
+ if(!(flag&0x08)){ // new relationship
for(i=0;i<2-(flag&1);i++)
{
if(g[i]!=NULL)
@@ -1516,7 +1580,7 @@
}
}
}
- }else{ // ÖWðÁ
+ }else{ // remove relationship
for(i=0;i<2-(flag&1);i++)
{
if(g[i]!=NULL)
@@ -1525,21 +1589,21 @@
if( j < MAX_GUILDALLIANCE )
g[i]->alliance[j].guild_id = 0;
}
- if( sd[i]!=NULL ) // ðÁÊm
+ if( sd[i]!=NULL ) // notify players
clif_guild_delalliance(sd[i],guild_id[1-i],(flag&1));
}
}
- if((flag&0x0f)==0){ // ¯¿Êm
+ if((flag&0x0f)==0){ // alliance notification
if( sd[1]!=NULL )
clif_guild_allianceack(sd[1],2);
- }else if((flag&0x0f)==1){ // GÎÊm
+ }else if((flag&0x0f)==1){ // ennemy notification
if( sd[0]!=NULL )
clif_guild_oppositionack(sd[0],0);
}
- for(i=0;i<2-(flag&1);i++){ // ¯¿/GÎXgÌÄM
+ for(i=0;i<2-(flag&1);i++){ // Retransmission of the relationship list to all members
struct map_session_data *sd;
if(g[i]!=NULL)
for(j=0;j<g[i]->max_member;j++)
@@ -1549,10 +1613,9 @@
return 0;
}
-/**
- * MhðUÊmp
- * @see DBApply
- */
+/*====================================================
+ * Notification for the guild disbanded
+ *---------------------------------------------------*/
int guild_broken_sub(DBKey key, DBData *data, va_list ap)
{
struct guild *g = db_data2ptr(data);
@@ -1562,7 +1625,7 @@
nullpo_ret(g);
- for(i=0;i<MAX_GUILDALLIANCE;i++){ // ÖWðjü
+ for(i=0;i<MAX_GUILDALLIANCE;i++){ // Destroy all relationships
if(g->alliance[i].guild_id==guild_id){
for(j=0;j<g->max_member;j++)
if( (sd=g->member[j].sd)!=NULL )
@@ -1608,7 +1671,7 @@
if(flag!=0 || g==NULL)
return 0;
- for(i=0;i<g->max_member;i++){ // MhðUðÊm
+ for(i=0;i<g->max_member;i++){ //Notification to disband the guild at all remaining member
if((sd=g->member[i].sd)!=NULL){
if(sd->state.storage_flag == 2)
storage_guild_storage_quit(sd,1);
@@ -1700,7 +1763,10 @@
return 1;
}
-// MhðU
+
+/*====================================================
+ * Guild disbanded
+ *---------------------------------------------------*/
int guild_break(struct map_session_data *sd,char *name)
{
struct guild *g;
@@ -1893,6 +1959,9 @@
return 0;
}
+/*====================================================
+ * Start normal woe and triggers all npc OnAgitStart
+ *---------------------------------------------------*/
int guild_agit_start(void)
{ // Run All NPC_Event[OnAgitStart]
int c = npc_event_doall("OnAgitStart");
@@ -1900,6 +1969,9 @@
return 0;
}
+/*====================================================
+ * End normal woe and triggers all npc OnAgitEnd
+ *---------------------------------------------------*/
int guild_agit_end(void)
{ // Run All NPC_Event[OnAgitEnd]
int c = npc_event_doall("OnAgitEnd");
@@ -1907,6 +1979,9 @@
return 0;
}
+/*====================================================
+ * Start woe2 and triggers all npc OnAgitStart2
+ *---------------------------------------------------*/
int guild_agit2_start(void)
{ // Run All NPC_Event[OnAgitStart2]
int c = npc_event_doall("OnAgitStart2");
@@ -1914,6 +1989,9 @@
return 0;
}
+/*====================================================
+ * End woe2 and triggers all npc OnAgitEnd2
+ *---------------------------------------------------*/
int guild_agit2_end(void)
{ // Run All NPC_Event[OnAgitEnd2]
int c = npc_event_doall("OnAgitEnd2");
Index: src/map/intif.c
===================================================================
--- src/map/intif.c (revision 15963)
+++ src/map/intif.c (working copy)
@@ -46,11 +46,11 @@
-1,-1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator]
};
-extern int char_fd; // inter serverÌfdÍchar_fdðg€
-#define inter_fd char_fd // GCAX
+extern int char_fd; // inter server Fd used for char_fd
+#define inter_fd char_fd // alias
//-----------------------------------------------------------------
-// inter serverÖÌM
+// Send to inter server
int CheckForCharServer(void)
{
@@ -136,7 +136,7 @@
return 0;
}
-// GMbZ[WðM
+// GM Send a message
int intif_broadcast(const char* mes, int len, int type)
{
int lp = type ? 4 : 0;
@@ -386,7 +386,7 @@
return 0;
}
-// p[eBì¬v
+// Party creation request
int intif_create_party(struct party_member *member,char *name,int item,int item2)
{
if (CheckForCharServer())
@@ -403,7 +403,8 @@
WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
return 0;
}
-// p[eBîñv
+
+// Party information request
int intif_request_partyinfo(int party_id, int char_id)
{
if (CheckForCharServer())
@@ -415,7 +416,8 @@
WFIFOSET(inter_fd,10);
return 0;
}
-// p[eBÇÁv
+
+// Request to add a member to party
int intif_party_addmember(int party_id,struct party_member *member)
{
if (CheckForCharServer())
@@ -428,7 +430,8 @@
WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
return 1;
}
-// p[eBÝèÏX
+
+// Request to change party configuration (exp,item share)
int intif_party_changeoption(int party_id,int account_id,int exp,int item)
{
if (CheckForCharServer())
@@ -442,7 +445,8 @@
WFIFOSET(inter_fd,14);
return 0;
}
-// p[eBEÞv
+
+// Request to leave party
int intif_party_leave(int party_id,int account_id, int char_id)
{
if (CheckForCharServer())
@@ -455,7 +459,8 @@
WFIFOSET(inter_fd,14);
return 0;
}
-// p[eBÚ®v
+
+// Request keeping party for new map ??
int intif_party_changemap(struct map_session_data *sd,int online)
{
int m, mapindex;
@@ -481,7 +486,8 @@
WFIFOSET(inter_fd,19);
return 1;
}
-// p[eB[ðUv
+
+// Request breaking party
int intif_break_party(int party_id)
{
if (CheckForCharServer())
@@ -492,7 +498,8 @@
WFIFOSET(inter_fd,6);
return 0;
}
-// p[eBïbM
+
+// Sending party chat
int intif_party_message(int party_id,int account_id,const char *mes,int len)
{
if (CheckForCharServer())
@@ -511,6 +518,7 @@
return 0;
}
+// Request a new leader for party
int intif_party_leaderchange(int party_id,int account_id,int char_id)
{
if (CheckForCharServer())
@@ -524,8 +532,7 @@
return 0;
}
-
-// Mhì¬v
+// Request a Guild creation
int intif_guild_create(const char *name,const struct guild_member *master)
{
if (CheckForCharServer())
@@ -541,7 +548,8 @@
WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
return 0;
}
-// Mhîñv
+
+// Request Guild information
int intif_guild_request_info(int guild_id)
{
if (CheckForCharServer())
@@ -552,7 +560,8 @@
WFIFOSET(inter_fd,6);
return 0;
}
-// MhoÇÁv
+
+// Request to add member to the guild
int intif_guild_addmember(int guild_id,struct guild_member *m)
{
if (CheckForCharServer())
@@ -566,6 +575,7 @@
return 0;
}
+// Request a new leader for guild
int intif_guild_change_gm(int guild_id, const char* name, int len)
{
if (CheckForCharServer())
@@ -579,7 +589,7 @@
return 0;
}
-// MhoEÞ/Çúv
+// Request to leave guild
int intif_guild_leave(int guild_id,int account_id,int char_id,int flag,const char *mes)
{
if (CheckForCharServer())
@@ -594,7 +604,8 @@
WFIFOSET(inter_fd,55);
return 0;
}
-// MhoÌICóµ/LvXVv
+
+//Update request / Lv online status of the guild members
int intif_guild_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_)
{
if (CheckForCharServer())
@@ -610,7 +621,8 @@
WFIFOSET(inter_fd,19);
return 0;
}
-// MhðUÊm
+
+//Guild disbanded notification
int intif_guild_break(int guild_id)
{
if (CheckForCharServer())
@@ -621,7 +633,8 @@
WFIFOSET(inter_fd,6);
return 0;
}
-// MhïbM
+
+// Send a guild message
int intif_guild_message(int guild_id,int account_id,const char *mes,int len)
{
if (CheckForCharServer())
@@ -640,7 +653,8 @@
return 0;
}
-// Mhî{îñÏXv
+
+// Request a change of Guild basic information
int intif_guild_change_basicinfo(int guild_id,int type,const void *data,int len)
{
if (CheckForCharServer())
@@ -654,7 +668,8 @@
WFIFOSET(inter_fd,len+10);
return 0;
}
-// MhoîñÏXv
+
+// Request a change of Guild member information
int intif_guild_change_memberinfo(int guild_id,int account_id,int char_id,
int type,const void *data,int len)
{
@@ -671,7 +686,8 @@
WFIFOSET(inter_fd,len+18);
return 0;
}
-// MhðEÏXv
+
+// Request a change of Guild title
int intif_guild_position(int guild_id,int idx,struct guild_position *p)
{
if (CheckForCharServer())
@@ -685,7 +701,8 @@
WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
return 0;
}
-// MhXLAbvv
+
+// Request an update of Guildskill skillnum
int intif_guild_skillup(int guild_id, int skill_num, int account_id, int max)
{
if( CheckForCharServer() )
@@ -699,7 +716,8 @@
WFIFOSET(inter_fd, 18);
return 0;
}
-// Mh¯¿/GÎv
+
+// Request a new guild relationship
int intif_guild_alliance(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag)
{
if (CheckForCharServer())
@@ -714,7 +732,8 @@
WFIFOSET(inter_fd,19);
return 0;
}
-// MhmÏXv
+
+// Request to change guild notice
int intif_guild_notice(int guild_id,const char *mes1,const char *mes2)
{
if (CheckForCharServer())
@@ -727,7 +746,8 @@
WFIFOSET(inter_fd,186);
return 0;
}
-// MhGuÏXv
+
+// Request to change guild emblem
int intif_guild_emblem(int guild_id,int len,const char *data)
{
if (CheckForCharServer())
@@ -761,7 +781,8 @@
return 1;
}
-//MhéèÌMhÏXv
+
+// Request change castle guild owner and save data
int intif_guild_castle_datasave(int castle_id,int index, int value)
{
if (CheckForCharServer())
@@ -868,7 +889,7 @@
}
//Success to send whisper.
clif_wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56);
- intif_wis_replay(id,0); // M¬÷
+ intif_wis_replay(id,0); // succes
return 0;
}
@@ -925,7 +946,7 @@
return 0;
}
-// AJEgÏÊm
+// Request player registre
int intif_parse_Registers(int fd)
{
int j,p,len,max, flag;
@@ -1017,13 +1038,15 @@
storage_guild_storageopen(sd);
return 0;
}
+
+// ACK guild_storage saved
int intif_parse_SaveGuildStorage(int fd)
{
storage_guild_storagesaved(/*RFIFOL(fd,2), */RFIFOL(fd,6));
return 0;
}
-// p[eBì¬ÂÛ
+// ACK party creation
int intif_parse_PartyCreated(int fd)
{
if(battle_config.etc_log)
@@ -1031,7 +1054,8 @@
party_created(RFIFOL(fd,2), RFIFOL(fd,6),RFIFOB(fd,10),RFIFOL(fd,11), (char *)RFIFOP(fd,15));
return 0;
}
-// p[eBîñ
+
+// Receive party info
int intif_parse_PartyInfo(int fd)
{
if( RFIFOW(fd,2) == 12 ){
@@ -1045,7 +1069,8 @@
party_recv_info((struct party *)RFIFOP(fd,8), RFIFOL(fd,4));
return 0;
}
-// p[eBÇÁÊm
+
+// ACK adding party member
int intif_parse_PartyMemberAdded(int fd)
{
if(battle_config.etc_log)
@@ -1053,13 +1078,15 @@
party_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10), RFIFOB(fd, 14));
return 0;
}
-// p[eBÝèÏXÊm
+
+// ACK changing party option
int intif_parse_PartyOptionChanged(int fd)
{
party_optionchanged(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12),RFIFOB(fd,14));
return 0;
}
-// p[eBEÞÊm
+
+// ACK member leaving party
int intif_parse_PartyMemberWithdraw(int fd)
{
if(battle_config.etc_log)
@@ -1067,32 +1094,36 @@
party_member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
return 0;
}
-// p[eBðUÊm
+
+// ACK party break
int intif_parse_PartyBroken(int fd)
{
party_broken(RFIFOL(fd,2));
return 0;
}
-// p[eBÚ®Êm
+
+// ACK party on new map
int intif_parse_PartyMove(int fd)
{
party_recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17));
return 0;
}
-// p[eBbZ[W
+
+// ACK party messages
int intif_parse_PartyMessage(int fd)
{
party_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
return 0;
}
-// Mhì¬ÂÛ
+// ACK guild creation
int intif_parse_GuildCreated(int fd)
{
guild_created(RFIFOL(fd,2),RFIFOL(fd,6));
return 0;
}
-// Mhîñ
+
+// ACK guild infos
int intif_parse_GuildInfo(int fd)
{
if(RFIFOW(fd,2) == 8) {
@@ -1100,12 +1131,14 @@
guild_recv_noinfo(RFIFOL(fd,4));
return 0;
}
+
if( RFIFOW(fd,2)!=sizeof(struct guild)+4 )
ShowError("intif: guild info : data size error Gid: %d recv size: %d Expected size: %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4);
guild_recv_info((struct guild *)RFIFOP(fd,4));
return 0;
}
-// MhoÇÁÊm
+
+// ACK adding guild member
int intif_parse_GuildMemberAdded(int fd)
{
if(battle_config.etc_log)
@@ -1113,20 +1146,22 @@
guild_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
return 0;
}
-// MhoEÞ/ÇúÊm
+
+// ACK member leaving guild
int intif_parse_GuildMemberWithdraw(int fd)
{
guild_member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),(char *)RFIFOP(fd,55),(char *)RFIFOP(fd,15));
return 0;
}
-// MhoICóÔ/LvÏXÊm
+// ACK guild member basic info
int intif_parse_GuildMemberInfoShort(int fd)
{
guild_recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17));
return 0;
}
-// MhðUÊm
+
+// ACK guild break
int intif_parse_GuildBroken(int fd)
{
guild_broken(RFIFOL(fd,2),RFIFOB(fd,6));
@@ -1189,7 +1224,7 @@
return 0;
}
-// MhðEÏXÊm
+// ACK change of guild title
int intif_parse_GuildPosition(int fd)
{
if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 )
@@ -1197,54 +1232,61 @@
guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12));
return 0;
}
-// MhXLèUèÊm
+
+// ACK change of guild skill update
int intif_parse_GuildSkillUp(int fd)
{
guild_skillupack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
return 0;
}
-// Mh¯¿/GÎÊm
+
+// ACK change of guild relationship
int intif_parse_GuildAlliance(int fd)
{
guild_allianceack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),RFIFOB(fd,18),(char *) RFIFOP(fd,19),(char *) RFIFOP(fd,43));
return 0;
}
-// MhmÏXÊm
+
+// ACK change of guild notice
int intif_parse_GuildNotice(int fd)
{
guild_notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66));
return 0;
}
-// MhGuÏXÊm
+
+// ACK change of guild emblem
int intif_parse_GuildEmblem(int fd)
{
guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12));
return 0;
}
-// MhïbóM
+
+// ACK guild message
int intif_parse_GuildMessage(int fd)
{
guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
return 0;
}
-// Mhéf[^vÔM
+// Reply guild castle data request
int intif_parse_GuildCastleDataLoad(int fd)
{
return guild_castledataloadack(RFIFOW(fd,2), (struct guild_castle *)RFIFOP(fd,4));
}
+// ACK change of guildmaster
int intif_parse_GuildMasterChanged(int fd)
{
return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
}
-// pet
+// Request pet creation
int intif_parse_CreatePet(int fd)
{
pet_get_egg(RFIFOL(fd,2),RFIFOL(fd,7),RFIFOB(fd,6));
return 0;
}
+// ACK pet data
int intif_parse_RecvPetData(int fd)
{
struct s_pet p;
@@ -1261,6 +1303,8 @@
return 0;
}
+
+// ACK pet save data
int intif_parse_SavePetOk(int fd)
{
if(RFIFOB(fd,6) == 1)
@@ -1269,6 +1313,7 @@
return 0;
}
+// ACK deleting pet
int intif_parse_DeletePetOk(int fd)
{
if(RFIFOB(fd,2) == 1)
@@ -1277,6 +1322,7 @@
return 0;
}
+// ACK changing name resquest, players,pets,hommon
int intif_parse_ChangeNameOk(int fd)
{
struct map_session_data *sd = NULL;
@@ -2078,19 +2124,19 @@
}
//-----------------------------------------------------------------
-// inter server©çÌÊM
-// G[ª êÎ0(false)ðÔ·±Æ
-// pPbgªÅ«êÎ1,pPbg·ª«èȯêÎ2ðÔ·±Æ
+// Communication from the inter server
+// Return a 0 (false) if there were any errors.
+// 1, 2 if there are not enough to return the length of the packet if the packet processing
int intif_parse(int fd)
{
int packet_len, cmd;
cmd = RFIFOW(fd,0);
- // pPbgÌIDmF
+ // Verify ID of the packet
if(cmd<0x3800 || cmd>=0x3800+(sizeof(packet_len_table)/sizeof(packet_len_table[0])) ||
packet_len_table[cmd-0x3800]==0){
return 0;
}
- // pPbgÌ·³mF
+ // Check the length of the packet
packet_len = packet_len_table[cmd-0x3800];
if(packet_len==-1){
if(RFIFOREST(fd)<4)
@@ -2100,7 +2146,7 @@
if((int)RFIFOREST(fd)<packet_len){
return 2;
}
- // ªò
+ // Processing branch
switch(cmd){
case 0x3800:
if (RFIFOL(fd,4) == 0xFF000000) //Normal announce.
@@ -2182,7 +2228,7 @@
ShowError("intif_parse : unknown packet %d %x\n",fd,RFIFOW(fd,0));
return 0;
}
- // pPbgÇÝòε
+ // Skip packet
RFIFOSKIP(fd,packet_len);
return 1;
}
Index: src/map/intif.h
===================================================================
--- src/map/intif.h (revision 15963)
+++ src/map/intif.h (working copy)
@@ -98,6 +98,7 @@
int intif_Auction_cancel(int char_id, unsigned int auction_id);
int intif_Auction_close(int char_id, unsigned int auction_id);
int intif_Auction_bid(int char_id, const char* name, unsigned int auction_id, int bid);
+
// ELEMENTAL SYSTEM
int intif_elemental_create(struct s_elemental *ele);
int intif_elemental_request(int ele_id, int char_id);
Index: src/map/npc.c
===================================================================
--- src/map/npc.c (revision 15963)
+++ src/map/npc.c (working copy)
@@ -129,9 +129,9 @@
}
/*==========================================
- * NPC̳ø»/Lø»
+ * NPC
* npc_enable
- * npc_enable_sub LøÉOnTouchCxgðÀs
+ * npc_enable_sub On Touch
*------------------------------------------*/
int npc_enable_sub(struct block_list *bl, va_list ap)
{
@@ -161,7 +161,6 @@
int npc_enable(const char* name, int flag)
{
struct npc_data* nd = npc_name2id(name);
-
if (nd==NULL)
{
ShowError("npc_enable: Attempted to %s a non-existing NPC '%s' (flag=%d).\n", (flag&3) ? "show" : "hide", name, flag);
@@ -196,7 +195,7 @@
}
/*==========================================
- * NPCðŒOÅT·
+ * NPC lookup
*------------------------------------------*/
struct npc_data* npc_name2id(const char* name)
{
@@ -436,7 +435,8 @@
}
/*==========================================
- * ^C}[CxgpxÌæèÝ
+ *
+ * npc_parse_script->strdb_foreach
* called from npc_parse_script
*------------------------------------------*/
int npc_timerevent_export(struct npc_data *nd, int i)
@@ -1062,7 +1062,7 @@
}
/*==========================================
- * NPCÌI[v`bgŸ
+ * NPC I guess something like npctalk
*------------------------------------------*/
int npc_globalmessage(const char* name, const char* mes)
{
@@ -1104,7 +1104,7 @@
}
/*==========================================
- * NbNÌNPC
+ * NPC 1st call when clicking on npc
*------------------------------------------*/
int npc_click(struct map_session_data* sd, struct npc_data* nd)
{
Index: src/map/status.c
===================================================================
--- src/map/status.c (revision 15963)
+++ src/map/status.c (working copy)
@@ -62,7 +62,7 @@
int randombonus_max[MAX_REFINE]; // cumulative maximum random bonus damage
} refine_info[REFINE_TYPE_MAX];
-static int atkmods[3][MAX_WEAPON_TYPE]; // íATKTCYC³(size_fix.txt)
+static int atkmods[3][MAX_WEAPON_TYPE]; // ᅵᅵᅵᅵATKᅵTᅵCᅵYᅵCᅵᅵ(size_fix.txt)
static char job_bonus[CLASS_COUNT][MAX_LEVEL];
#ifdef RENEWAL
enum {
@@ -1106,9 +1106,9 @@
if (sc->data[SC_BERSERK] && status->hp <= 100)
status_change_end(target, SC_BERSERK, INVALID_TIMER);
if( sc->data[SC_RAISINGDRAGON] && status->hp <= 1000 )
- status_change_end(target, SC_RAISINGDRAGON, -1);
- if (sc->data[SC_SATURDAYNIGHTFEVER] && status->hp <= 100)
- status_change_end(target, SC_SATURDAYNIGHTFEVER, -1);
+ status_change_end(target, SC_RAISINGDRAGON, INVALID_TIMER);
+ if( sc->data[SC_SATURDAYNIGHTFEVER] && status->hp <= 100 )
+ status_change_end(target, SC_SATURDAYNIGHTFEVER, INVALID_TIMER);
}
switch (target->type)
@@ -1543,8 +1543,8 @@
}
}
-
- if (sc && sc->option)
+ // Check for src's status changes
+ if( sc && sc->option )
{
if (sc->option&OPTION_HIDE)
switch (skill_num) { //Usable skills while hiding.
@@ -1570,6 +1570,7 @@
tsc = status_get_sc(target);
+ // Check for target's status changes.
if(tsc && tsc->count) {
if( tsc->data[SC_INVINCIBLE] )
return 0;
@@ -2156,7 +2157,7 @@
b_weight = sd->weight;
b_max_weight = sd->max_weight;
- pc_calc_skilltree(sd); // XLc?ÌvZ
+ pc_calc_skilltree(sd); // ᅵXᅵLᅵᅵᅵcᅵᅵ?ᅵÌvᅵZ
sd->max_weight = max_weight_base[pc_class2idx(sd->status.class_)]+sd->status.str*300;
@@ -2239,13 +2240,13 @@
//Give them all modes except these (useful for clones)
status->mode = MD_MASK&~(MD_BOSS|MD_PLANT|MD_DETECTOR|MD_ANGRY|MD_TARGETWEAK);
- status->size = (sd->class_&JOBL_BABY)?0:1;
+ status->size = (sd->class_&JOBL_BABY)?SZ_SMALL:SZ_MEDIUM;
if (battle_config.character_size && pc_isriding(sd)) { //[Lupus]
if (sd->class_&JOBL_BABY) {
- if (battle_config.character_size&2)
+ if (battle_config.character_size&SZ_BIG)
status->size++;
} else
- if(battle_config.character_size&1)
+ if(battle_config.character_size&SZ_MEDIUM)
status->size++;
}
status->aspd_rate = 1000;
@@ -5127,8 +5128,8 @@
}
/*==========================================
- * ÎÛÌClassðÔ·(Äp)
- * ßèÍ®Å0Èã
+ * ᅵÎÛᅵClassᅵᅵÔᅵ(ᅵÄp)
+ * ᅵßᅵÍᅵᅵᅵᅵᅵ0ᅵÈᅵ
*------------------------------------------*/
int status_get_class(struct block_list *bl) {
nullpo_ret(bl);
@@ -5144,8 +5145,8 @@
return 0;
}
/*==========================================
- * ÎÛÌxðÔ·(Äp)
- * ßèÍ®Å0Èã
+ * ᅵÎÛÌᅵᅵxᅵᅵᅵᅵÔᅵ(ᅵÄp)
+ * ᅵßᅵÍᅵᅵᅵᅵᅵ0ᅵÈᅵ
*------------------------------------------*/
int status_get_lv(struct block_list *bl) {
nullpo_ret(bl);
@@ -6727,7 +6728,7 @@
status_zap(bl, diff, 0);
}
// fall through
- case SC_POISON: /* Å */
+ case SC_POISON: /* ᅵᅵ */
val3 = tick/1000; //Damage iterations
if(val3 < 1) val3 = 1;
tick_time = 1000; // [GodLesZ] tick time
@@ -6800,7 +6801,7 @@
else
val4 |= battle_config.monster_cloak_check_type&7;
break;
- case SC_SIGHT: /* TCg/At */
+ case SC_SIGHT: /* ᅵTᅵCᅵg/ᅵᅵᅵAᅵt */
case SC_RUWACH:
case SC_SIGHTBLASTER:
val3 = skill_get_splash(val2, val1); //Val2 should bring the skill-id.
@@ -7403,13 +7404,13 @@
val_flag |= 1|2|4;
break;
case SC_WHITEIMPRISON:
- status_change_end(bl, SC_BURNING, -1);
- status_change_end(bl, SC_FREEZING, -1);
- status_change_end(bl, SC_FREEZE, -1);
- status_change_end(bl, SC_STONE, -1);
+ status_change_end(bl, SC_BURNING, INVALID_TIMER);
+ status_change_end(bl, SC_FREEZING, INVALID_TIMER);
+ status_change_end(bl, SC_FREEZE, INVALID_TIMER);
+ status_change_end(bl, SC_STONE, INVALID_TIMER);
break;
case SC_FREEZING:
- status_change_end(bl, SC_BURNING, -1);
+ status_change_end(bl, SC_BURNING, INVALID_TIMER);
break;
case SC_READING_SB:
// val2 = sp reduction per second
@@ -7521,9 +7522,9 @@
val3 = 0;
break;
case SC_WARMER:
- status_change_end(bl, SC_FREEZE, -1);
- status_change_end(bl, SC_FREEZING, -1);
- status_change_end(bl, SC_CRYSTALIZE, -1);
+ status_change_end(bl, SC_FREEZE, INVALID_TIMER);
+ status_change_end(bl, SC_FREEZING, INVALID_TIMER);
+ status_change_end(bl, SC_CRYSTALIZE, INVALID_TIMER);
break;
case SC_STRIKING:
val4 = tick / 1000;
@@ -8146,7 +8147,7 @@
return 1;
}
/*==========================================
- * Xe[^XÙíSð
+ * ᅵXᅵeᅵ[ᅵ^ᅵXᅵÙᅵSᅵᅵᅵᅵ
* type:
* 0 - ???
* 1 - ???
@@ -8235,7 +8236,7 @@
}
/*==========================================
- * Xe[^XÙíI¹
+ * ᅵXᅵeᅵ[ᅵ^ᅵXᅵÙᅵIᅵᅵ
*------------------------------------------*/
int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line)
{
@@ -8624,7 +8625,7 @@
}
break;
case SC_ADORAMUS:
- status_change_end(bl, SC_BLIND, -1);
+ status_change_end(bl, SC_BLIND, INVALID_TIMER);
break;
case SC__SHADOWFORM: {
struct map_session_data *s_sd = map_id2sd(sce->val2);
@@ -8668,7 +8669,7 @@
int i;
i = min(sd->spiritball,5);
pc_delspiritball(sd, sd->spiritball, 0);
- status_change_end(bl, SC_EXPLOSIONSPIRITS, -1);
+ status_change_end(bl, SC_EXPLOSIONSPIRITS, INVALID_TIMER);
while( i > 0 ) {
pc_addspiritball(sd, skill_get_time(MO_CALLSPIRITS, pc_checkskill(sd,MO_CALLSPIRITS)), 5);
--i;
@@ -8901,7 +8902,7 @@
}
/*==========================================
- * Xe[^XÙíI¹^C}[
+ * ᅵXᅵeᅵ[ᅵ^ᅵXᅵÙᅵIᅵᅵᅵ^ᅵCᅵ}ᅵ[
*------------------------------------------*/
int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
{
@@ -9097,7 +9098,7 @@
}
break;
- case SC_DANCING: //_XXLÌÔSPÁï
+ case SC_DANCING: //ᅵ_ᅵᅵᅵXᅵXᅵLᅵᅵᅵÌᅵᅵᅵSPᅵᅵᅵᅵ
{
int s = 0;
int sp = 1;
@@ -9650,8 +9651,8 @@
{
struct block_list *s_bl = battle_get_master(bl);
if( s_bl )
- status_change_end(s_bl,type+1,-1);
- status_change_end(bl,type,-1);
+ status_change_end(s_bl,type+1, INVALID_TIMER);
+ status_change_end(bl,type, INVALID_TIMER);
break;
}
sc_timer_next(2000 + tick, status_change_timer, bl->id, data);
@@ -9687,7 +9688,7 @@
}
/*==========================================
- * Xe[^XÙí^C}[ÍÍ
+ * ᅵXᅵeᅵ[ᅵ^ᅵXᅵÙᅵ^ᅵCᅵ}ᅵ[ᅵÍÍᅵᅵᅵ
*------------------------------------------*/
int status_change_timer_sub(struct block_list* bl, va_list ap)
{
@@ -9704,7 +9705,7 @@
tsc = status_get_sc(bl);
switch( type ) {
- case SC_SIGHT: /* TCg */
+ case SC_SIGHT: /* ᅵTᅵCᅵg */
case SC_CONCENTRATE:
status_change_end(bl, SC_HIDING, INVALID_TIMER);
status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
@@ -9712,7 +9713,7 @@
status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER);
status_change_end(bl, SC__INVISIBILITY, INVALID_TIMER);
break;
- case SC_RUWACH: /* At */
+ case SC_RUWACH: /* ᅵᅵᅵAᅵt */
if (tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] ||
tsc->data[SC_CAMOUFLAGE] || tsc->data[SC_CLOAKINGEXCEED] ||
tsc->data[SC__INVISIBILITY])) {
@@ -9742,7 +9743,7 @@
break;
case SC_CURSEDCIRCLE_TARGET:
if( tsc && tsc->data[SC_CURSEDCIRCLE_TARGET] && tsc->data[SC_CURSEDCIRCLE_TARGET]->val2 == src->id ) {
- status_change_end(bl, type, -1);
+ status_change_end(bl, type, INVALID_TIMER);
}
break;
}
@@ -10326,7 +10327,7 @@
}
/*==========================================
- * XLÖWú»
+ * ᅵXᅵLᅵᅵᅵÖWᅵᅵᅵᅵᅵᅵ
*------------------------------------------*/
int do_init_status(void)
{
Index: src/map/trade.c
===================================================================
--- src/map/trade.c (revision 15963)
+++ src/map/trade.c (working copy)
@@ -500,7 +500,7 @@
}
/*==========================================
- * æøø(tradeµ)
+ * Trading license (press trade)
*------------------------------------------*/
void trade_tradecommit(struct map_session_data *sd)
{
Index: src/map/pc.c
===================================================================
--- src/map/pc.c (revision 15963)
+++ src/map/pc.c (working copy)
@@ -47,7 +47,7 @@
#include <time.h>
-#define PVP_CALCRANK_INTERVAL 1000 // PVPÊvZÌÔu
+#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];
@@ -277,6 +277,7 @@
return 0;
}
+
int pc_banding(struct map_session_data *sd, short skill_lv) {
int c;
int b_sd[MAX_PARTY]; // In case of a full Royal Guard party.
@@ -558,7 +559,7 @@
}
/*==========================================
- * Ú?bÌú?
+ * 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)
{
@@ -832,10 +833,15 @@
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;
- //?¶â{qÌê̳ÌEÆðZo·é
nullpo_ret(sd);
@@ -865,8 +871,7 @@
return 0;
}
- if (sd->sc.count) {
-
+ if (sd->sc.count) {
if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON]) // Also works with left-hand weapons [DracoRPG]
return 0;
if(item->equip & EQP_SHIELD && item->type == IT_ARMOR && sd->sc.data[SC_STRIPSHIELD])
@@ -910,8 +915,8 @@
}
/*==========================================
- * session idÉâè³µ
- * charI©ççêÄ«œXe?^XðÝè
+ * 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)
{
@@ -1025,7 +1030,7 @@
for( i = 0; i < 3; i++ )
sd->hate_mob[i] = -1;
- // ÊuÌÝè
+ //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);
@@ -1195,6 +1200,7 @@
sd->status.skill[sd->reproduceskill_id].flag = SKILL_FLAG_PLAGIARIZED;
}
}
+
//Weird... maybe registries were reloaded?
if (sd->state.active)
return 0;
@@ -1265,7 +1271,7 @@
/*==========================================
- * ?ŠçêéXLÌvZ
+ * Calculation of Skills lvls
*------------------------------------------*/
int pc_calc_skilltree(struct map_session_data *sd)
{
@@ -1282,22 +1288,20 @@
}
c = pc_class2idx(c);
- for( i = 0; i < MAX_SKILL; i++ )
- {
- if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED ) //Don't touch plagiarized skills
+ for (i = 0; i < MAX_SKILL; i++) {
+ if (sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) //Don't touch plagiarized skills
sd->status.skill[i].id = 0; //First clear skills.
}
- for( i = 0; i < MAX_SKILL; i++ )
- {
- if( sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED )
- { // Restore original level of skills after deleting earned skills.
+ for (i = 0; i < MAX_SKILL; i++) {
+ if (sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) {
+ // Restore original level of skills after deleting earned skills.
sd->status.skill[i].lv = (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY) ? 0 : sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
sd->status.skill[i].flag = SKILL_FLAG_PERMANENT;
}
- if( sd->sc.count && sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_BARDDANCER && i >= DC_HUMMING && i<= DC_SERVICEFORYOU )
- { //Enable Bard/Dancer spirit linked skills.
+ if (sd->sc.count && sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_BARDDANCER && i >= DC_HUMMING && i<= DC_SERVICEFORYOU) {
+ //Enable Bard/Dancer spirit linked skills.
if( sd->status.sex )
{ //Link dancer skills to bard.
if( sd->status.skill[i-8].lv < 10 )
@@ -1448,6 +1452,7 @@
if(battle_config.skillfree)
return; //Function serves no purpose if this is set
+ nullpo_retv(sd);
i = pc_calc_skilltree_normalize_job(sd);
c = pc_mapid2jobid(i, sd->status.sex);
@@ -2008,7 +2013,7 @@
}
/*==========================================
- * ? õiÉæé\ÍÌ{?iXÝè
+ * ? ᅵᅵᅵiᅵÉᅵᅵ\ᅵÍᅵᅵÌ{?ᅵiᅵXᅵÝᅵ
*------------------------------------------*/
int pc_bonus(struct map_session_data *sd,int type,int val)
{
@@ -2594,7 +2599,7 @@
}
/*==========================================
- * ? õiÉæé\ÍÌ{?iXÝè
+ * ? ᅵᅵᅵiᅵÉᅵᅵ\ᅵÍᅵᅵÌ{?ᅵiᅵXᅵÝᅵ
*------------------------------------------*/
int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
{
@@ -3327,7 +3332,7 @@
return 1;
}
/*==========================================
- * J?h?ü
+ * Append a cart to an item ?
*------------------------------------------*/
int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
{
@@ -3382,18 +3387,18 @@
}
//
-// ACeš
+// Items
//
/*==========================================
- * XLÉæé¢lC³
+ * Correction 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) // fBXJEg
+ 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) // RpVfBXJEg
+ if((skill=pc_checkskill(sd,RG_COMPULSION))>0) // rogue discount
rate2 = 5+skill*4;
if(rate1 < rate2) rate1 = rate2;
if(rate1)
@@ -3405,12 +3410,12 @@
}
/*==========================================
- * XLÉæé?èlC³
+ * Correction 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) // I?o?`?W
+ 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.);
@@ -3421,8 +3426,8 @@
}
/*==========================================
- * ACeðÁœbÉAVµ¢ACeðg€©A
- * 3§ÀÉ©©é©mF
+ * Checking if we have enough place on inventory for new item
+ * Make sure to take 30,000 limit
*------------------------------------------*/
int pc_checkadditem(struct map_session_data *sd,int nameid,int amount)
{
@@ -3449,7 +3454,8 @@
}
/*==========================================
- * ó«ACeÌÂ?
+ * Return number of available place in inventory
+ * Each non stackable item will reduce place by 1
*------------------------------------------*/
int pc_inventoryblank(struct map_session_data *sd)
{
@@ -3544,9 +3550,8 @@
ShowWarning("pc_getcash: Cash point overflow (cash=%d, have cash=%d, account_id=%d, char_id=%d).\n", cash, sd->cashPoints, sd->status.account_id, sd->status.char_id);
cash = MAX_ZENY-sd->cashPoints;
}
+ pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints + cash);
- pc_setaccountreg(sd, "#CASHPOINTS", sd->cashPoints+cash);
-
if( battle_config.cashshop_show_points )
{
sprintf(output, msg_txt(505), cash, sd->cashPoints);
@@ -3609,7 +3614,7 @@
}
/*==========================================
- * ACeðTµÄACfbNXðÔ·
+ * Searching a specified itemid in inventory and return his stored index
*------------------------------------------*/
int pc_search_inventory(struct map_session_data *sd,int item_id)
{
@@ -3621,7 +3626,14 @@
}
/*==========================================
- * ACeÇÁBÂ?ÌÝitem\¢?Ì?ð³
+ * Attempt tp add a new item in inventory
+ * return
+ 0 = success
+ 1 = invalid itemid not found or negative amount
+ 2 = overweight
+ 4 = no free place found
+ 5 = max amount reached
+
*------------------------------------------*/
int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type)
{
@@ -3692,7 +3704,10 @@
}
/*==========================================
- * ACeðžç·
+ * 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)
{
@@ -3720,7 +3735,10 @@
}
/*==========================================
- * ACeð·
+ * Attempt to drop an item
+ * return
+ * 0 = fail
+ * 1 = success
*------------------------------------------*/
int pc_dropitem(struct map_session_data *sd,int n,int amount)
{
@@ -3761,7 +3779,10 @@
}
/*==========================================
- * ACeðE€
+ * Attempt to pickup an item
+ * return
+ * 0 = fail
+ * 1 = success
*------------------------------------------*/
int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
{
@@ -3774,7 +3795,7 @@
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);
@@ -3828,6 +3849,12 @@
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;
@@ -3846,7 +3873,7 @@
if( !item->script ) //if it has no script, you can't really consume it!
return 0;
- switch( nameid )
+ switch( nameid ) //lot of harcoded nameid here, need to be removed [Lighta]
{
case 605: // Anodyne
if( map_flag_gvg(sd->bl.m) )
@@ -3983,7 +4010,10 @@
}
/*==========================================
- * ACeðg€
+ * Last checks et use item
+ * return
+ * 0 = fail
+ * 1 = success
*------------------------------------------*/
int pc_useitem(struct map_session_data *sd,int n)
{
@@ -4005,6 +4035,7 @@
)
return 0;
+ //Check if status forbid us
if( sd->sc.count && (
sd->sc.data[SC_BERSERK] ||
(sd->sc.data[SC_GRAVITATION] && sd->sc.data[SC_GRAVITATION]->val3 == BCT_SELF) ||
@@ -4099,7 +4130,10 @@
}
/*==========================================
- * J?gACeÇÁBÂ?ÌÝ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)
{
@@ -4159,7 +4193,10 @@
}
/*==========================================
- * J?gACeðžç·
+ * 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)
{
@@ -4186,7 +4223,10 @@
}
/*==========================================
- * J?gÖACeÚ®
+ * Transfert item from inventory to cart
+ * return
+ * 0 = fail
+ * 1 = succes
*------------------------------------------*/
int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
{
@@ -4209,7 +4249,10 @@
}
/*==========================================
- * J?g?ÌACe?mF(Â?Ì·ªðÔ·)
+ * 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)
{
@@ -4225,7 +4268,10 @@
}
/*==========================================
- * J?g©çACeÚ®
+ * 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)
{
@@ -4249,7 +4295,7 @@
}
/*==========================================
- * XeBiöJ
+ * Display item stolen msg to player sd
*------------------------------------------*/
int pc_show_steal(struct block_list *bl,va_list ap)
{
@@ -4271,7 +4317,10 @@
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)
{
@@ -4352,7 +4401,10 @@
}
/*==========================================
- *
+ * Stole zeny from bl (mob)
+ * return
+ * 0 = fail
+ * 1 = success
*------------------------------------------*/
int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
{
@@ -4373,7 +4425,7 @@
rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2;
if(rnd()%1000 < rate)
{
- int amount = md->level*10 + rand()%100;
+ int amount = md->level*10 + rnd()%100;
log_zeny(sd, LOG_TYPE_STEAL, sd, amount);
pc_getzeny(sd, amount);
@@ -4541,7 +4593,11 @@
}
/*==========================================
- * PCÌ_?v
+ * 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)
{
@@ -4552,7 +4608,7 @@
m=sd->bl.m;
- if (map[sd->bl.m].flag.noteleport) // e|?gÖ~
+ if (map[sd->bl.m].flag.noteleport) // ᅵeᅵᅵᅵ|?ᅵgᅵÖ~
return 0;
do{
@@ -4616,14 +4672,16 @@
}
//
-// í??
-//
+// Skills
+//
/*==========================================
- * XLÌ?õ LµÄ¢œêLvªÔé
+ * Return player sd skilllv learned for given skill
*------------------------------------------*/
int pc_checkskill(struct map_session_data *sd,int skill_id)
{
- if(sd == NULL) return 0;
+ if( sd == NULL )
+ return 0;
+
if( skill_id >= GD_SKILLBASE && skill_id < GD_MAX )
{
struct guild *g;
@@ -4645,13 +4703,8 @@
}
/*==========================================
- * í?XÉæéXLÌ??`FbN
- * ø?F
- * struct map_session_data *sd ZbVf?^
- * int nameid ?õiID
- * ÔèlF
- * 0 ?Xȵ
- * -1 XLðð
+ * Checking if player match condition for given skill and kill status if not
+ * Status probably require for thoses skills (unsure)
*------------------------------------------*/
int pc_checkallowskill(struct map_session_data *sd)
{
@@ -4697,7 +4750,8 @@
}
/*==========================================
- * ? õiÌ`FbN
+ * Return equiped itemid? on player sd at pos
+ * if -1 mean nothing equiped
*------------------------------------------*/
int pc_checkequip(struct map_session_data *sd,int pos)
{
@@ -5367,7 +5421,7 @@
{
int bonus = 0;
struct status_data *status = status_get_status_data(src);
-
+ nullpo_retv(sd);
if (sd->expaddrace[status->race])
bonus += sd->expaddrace[status->race];
bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS];
@@ -5389,7 +5443,7 @@
return;
}
/*==========================================
- * ??læŸ
+ * 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)
{
@@ -5482,8 +5536,10 @@
};
/*==========================================
- * base level€Kv??lvZ
+ * 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);
@@ -5494,6 +5550,7 @@
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)
@@ -5504,8 +5561,13 @@
/*==========================================
- * job level€Kv??lvZ
+ * 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);
@@ -5515,6 +5577,7 @@
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)
@@ -5684,7 +5747,8 @@
}
/*==========================================
- * XL|CgèUè
+ * Update skilllv for player sd
+ * Skill point allocation
*------------------------------------------*/
int pc_skillup(struct map_session_data *sd,int skill_num)
{
@@ -5746,6 +5810,7 @@
}
}
+ //pc_calc_skilltree takes care of setting the ID to valid skills. [Skotlex]
if (pc_has_permission(sd, PC_PERM_ALL_SKILL))
{ //Get ALL skills except npc/guild ones. [Skotlex]
//and except SG_DEVIL [Komurka] and MO_TRIPLEATTACK and RG_SNATCHER [ultramage]
@@ -6173,6 +6238,9 @@
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;
@@ -6495,10 +6563,11 @@
if(battle_config.pc_invincible_time > 0)
pc_setinvincibletimer(sd, battle_config.pc_invincible_time);
}
-// script? A
//
+// script
+//
/*==========================================
- * scriptpPCXe?^X?Ýoµ
+ * script reading pc status registry
*------------------------------------------*/
int pc_readparam(struct map_session_data* sd,int type)
{
@@ -6544,7 +6613,7 @@
}
/*==========================================
- * scriptpPCXe?^XÝè
+ * script set pc status registry
*------------------------------------------*/
int pc_setparam(struct map_session_data *sd,int type,int val)
{
@@ -6712,7 +6781,9 @@
}
/*==========================================
- * 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)
{
@@ -6770,7 +6841,8 @@
}
/*==========================================
- * 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)
{
@@ -6808,9 +6880,7 @@
}
/*==========================================
- * E?X
- * ø? job EÆ 0`23
- * upper Êí 0, ?¶ 1, {q 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)
@@ -6901,7 +6971,7 @@
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); // ?õOµ
+ pc_unequipitem(sd,sd->equip_index[i],2); // ?ᅵᅵᅵOᅵᅵ
}
//Change look, if disguised, you need to undisguise
@@ -6967,7 +7037,7 @@
}
/*==========================================
- * ©œÚ?X
+ * Tell client player sd has change equipement
*------------------------------------------*/
int pc_equiplookall(struct map_session_data *sd)
{
@@ -6984,7 +7054,7 @@
}
/*==========================================
- * ©œÚ?X
+ * Tell client player sd has change look (hair,equip...)
*------------------------------------------*/
int pc_changelook(struct map_session_data *sd,int type,int val)
{
@@ -7044,7 +7114,7 @@
}
/*==========================================
- * t?i(é,yR,J?g)Ýè
+ * Give an option (type) to player (sd) and display it to client
*------------------------------------------*/
int pc_setoption(struct map_session_data *sd,int type)
{
@@ -7107,20 +7177,20 @@
if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) {
if( type&OPTION_MADOGEAR && !(p_type&OPTION_MADOGEAR) ) {
status_calc_pc(sd, 0);
- status_change_end(&sd->bl,SC_MAXIMIZEPOWER,-1);
- status_change_end(&sd->bl,SC_OVERTHRUST,-1);
- status_change_end(&sd->bl,SC_WEAPONPERFECTION,-1);
- status_change_end(&sd->bl,SC_ADRENALINE,-1);
- status_change_end(&sd->bl,SC_CARTBOOST,-1);
- status_change_end(&sd->bl,SC_MELTDOWN,-1);
- status_change_end(&sd->bl,SC_MAXOVERTHRUST,-1);
+ status_change_end(&sd->bl,SC_MAXIMIZEPOWER,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_OVERTHRUST,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_WEAPONPERFECTION,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_ADRENALINE,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_CARTBOOST,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_MELTDOWN,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_MAXOVERTHRUST,INVALID_TIMER);
} else if( !(type&OPTION_MADOGEAR) && p_type&OPTION_MADOGEAR ) {
status_calc_pc(sd, 0);
- status_change_end(&sd->bl,SC_SHAPESHIFT,-1);
- status_change_end(&sd->bl,SC_HOVERING,-1);
- status_change_end(&sd->bl,SC_ACCELERATION,-1);
- status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,-1);
- status_change_end(&sd->bl,SC_OVERHEAT,-1);
+ status_change_end(&sd->bl,SC_SHAPESHIFT,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_HOVERING,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_ACCELERATION,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,INVALID_TIMER);
+ status_change_end(&sd->bl,SC_OVERHEAT,INVALID_TIMER);
}
}
@@ -7162,7 +7232,7 @@
}
/*==========================================
- * J?gÝè
+ * Give player a cart
*------------------------------------------*/
int pc_setcart(struct map_session_data *sd,int type)
{
@@ -7187,12 +7257,12 @@
}
/*==========================================
- * éÝè
+ * Give player a falcon
*------------------------------------------*/
int pc_setfalcon(TBL_PC* sd, int flag)
{
if( flag ){
- if( pc_checkskill(sd,HT_FALCON)>0 ) // t@R}X^?XL
+ 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
@@ -7202,12 +7272,12 @@
}
/*==========================================
- * yRyRÝè
+ * Give player a wug (wolf)
*------------------------------------------*/
int pc_setriding(TBL_PC* sd, int flag)
{
if( flag ){
- if( pc_checkskill(sd,KN_RIDING) > 0 ) // CfBOXL
+ 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);
@@ -7217,7 +7287,7 @@
}
/*==========================================
- * ACehbvÂs»è
+ * Check if player can drop an item
*------------------------------------------*/
int pc_candrop(struct map_session_data *sd, struct item *item)
{
@@ -7229,7 +7299,8 @@
}
/*==========================================
- * scriptp??Ìlð?Þ
+ * Read ram register for player sd
+ * get val (int) from reg for player sd
*------------------------------------------*/
int pc_readreg(struct map_session_data* sd, int reg)
{
@@ -7241,7 +7312,8 @@
return ( i < sd->reg_num ) ? sd->reg[i].data : 0;
}
/*==========================================
- * scriptp??ÌlðÝè
+ * 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)
{
@@ -7269,7 +7341,8 @@
}
/*==========================================
- * scriptp¶ñ??Ìlð?Þ
+ * Read ram register for player sd
+ * get val (str) from reg for player sd
*------------------------------------------*/
char* pc_readregstr(struct map_session_data* sd, int reg)
{
@@ -7281,7 +7354,8 @@
return ( i < sd->regstr_num ) ? sd->regstr[i].data : NULL;
}
/*==========================================
- * scriptp¶ñ??ÌlðÝè
+ * 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)
{
@@ -7561,7 +7635,7 @@
}
/*==========================================
- * Cxg^C}??
+ * Exec eventtimer for player sd (retrieved from map_session (id))
*------------------------------------------*/
static int pc_eventtimer(int tid, unsigned int tick, int id, intptr_t data)
{
@@ -7586,7 +7660,7 @@
}
/*==========================================
- * Cxg^C}?ÇÁ
+ * Add eventtimer for player sd ?
*------------------------------------------*/
int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name)
{
@@ -7604,7 +7678,7 @@
}
/*==========================================
- * Cxg^C}?í
+ * Del eventtimer for player sd ?
*------------------------------------------*/
int pc_deleventtimer(struct map_session_data *sd,const char *name)
{
@@ -7634,7 +7708,7 @@
}
/*==========================================
- * Cxg^C}?JEglÇÁ
+ * Update eventtimer count for player sd
*------------------------------------------*/
int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick)
{
@@ -7653,7 +7727,7 @@
}
/*==========================================
- * Cxg^C}?Sí
+ * Remove all eventtimer for player sd
*------------------------------------------*/
int pc_cleareventtimer(struct map_session_data *sd)
{
@@ -7676,10 +7750,10 @@
}
//
-// ? õš
+// Equipment
//
/*==========================================
- * ACeð?õ·é
+ * 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)
{
@@ -7862,7 +7936,7 @@
}
/*==========================================
- * ? õµœšðO·
+ * Called when attemting to unequip an item from player
* type:
* 0 - only unequip
* 1 - calculate status after unequipping
@@ -7991,8 +8065,8 @@
}
/*==========================================
- * ACeÌindexÔ?ðlßœè
- * ? õiÌ?õÂ\`FbNðsÈ€
+ * 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)
{
@@ -8072,7 +8146,7 @@
}
/*==========================================
- * PVPÊvZp(foreachinarea)
+ * Update PVP rank for sd1 to sd2
*------------------------------------------*/
int pc_calc_pvprank_sub(struct block_list *bl,va_list ap)
{
@@ -8091,7 +8165,8 @@
return 0;
}
/*==========================================
- * PVPÊvZ
+ * Calculate new rank beetween all present players (map_foreachinarea)
+ * and display result
*------------------------------------------*/
int pc_calc_pvprank(struct map_session_data *sd)
{
@@ -8106,7 +8181,7 @@
return sd->pvp_rank;
}
/*==========================================
- * PVPÊvZ(timer)
+ * Calculate next sd ranking calculation from config
*------------------------------------------*/
int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr_t data)
{
@@ -8128,7 +8203,10 @@
}
/*==========================================
- * sdÍ¥µÄ¢é©(?¥ÌêÍûÌchar_idðÔ·)
+ * Checking if sd is married
+ * Return
+ * partner_id = yes,
+ * 0 = no
*------------------------------------------*/
int pc_ismarried(struct map_session_data *sd)
{
@@ -8140,7 +8218,10 @@
return 0;
}
/*==========================================
- * sdªdstsdÆ¥(dstsdšsdÌ¥?à¯bÉs€)
+ * Marry player sd to player dstsd
+ * return
+ * -1 = fail
+ * 0 = success
*------------------------------------------*/
int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd)
{
@@ -8155,6 +8236,9 @@
/*==========================================
* Divorce sd from its partner
+ * return
+ * -1 = fail
+ * 0 = success
*------------------------------------------*/
int pc_divorce(struct map_session_data *sd)
{
@@ -8193,7 +8277,7 @@
}
/*==========================================
- * sdÌûÌmap_session_dataðÔ·
+ * Get sd partner charid. (Married partner)
*------------------------------------------*/
struct map_session_data *pc_get_partner(struct map_session_data *sd)
{
@@ -8204,6 +8288,9 @@
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)
@@ -8213,6 +8300,9 @@
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)
@@ -8222,6 +8312,9 @@
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)
@@ -8231,6 +8324,9 @@
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;
@@ -8292,7 +8388,7 @@
}
/*==========================================
- * Z?u|CgÌÛ¶
+ * Memo player sd savepoint. (map,x,y)
*------------------------------------------*/
int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
{
@@ -8306,7 +8402,7 @@
}
/*==========================================
- * ©®Z?u (timer??)
+ * Save 1 player data at autosave intervalle
*------------------------------------------*/
int pc_autosave(int tid, unsigned int tick, int id, intptr_t data)
{
@@ -8423,7 +8519,7 @@
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
@@ -8596,7 +8692,7 @@
FILE *fp;
char line[24000],*p;
- // Kv??l?Ý?Ý
+ //reset
memset(exp_table,0,sizeof(exp_table));
memset(max_level,0,sizeof(max_level));
@@ -8681,12 +8777,12 @@
}
ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","exp.txt");
- // XLc?
+ // ᅵXᅵLᅵᅵᅵcᅵᅵ?
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);
- // ?«C³e?u
+ // ?ᅵᅵᅵCᅵᅵᅵe?ᅵuᅵᅵ
for(i=0;i<4;i++)
for(j=0;j<ELE_MAX;j++)
for(k=0;k<ELE_MAX;k++)
@@ -8738,7 +8834,7 @@
fclose(fp);
ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","attr_fix.txt");
- // XLc?
+ // reset statspoint
memset(statp,0,sizeof(statp));
i=1;
@@ -8869,7 +8965,7 @@
return;
}
/*==========================================
- * pc? Wú»
+ * pc Init/Terminate
*------------------------------------------*/
void do_final_pc(void) {
Index: src/map/map.c
===================================================================
--- src/map/map.c (revision 15963)
+++ src/map/map.c (working copy)
@@ -93,7 +93,7 @@
char *MSG_CONF_NAME;
char *GRF_PATH_FILENAME;
-// ÉÍ staticÅ?JÉ?ßé
+// ᅵÉᅵ staticᅵÅᅵ?ᅵJᅵᅵᅵᅵ?ᅵßᅵ
static DBMap* id_db=NULL; // int id -> struct block_list*
static DBMap* pc_db=NULL; // int id -> struct map_session_data*
static DBMap* mobid_db=NULL; // int id -> struct mob_data*
@@ -183,12 +183,12 @@
}
//
-// blockíÌÀS«mÛ?
+// blockᅵíᅵÌᅵᅵSᅵᅵᅵmᅵᅵ?ᅵᅵ
//
/*==========================================
- * blockðfree·éÆ«freeÌ?íèÉÄÔ
- * bN³êĢ鯫Íobt@Éœßé
+ * blockᅵᅵfreeᅵᅵᅵᅵÆï¿œfreeᅵᅵ?ᅵᅵᅵÉÄᅵ
+ * ᅵᅵᅵbᅵNᅵᅵᅵᅵÄᅵᅵᅵÆï¿œï¿œÍoᅵbᅵtᅵ@ᅵÉᅵᅵßᅵ
*------------------------------------------*/
int map_freeblock (struct block_list *bl)
{
@@ -205,7 +205,7 @@
return block_free_lock;
}
/*==========================================
- * blockÌfreeðêsIÉÖ~·é
+ * blockᅵᅵfreeᅵᅵᅵᅵsIᅵÉÖ~ᅵᅵᅵᅵ
*------------------------------------------*/
int map_freeblock_lock (void)
{
@@ -213,9 +213,9 @@
}
/*==========================================
- * blockÌfreeÌbNðð·é
- * ±ÌÆ«AbNª®SÉÈÈéÆ
- * obt@ÉœÜÁÄ¢œblockðSí
+ * blockᅵᅵfreeᅵÌᅵᅵbᅵNᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ
+ * ï¿œï¿œï¿œÌÆï¿œï¿œAᅵᅵᅵbᅵNᅵᅵᅵᅵᅵSᅵÉÈᅵᅵÈᅵᅵ
+ * ᅵoᅵbᅵtᅵ@ᅵÉᅵᅵÜᅵᅵÄᅵᅵᅵblockᅵᅵSᅵᅵᅵí
*------------------------------------------*/
int map_freeblock_unlock (void)
{
@@ -235,10 +235,10 @@
return block_free_lock;
}
-// map_freeblock_lock() ðÄñÅ map_freeblock_unlock() ðÄÎÈ¢
-// Öª ÁœÌÅAèúIÉblock_free_lockðZbg·éæ€É·éB
-// ±ÌÖÍAdo_timer() Ìgbvx©çÄÎêéÌÅA
-// block_free_lock ðŒÚ¢¶ÁÄàx᳢͞B
+// map_freeblock_lock() ᅵᅵᅵÄᅵᅵ map_freeblock_unlock() ᅵᅵᅵÄÎÈᅵ
+// ᅵÖᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵÌÅAᅵᅵᅵIᅵᅵblock_free_lockᅵᅵᅵᅵᅵZᅵbᅵgᅵᅵᅵᅵæ€ï¿œÉᅵᅵᅵB
+// ᅵᅵᅵÌÖᅵᅵÍAdo_timer() ᅵÌgᅵbᅵvᅵᅵᅵxᅵᅵᅵᅵᅵᅵÄÎᅵᅵÌÅA
+// block_free_lock ᅵðŒÚᅵᅵᅵᅵᅵᅵÄᅵᅵxᅵá³ï¿œï¿œï¿œÍᅵᅵB
int map_freeblock_timer(int tid, unsigned int tick, int id, intptr_t data)
{
@@ -252,11 +252,11 @@
}
//
-// block»?
+// blockᅵᅵ?ᅵᅵ
//
/*==========================================
- * map[]Ìblock_list©ç?ªÁÄ¢éêÉ
- * bl->prevÉbl_headÌAhXðüêÄš
+ * map[]ᅵᅵblock_listᅵᅵᅵᅵ?ᅵᅵᅵᅵᅵÄᅵᅵᅵêᅵᅵ
+ * bl->prevᅵᅵbl_headᅵÌAᅵhᅵᅵᅵXᅵᅵᅵᅵÄᅵᅵᅵ
*------------------------------------------*/
static struct block_list bl_head;
@@ -339,10 +339,10 @@
int pos;
nullpo_ret(bl);
- // ?Éblocklist©ç?¯Ä¢é
+ // ?ᅵᅵblocklistᅵᅵᅵᅵ?ᅵᅵᅵÄᅵᅵᅵ
if (bl->prev == NULL) {
if (bl->next != NULL) {
- // prevªNULLÅnextªNULLÅÈ¢ÌÍLÁÄÍÈçÈ¢
+ // prevᅵᅵNULLᅵᅵnextᅵᅵNULLᅵÅÈᅵᅵÌÍLᅵᅵᅵÄÍÈᅵÈᅵ
ShowError("map_delblock error : bl->next!=NULL\n");
}
return 0;
@@ -357,7 +357,7 @@
if (bl->next)
bl->next->prev = bl->prev;
if (bl->prev == &bl_head) {
- // Xg̪ÈÌÅAmap[]Ìblock_listðXV·é
+ // ᅵᅵᅵXᅵgᅵÌᅵᅵÈÌÅAmap[]ᅵᅵblock_listᅵᅵᅵXᅵVᅵᅵᅵᅵ
if (bl->type == BL_MOB) {
map[bl->m].block_mob[pos] = bl->next;
} else {
@@ -402,7 +402,7 @@
status_change_end(bl, SC_MAGICROD, INVALID_TIMER);
if (sc->data[SC_PROPERTYWALK] &&
sc->data[SC_PROPERTYWALK]->val3 >= skill_get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) )
- status_change_end(bl,SC_PROPERTYWALK,-1);
+ status_change_end(bl,SC_PROPERTYWALK, INVALID_TIMER);
} else
if (bl->type == BL_NPC)
npc_unsetcells((TBL_NPC*)bl);
@@ -589,10 +589,10 @@
if(bl_list_count>=BL_LIST_MAX)
ShowWarning("map_foreachinrange: block count too many!\n");
- map_freeblock_lock(); // ©çÌðúðÖ~·é
+ map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵÌᅵᅵᅵᅵÖ~ᅵᅵᅵᅵ
for(i=blockcount;i<bl_list_count;i++)
- if(bl_list[i]->prev) // L?©Ç€©`FbN
+ if(bl_list[i]->prev) // ᅵL?ᅵᅵᅵÇᅵᅵᅵᅵ`ᅵFᅵbᅵN
{
va_list ap;
va_start(ap, type);
@@ -600,7 +600,7 @@
va_end(ap);
}
- map_freeblock_unlock(); // ðúð·é
+ map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵÂᅵᅵᅵ
bl_list_count = blockcount;
return returnCount; //[Skotlex]
@@ -661,10 +661,10 @@
if(bl_list_count>=BL_LIST_MAX)
ShowWarning("map_foreachinrange: block count too many!\n");
- map_freeblock_lock(); // ©çÌðúðÖ~·é
+ map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵÌᅵᅵᅵᅵÖ~ᅵᅵᅵᅵ
for(i=blockcount;i<bl_list_count;i++)
- if(bl_list[i]->prev) // L?©Ç€©`FbN
+ if(bl_list[i]->prev) // ᅵL?ᅵᅵᅵÇᅵᅵᅵᅵ`ᅵFᅵbᅵN
{
va_list ap;
va_start(ap, type);
@@ -672,16 +672,16 @@
va_end(ap);
}
- map_freeblock_unlock(); // ðúð·é
+ map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵÂᅵᅵᅵ
bl_list_count = blockcount;
return returnCount; //[Skotlex]
}
/*==========================================
- * map m (x0,y0)-(x1,y1)?ÌSobjÉ?µÄ
- * funcðÄÔ
- * type!=0 Èç»ÌíÞÌÝ
+ * map m (x0,y0)-(x1,y1)?ᅵÌSobjᅵᅵ?ᅵᅵᅵᅵ
+ * funcᅵᅵᅵÄᅵ
+ * type!=0 ᅵÈç»ï¿œÌᅵÞÌᅵ
*------------------------------------------*/
int map_foreachinarea(int (*func)(struct block_list*,va_list), int m, int x0, int y0, int x1, int y1, int type, ...)
{
@@ -726,10 +726,10 @@
if(bl_list_count>=BL_LIST_MAX)
ShowWarning("map_foreachinarea: block count too many!\n");
- map_freeblock_lock(); // ©çÌðúðÖ~·é
+ map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵÌᅵᅵᅵᅵÖ~ᅵᅵᅵᅵ
for(i=blockcount;i<bl_list_count;i++)
- if(bl_list[i]->prev) // L?©Ç€©`FbN
+ if(bl_list[i]->prev) // ᅵL?ᅵᅵᅵÇᅵᅵᅵᅵ`ᅵFᅵbᅵN
{
va_list ap;
va_start(ap, type);
@@ -737,7 +737,7 @@
va_end(ap);
}
- map_freeblock_unlock(); // ðúð·é
+ map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵÂᅵᅵᅵ
bl_list_count = blockcount;
return returnCount; //[Skotlex]
@@ -792,10 +792,10 @@
if(bl_list_count>=BL_LIST_MAX)
ShowWarning("map_forcountinrange: block count too many!\n");
- map_freeblock_lock(); // ©çÌðúðÖ~·é
+ map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵÌᅵᅵᅵᅵÖ~ᅵᅵᅵᅵ
for(i=blockcount;i<bl_list_count;i++)
- if(bl_list[i]->prev) // L?©Ç€©`FbN
+ if(bl_list[i]->prev) // ᅵL?ᅵᅵᅵÇᅵᅵᅵᅵ`ᅵFᅵbᅵN
{
va_list ap;
va_start(ap, type);
@@ -805,7 +805,7 @@
break;
}
- map_freeblock_unlock(); // ðúð·é
+ map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵÂᅵᅵᅵ
bl_list_count = blockcount;
return returnCount; //[Skotlex]
@@ -853,10 +853,10 @@
if(bl_list_count>=BL_LIST_MAX)
ShowWarning("map_foreachinarea: block count too many!\n");
- map_freeblock_lock(); // ©çÌðúðÖ~·é
+ map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵÌᅵᅵᅵᅵÖ~ᅵᅵᅵᅵ
for(i=blockcount;i<bl_list_count;i++)
- if(bl_list[i]->prev) // L?©Ç€©`FbN
+ if(bl_list[i]->prev) // ᅵL?ᅵᅵᅵÇᅵᅵᅵᅵ`ᅵFᅵbᅵN
{
va_list ap;
va_start(ap, type);
@@ -866,18 +866,18 @@
break;
}
- map_freeblock_unlock(); // ðúð·é
+ map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵÂᅵᅵᅵ
bl_list_count = blockcount;
return returnCount; //[Skotlex]
}
/*==========================================
- * é`(x0,y0)-(x1,y1)ª(dx,dy)Ú®µœb?
- * ÌæOÉÈéÌæ(é`©L`)?ÌobjÉ
- * ?µÄfuncðÄÔ
+ * ᅵᅵ`(x0,y0)-(x1,y1)ᅵᅵ(dx,dy)ᅵÚᅵᅵᅵᅵᅵᅵb?
+ * ᅵÌᅵOᅵÉÈᅵÌᅵ(ᅵᅵ`ᅵᅵLᅵᅵᅵ`)?ᅵᅵobjᅵᅵ
+ * ?ᅵᅵᅵᅵfuncᅵᅵᅵÄᅵ
*
- * dx,dyÍ-1,0,1ÌÝÆ·éiÇñÈlÅࢢÁÛ¢Hj
+ * dx,dyᅵᅵ-1,0,1ᅵÌÝÆï¿œï¿œï¿œiᅵÇᅵÈlᅵÅᅵᅵᅵᅵᅵᅵᅵᅵÛᅵᅵHᅵj
*------------------------------------------*/
int map_foreachinmovearea(int (*func)(struct block_list*,va_list), struct block_list* center, int range, int dx, int dy, int type, ...)
{
@@ -991,7 +991,7 @@
if(bl_list_count>=BL_LIST_MAX)
ShowWarning("map_foreachinmovearea: block count too many!\n");
- map_freeblock_lock(); // ©çÌðúðÖ~·é
+ map_freeblock_lock(); // Prohibit the release from memory
for(i=blockcount;i<bl_list_count;i++)
if(bl_list[i]->prev)
@@ -1002,7 +1002,7 @@
va_end(ap);
}
- map_freeblock_unlock(); // ðúð·é
+ map_freeblock_unlock(); // Allow Free
bl_list_count = blockcount;
return returnCount;
@@ -1037,10 +1037,10 @@
if(bl_list_count>=BL_LIST_MAX)
ShowWarning("map_foreachincell: block count too many!\n");
- map_freeblock_lock(); // ©çÌðúðÖ~·é
+ map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵÌᅵᅵᅵᅵÖ~ᅵᅵᅵᅵ
for(i=blockcount;i<bl_list_count;i++)
- if(bl_list[i]->prev) // L?©Ç€©`FbN
+ if(bl_list[i]->prev) // ᅵL?ᅵᅵᅵÇᅵᅵᅵᅵ`ᅵFᅵbᅵN
{
va_list ap;
va_start(ap, type);
@@ -1048,7 +1048,7 @@
va_end(ap);
}
- map_freeblock_unlock(); // ðúð·é
+ map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵÂᅵᅵᅵ
bl_list_count = blockcount;
return returnCount;
@@ -1274,10 +1274,10 @@
if(bl_list_count>=BL_LIST_MAX)
ShowWarning("map_foreachinmap: block count too many!\n");
- map_freeblock_lock(); // ©çÌðúðÖ~·é
+ map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵÌᅵᅵᅵᅵÖ~ᅵᅵᅵᅵ
for(i=blockcount;i<bl_list_count;i++)
- if(bl_list[i]->prev) // L?©Ç€©`FbN
+ if(bl_list[i]->prev) // ᅵL?ᅵᅵᅵÇᅵᅵᅵᅵ`ᅵFᅵbᅵN
{
va_list ap;
va_start(ap, type);
@@ -1285,7 +1285,7 @@
va_end(ap);
}
- map_freeblock_unlock(); // ðúð·é
+ map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵÂᅵᅵᅵ
bl_list_count = blockcount;
return returnCount;
@@ -1326,12 +1326,12 @@
}
/*==========================================
- * °ACeðÁ·
+ * ᅵᅵᅵAᅵCᅵeᅵᅵᅵᅵᅵᅵᅵᅵ
*
- * data==0ÌbÍtimerÅÁŠœê * data!=0ÌbÍE€ÅÁŠœbƵĮ?
+ * data==0ᅵÌbᅵtimerᅵÅᅵᅵᅵᅵᅵᅵᅵ * data!=0ᅵÌbÍEᅵᅵᅵᅵᅵÅᅵᅵᅵᅵᅵᅵbÆï¿œï¿œÄᅵ??
*
- * ãÒÍAmap_clearflooritem(id)Ö
- * map.h?Å#defineµÄ é
+ * ᅵᅵÒÍAmap_clearflooritem(id)ᅵᅵ
+ * map.h?ᅵᅵ#defineᅵᅵᅵÄᅵᅵᅵ
*------------------------------------------*/
int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr_t data)
{
@@ -1471,10 +1471,13 @@
}
/*==========================================
- * (m,x,y)ðSÉ3x3È?ɰACeÝu
- *
- * item_dataÍamountÈOðcopy·é
- * type flag: &1 MVP item. &2 do stacking check.
+ * Rajoute un item sur la map au location (m,x,y)
+ * Parametres
+ * @item_data attribut de l'item
+ * @amount quantité
+ * @m, @x, @y index de la map et coordonnée en x,y
+ * @first_charid, @second_charid, @third_charid, champ pour les priorité de ramassage
+ * @flag: &1 MVP item. &2 do stacking check.
*------------------------------------------*/
int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,int first_charid,int second_charid,int third_charid,int flags)
{
@@ -1610,7 +1613,7 @@
}
/*==========================================
- * id_dbÖblðÇÁ
+ * id_dbᅵᅵblᅵᅵÇᅵ
*------------------------------------------*/
void map_addiddb(struct block_list *bl)
{
@@ -1638,7 +1641,7 @@
}
/*==========================================
- * id_db©çblðí
+ * id_dbᅵᅵᅵᅵblᅵᅵᅵí
*------------------------------------------*/
void map_deliddb(struct block_list *bl)
{
@@ -1774,7 +1777,7 @@
}
/*==========================================
- * idÔ?ÌPCðT·BȯêÎNULL
+ * idᅵᅵ?ᅵᅵPCᅵᅵTᅵᅵᅵBᅵᅵᅵÈᅵᅵᅵᅵNULL
*------------------------------------------*/
struct map_session_data * map_id2sd(int id)
{
@@ -1892,8 +1895,8 @@
}
/*==========================================
- * idÔ?ÌšðT·
- * êObjectÌêÍzñðøÌÝ
+ * idᅵᅵ?ᅵÌᅵᅵᅵTᅵᅵ
+ * ᅵᅵObjectᅵÌêᅵÍzᅵᅵᅵᅵᅵÌᅵ
*------------------------------------------*/
struct block_list * map_id2bl(int id)
{
@@ -2190,7 +2193,7 @@
}
/*==========================================
- * map.npcÖÇÁ (warpÌÌæ¿ÌÝ)
+ * map.npcᅵÖÇᅵ (warpᅵᅵᅵÌÌæï¿œï¿œï¿œÌᅵ)
*------------------------------------------*/
bool map_addnpc(int m,struct npc_data *nd)
{
@@ -2313,7 +2316,7 @@
}
/*==========================================
- * mapŒ©çmapÔ?Ö?·
+ * mapᅵᅵᅵᅵᅵᅵmapᅵᅵ?ᅵᅵ?ᅵᅵ
*------------------------------------------*/
int map_mapname2mapid(const char* name)
{
@@ -2341,7 +2344,7 @@
}
/*==========================================
- * ŒImapŒ©çip,port?·
+ * ᅵᅵᅵImapᅵᅵᅵᅵᅵᅵip,port?ᅵᅵ
*------------------------------------------*/
int map_mapname2ipport(unsigned short name, uint32* ip, uint16* port)
{
@@ -2453,7 +2456,7 @@
return 0;
}
-// gatn
+// gatᅵn
inline static struct mapcell map_gat2cell(int gat)
{
struct mapcell cell = {0};
@@ -2486,7 +2489,7 @@
}
/*==========================================
- * (m,x,y)ÌóÔð²×é
+ * Confirme si le type de cell en (m,x,y) est celui passer en parametre
*------------------------------------------*/
int map_getcell(int m,int x,int y,cell_chk cellchk)
{
@@ -2740,7 +2743,7 @@
}
/*==========================================
- * ŒIÇÌ}bvðdbÉÇÁ
+ * ᅵᅵᅵIᅵÇᅵᅵÌ}ᅵbᅵvᅵᅵdbᅵÉÇᅵ
*------------------------------------------*/
int map_setipport(unsigned short mapindex, uint32 ip, uint16 port)
{
@@ -2761,7 +2764,7 @@
}
/**
- * ŒIÇÌ}bvðSÄí
+ * ᅵᅵᅵIᅵÇᅵᅵÌ}ᅵbᅵvᅵᅵSᅵÄí
* @see DBApply
*/
int map_eraseallipport_sub(DBKey key, DBData *data, va_list va)
@@ -2781,7 +2784,7 @@
}
/*==========================================
- * ŒIÇÌ}bvðdb©çí
+ * ᅵᅵᅵIᅵÇᅵᅵÌ}ᅵbᅵvᅵᅵdbᅵᅵᅵᅵí
*------------------------------------------*/
int map_eraseipport(unsigned short mapindex, uint32 ip, uint16 port)
{
@@ -3224,7 +3227,7 @@
}
/*==========================================
- * Ýèt@Cð?Ý?Þ
+ * ᅵÝᅵtᅵ@ᅵCᅵᅵᅵᅵ?ᅵᅵ?ᅵᅵ
*------------------------------------------*/
int map_config_read(char *cfgName)
{
@@ -3561,7 +3564,7 @@
}
/*==========================================
- * mapII¹E
+ * mapᅵIᅵIᅵᅵᅵEᅵᅵ
*------------------------------------------*/
void do_final(void)
{
@@ -3938,7 +3941,7 @@
do_init_duel();
do_init_elemental();
- npc_event_do_oninit(); // npcÌOnInitCxg?s
+ npc_event_do_oninit(); // npcᅵᅵOnInitᅵCᅵxᅵᅵᅵg?ᅵs
if( console )
{
Index: src/map/map.h
===================================================================
--- src/map/map.h (revision 15963)
+++ src/map/map.h (working copy)
@@ -608,7 +608,7 @@
extern char wisp_server_name[];
-// ISÌîñ
+// users
void map_setusers(int);
int map_getusers(void);
int map_usercount(void);
Index: src/map/pet.c
===================================================================
--- src/map/pet.c (revision 15963)
+++ src/map/pet.c (working copy)
@@ -1031,7 +1031,7 @@
memset(pd->loot->item,0,pd->loot->max * sizeof(struct item));
pd->loot->count = 0;
pd->loot->weight = 0;
- pd->ud.canact_tick = gettick()+10000; // 10*1000msÌÔEíÈ¢
+ pd->ud.canact_tick = gettick()+10000; // Not picked up during the 10*1000ms
if (dlist->item)
add_timer(gettick()+540,pet_delay_item_drop,0,(intptr_t)dlist);
@@ -1195,7 +1195,7 @@
}
/*==========================================
- *ybgf[^ÇÝÝ
+ *Pet read db data
*------------------------------------------*/
int read_petdb()
{
@@ -1343,7 +1343,7 @@
}
/*==========================================
- * XLÖWú»
+ * Initialization process relationship skills
*------------------------------------------*/
int do_init_pet(void)
{
Index: src/map/path.c
===================================================================
--- src/map/path.c (revision 15963)
+++ src/map/path.c (working copy)
@@ -45,7 +45,7 @@
/*==========================================
* heap update (helper function)
- * costªžÁœÌŪÌûÖÚ®
+ * move toward the root Because cost has decreased
*------------------------------------------*/
static void update_heap_path(int *heap,struct tmp_path *tp,int index)
{
@@ -147,8 +147,7 @@
/*==========================================
* Find the closest reachable cell, 'count' cells away from (x0,y0) in direction (dx,dy).
- *
- * «òεœ ÆÌÀWðŸ
+ * Income after the coordinates of the blow
*------------------------------------------*/
int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
{
@@ -343,7 +342,7 @@
tp[i].flag=0;
heap[0]=0;
push_heap_path(heap,tp,calc_index(x0,y0));
- xs = md->xs-1; // ç©¶ßPžZµÄš
+ xs = md->xs-1; // Place by subtracting a pre-
ys = md->ys-1;
for(;;)
@@ -361,10 +360,10 @@
if(x==x1 && y==y1)
break;
- // dc[0] : y++ ÌÌRXgª
- // dc[1] : x-- ÌÌRXgª
- // dc[2] : y-- ÌÌRXgª
- // dc[3] : x++ ÌÌRXgª
+ // dc[0] : y++ //Incremental cost at the time
+ // dc[1] : x--
+ // dc[2] : y--
+ // dc[3] : x++
if(y < ys && !map_getcellp(md,x ,y+1,cell)) {
f |= 1; dc[0] = (y >= y1 ? 20 : 0);
Index: athena-start
===================================================================
--- athena-start (revision 15963)
+++ athena-start (working copy)
@@ -50,6 +50,16 @@
echo "Now Started Athena."
;;
+ 'start2')
+ print_start
+ check_files
+
+ exec ./${L_SRV}&
+ exec ./${C_SRV}&
+ # exec ./${M_SRV}&
+
+ echo "Now Started Athena."
+;;
'stop')
ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill
;;