* Added 'map_charid2id'
* Changed monster damage logging to save char ID's * Implemented 'event_script_type' * Set Emsolute Develop as a learnable skill * Updated 'require_glory_guild' * Allow monsters to cast skills near themselves even when monster_nofootset is set to 'yes' * Print number of online users in online.txt/.html even if there's only 1 user git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1282 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
26c7bf53aa
commit
37851efb84
@ -1,5 +1,22 @@
|
|||||||
Date Added
|
Date Added
|
||||||
|
|
||||||
|
03/24
|
||||||
|
* Added 'map_charid2id' [celest]
|
||||||
|
* Changed monster damage logging to save char ID's for the most time -- also
|
||||||
|
fixes an exp bug, thanks to Super Novice / Ezhik [celest]
|
||||||
|
* Implemented 'event_script_type' -- no changes at '0', at '1' script events
|
||||||
|
will work according to Qamera's original mod
|
||||||
|
For more info please refer to his thread:
|
||||||
|
http://www.eathena.deltaanime.net/board/index.php?showtopic=13305&hl=
|
||||||
|
* Set Emsolute Develop as a learnable skill [celest]
|
||||||
|
* Updated 'require_glory_guild' [celest]
|
||||||
|
- the skill is only acquirable if this is set to 'yes', otherwise it will not
|
||||||
|
appear in the guild skill tree. Default is changed to 'no'.
|
||||||
|
* Allow monsters to cast skills near themselves even when monster_nofootset
|
||||||
|
is set to 'yes' -- they're only not allowed to cast near players [celest]
|
||||||
|
* Print number of online users in online.txt/.html even if there's only 1 user
|
||||||
|
online [celest]
|
||||||
|
|
||||||
03/23
|
03/23
|
||||||
* Adjusted my trade fix [1280: MouseJstr]
|
* Adjusted my trade fix [1280: MouseJstr]
|
||||||
* Fixed possible memory corruption in storage if number of guilds
|
* Fixed possible memory corruption in storage if number of guilds
|
||||||
|
|||||||
@ -494,12 +494,12 @@ player_skill_reiteration: no
|
|||||||
//Whether or not, ground skills of the monsters' will pile up. (Note 1)
|
//Whether or not, ground skills of the monsters' will pile up. (Note 1)
|
||||||
monster_skill_reiteration: no
|
monster_skill_reiteration: no
|
||||||
|
|
||||||
// Whether or not players can cast ground based skills of a certain type such as traps
|
// Whether players are not allowed to cast ground based skills of a certain type such
|
||||||
// straight onto other players/monsters. (Note 1)
|
// as traps straight onto or nearby other players/monsters. (Note 1)
|
||||||
player_skill_nofootset: yes
|
player_skill_nofootset: yes
|
||||||
|
|
||||||
// Whether or not monsters can cast ground based skills of a certain type such as traps
|
// Whether monsters are not allowed to cast ground based skills of a certain type such
|
||||||
// straight onto players. (Note 1)
|
// as traps straight onto or nearby other players. (Note 1)
|
||||||
monster_skill_nofootset: yes
|
monster_skill_nofootset: yes
|
||||||
|
|
||||||
// When a player is cloaking, Whether the wall is checked or not. (Note 1)
|
// When a player is cloaking, Whether the wall is checked or not. (Note 1)
|
||||||
@ -817,9 +817,11 @@ finding_ore_rate: 100
|
|||||||
//2 - eAthena's, using damage given / total damage as damage ratio
|
//2 - eAthena's, using damage given / total damage as damage ratio
|
||||||
exp_calc_type: 1
|
exp_calc_type: 1
|
||||||
|
|
||||||
// Does changing emblems require the guild skill "Glory of Guild"? (Note 1)
|
// Can the 'Glory of Guild' skill be learnt in the Guild window,
|
||||||
// Note: This new guild skill only appears for 2004-10-25aSakexe or newer
|
// and does changing emblems require it? (Note 1)
|
||||||
require_glory_guild: yes
|
// P.S: This new guild skill only appears for 2004-10-25aSakexe or newer
|
||||||
|
// P.S 2: This skill is not implemented on official servers, so its only optional
|
||||||
|
require_glory_guild: no
|
||||||
|
|
||||||
import: conf/import/battle_conf.txt
|
import: conf/import/battle_conf.txt
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,10 @@ Other Ppl
|
|||||||
Date Added
|
Date Added
|
||||||
======
|
======
|
||||||
|
|
||||||
|
03/24
|
||||||
|
* Added support for Emsolute Develop in the guild manager script [celest]
|
||||||
|
* Fixed the custom jobchanger allowing Super Novices to change to high novice,
|
||||||
|
thanks to CavaCava
|
||||||
03/23
|
03/23
|
||||||
* WOE 1.3 Now you can't install Guardians during WOE [Lupus]
|
* WOE 1.3 Now you can't install Guardians during WOE [Lupus]
|
||||||
* Set only Storage/Cancel to Kafra in Niflheim. [Lupus]
|
* Set only Storage/Cancel to Kafra in Niflheim. [Lupus]
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
//= jAthena - kalen (1.0)
|
//= jAthena - kalen (1.0)
|
||||||
//= 1.1 by Akaru, ho|yAnge|X, and Valaris
|
//= 1.1 by Akaru, ho|yAnge|X, and Valaris
|
||||||
//===== Current Version: =====================================
|
//===== Current Version: =====================================
|
||||||
//= 1.3
|
//= 1.31
|
||||||
//===== Compatible With: =====================================
|
//===== Compatible With: =====================================
|
||||||
//= eAthena 0.1+; RO Episode 4+
|
//= eAthena 0.1+; RO Episode 4+
|
||||||
//===== Description: =========================================
|
//===== Description: =========================================
|
||||||
@ -19,6 +19,7 @@
|
|||||||
//= arg(3): y1 coordinate for warp to treasure room
|
//= arg(3): y1 coordinate for warp to treasure room
|
||||||
//= arg(4): guild script suffix for kafra, gaurdian scripts etc.
|
//= arg(4): guild script suffix for kafra, gaurdian scripts etc.
|
||||||
//===== Additional Comments: =================================
|
//===== Additional Comments: =================================
|
||||||
|
//= v1.31: Added support for Emsolute Develop [celest]
|
||||||
//= v1.2: All Guild manager scripts use this function. Optimized
|
//= v1.2: All Guild manager scripts use this function. Optimized
|
||||||
//= Comerce and Defense investment. [kobra_k88]
|
//= Comerce and Defense investment. [kobra_k88]
|
||||||
//= v1.2a Function now returns to script that called it.
|
//= v1.2a Function now returns to script that called it.
|
||||||
@ -116,6 +117,8 @@ L_Start:
|
|||||||
set Zeny,Zeny-@eco_invest;
|
set Zeny,Zeny-@eco_invest;
|
||||||
SetCastleData getarg(1)+".gat",4,@TriggerE+1;
|
SetCastleData getarg(1)+".gat",4,@TriggerE+1;
|
||||||
SetCastleData getarg(1)+".gat",2,@Economy+1;
|
SetCastleData getarg(1)+".gat",2,@Economy+1;
|
||||||
|
// if we learnt Emsolute Develop there's a chance to get +1 investment again
|
||||||
|
if (getgdskilllv(@GID,10014) > 0) && rand(100)>50) set @Economy, @Economy + 1;
|
||||||
mes "[ "+getarg(0)+" ]";
|
mes "[ "+getarg(0)+" ]";
|
||||||
mes "You have invested successfully.";
|
mes "You have invested successfully.";
|
||||||
return 0;
|
return 0;
|
||||||
@ -172,6 +175,8 @@ L_Start:
|
|||||||
SetCastleData getarg(1)+".gat",3,@Defence+1;
|
SetCastleData getarg(1)+".gat",3,@Defence+1;
|
||||||
// set new hp values for guardians
|
// set new hp values for guardians
|
||||||
set @Defence, @Defence + 1;
|
set @Defence, @Defence + 1;
|
||||||
|
// if we learnt Emsolute Develop there's a chance to get +1 investment again
|
||||||
|
if (getgdskilllv(@GID,10014) > 0) && rand(100)>50) set @Defence, @Defence + 1;
|
||||||
set @AGuardian, 28634 + (@Defence*2000);
|
set @AGuardian, 28634 + (@Defence*2000);
|
||||||
set @KGuardian, 30214 + (@Defence*2000);
|
set @KGuardian, 30214 + (@Defence*2000);
|
||||||
set @SGuardian, 15670 + (@Defence*2000);
|
set @SGuardian, 15670 + (@Defence*2000);
|
||||||
|
|||||||
@ -22,7 +22,7 @@ mes "Sup? I'm the insanely cool and uber cute jobchanger thingy for eAthena! Fir
|
|||||||
next;
|
next;
|
||||||
menu "First Class",LFirstClass,"Second Class (2-1)",LSecondClass,"Alternate Second Class (2-2)",LSecondClass2,"Novice High",LNovice2,"Advance First Class",Llevelcheck,"Advance Second Class",Llevelcheck,"Super Novice",LSuperNovice;
|
menu "First Class",LFirstClass,"Second Class (2-1)",LSecondClass,"Alternate Second Class (2-2)",LSecondClass2,"Novice High",LNovice2,"Advance First Class",Llevelcheck,"Advance Second Class",Llevelcheck,"Super Novice",LSuperNovice;
|
||||||
LNovice2:
|
LNovice2:
|
||||||
if ((readparam(11) >= 99) && (readparam(55) >= 50) || (readparam(19) > 20)) goto Lchange;
|
if ((readparam(11) >= 99) && (readparam(55) >= 50) || ((readparam(19) > 20) && (readparam(19) != 23)) goto Lchange;
|
||||||
mes "[ ^0065DFJobra^000000 ]";
|
mes "[ ^0065DFJobra^000000 ]";
|
||||||
mes "Ummmm, excuse me... o.O...";
|
mes "Ummmm, excuse me... o.O...";
|
||||||
mes "Hey! You don't MEET the class requirements...";
|
mes "Hey! You don't MEET the class requirements...";
|
||||||
|
|||||||
@ -26,8 +26,28 @@
|
|||||||
// 7) Modify this script to your liking and give your players a surprise
|
// 7) Modify this script to your liking and give your players a surprise
|
||||||
// 8) Remember: IT RUNS LIKE A NORMAL NPC. BUT THE ONLY WAY TO 'CLICK' IT IS BY
|
// 8) Remember: IT RUNS LIKE A NORMAL NPC. BUT THE ONLY WAY TO 'CLICK' IT IS BY
|
||||||
// LOGGING ON
|
// LOGGING ON
|
||||||
|
// 9) There are 2 ways to use this - check the examples below!
|
||||||
|
|
||||||
|
//
|
||||||
|
// The 1st type -- with 'event_script_type' set to 0
|
||||||
|
//
|
||||||
prontera.gat,0,0,0 script PCLoginEvent -1,{
|
prontera.gat,0,0,0 script PCLoginEvent -1,{
|
||||||
end;
|
end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// The 2nd type -- with 'event_script_type' set to 1
|
||||||
|
//
|
||||||
|
prontera.gat,155,175,0 script An NPC 46,{
|
||||||
|
close;
|
||||||
|
PCLoginEvent:
|
||||||
|
// this part will run
|
||||||
|
close;
|
||||||
|
}
|
||||||
|
|
||||||
|
prontera.gat,156,176,0 script Another NPC 46,{
|
||||||
|
close;
|
||||||
|
PCLoginEvent:
|
||||||
|
// this part runs AS WELL
|
||||||
|
close;
|
||||||
|
}
|
||||||
@ -1345,8 +1345,9 @@ void create_online_files(void) {
|
|||||||
if (players == 0) {
|
if (players == 0) {
|
||||||
fprintf(fp2, " <p>No user is online.</p>\n");
|
fprintf(fp2, " <p>No user is online.</p>\n");
|
||||||
fprintf(fp, "No user is online.\n");
|
fprintf(fp, "No user is online.\n");
|
||||||
// no display if only 1 player
|
|
||||||
} else if (players == 1) {
|
} else if (players == 1) {
|
||||||
|
fprintf(fp2, " <p>%d user is online.</p>\n", players);
|
||||||
|
fprintf(fp, "%d user is online.\n", players);
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp2, " <p>%d users are online.</p>\n", players);
|
fprintf(fp2, " <p>%d users are online.</p>\n", players);
|
||||||
fprintf(fp, "%d users are online.\n", players);
|
fprintf(fp, "%d users are online.\n", players);
|
||||||
|
|||||||
@ -4415,7 +4415,7 @@ void battle_set_defaults() {
|
|||||||
battle_config.area_size = 14;
|
battle_config.area_size = 14;
|
||||||
battle_config.exp_calc_type = 1;
|
battle_config.exp_calc_type = 1;
|
||||||
battle_config.min_skill_delay_limit = 100;
|
battle_config.min_skill_delay_limit = 100;
|
||||||
battle_config.require_glory_guild = 1;
|
battle_config.require_glory_guild = 0;
|
||||||
|
|
||||||
//SQL-only options start
|
//SQL-only options start
|
||||||
#ifndef TXT_ONLY
|
#ifndef TXT_ONLY
|
||||||
|
|||||||
@ -6704,14 +6704,18 @@ int clif_guild_skillinfo(struct map_session_data *sd)
|
|||||||
case GD_KAFRACONTACT:
|
case GD_KAFRACONTACT:
|
||||||
case GD_GUARDIANRESEARCH:
|
case GD_GUARDIANRESEARCH:
|
||||||
case GD_GUARDUP:
|
case GD_GUARDUP:
|
||||||
|
case GD_DEVELOPMENT:
|
||||||
up = guild_checkskill(g,GD_APPROVAL) > 0;
|
up = guild_checkskill(g,GD_APPROVAL) > 0;
|
||||||
break;
|
break;
|
||||||
case GD_LEADERSHIP:
|
case GD_LEADERSHIP:
|
||||||
//Glory skill requirements -- Pretty sure correct [Sara]
|
//Glory skill requirements -- Pretty sure correct [Sara]
|
||||||
up = guild_checkskill(g,GD_GLORYGUILD) > 0;
|
up = (battle_config.require_glory_guild) ?
|
||||||
|
guild_checkskill(g,GD_GLORYGUILD) > 0 : 1;
|
||||||
|
// what skill does it need now that glory guild was removed? [celest]
|
||||||
break;
|
break;
|
||||||
case GD_GLORYWOUNDS:
|
case GD_GLORYWOUNDS:
|
||||||
up = guild_checkskill(g,GD_GLORYGUILD) > 0;
|
up = (battle_config.require_glory_guild) ?
|
||||||
|
guild_checkskill(g,GD_GLORYGUILD) > 0 : 1;
|
||||||
break;
|
break;
|
||||||
case GD_SOULCOLD:
|
case GD_SOULCOLD:
|
||||||
up = guild_checkskill(g,GD_GLORYWOUNDS) > 0;
|
up = guild_checkskill(g,GD_GLORYWOUNDS) > 0;
|
||||||
@ -6734,8 +6738,8 @@ int clif_guild_skillinfo(struct map_session_data *sd)
|
|||||||
up = guild_checkskill(g,GD_GUARDIANRESEARCH) > 0 &&
|
up = guild_checkskill(g,GD_GUARDIANRESEARCH) > 0 &&
|
||||||
guild_checkskill(g,GD_REGENERATION) > 0;
|
guild_checkskill(g,GD_REGENERATION) > 0;
|
||||||
break;
|
break;
|
||||||
case GD_DEVELOPMENT:
|
case GD_GLORYGUILD:
|
||||||
up = 0;
|
up = (battle_config.require_glory_guild) ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
up = 1;
|
up = 1;
|
||||||
|
|||||||
@ -1446,12 +1446,18 @@ int map_quit(struct map_session_data *sd) {
|
|||||||
|
|
||||||
if(!sd->state.waitingdisconnect) {
|
if(!sd->state.waitingdisconnect) {
|
||||||
if (sd->state.event_disconnect) {
|
if (sd->state.event_disconnect) {
|
||||||
|
if (script_config.event_script_type == 0) {
|
||||||
struct npc_data *npc;
|
struct npc_data *npc;
|
||||||
if ((npc = npc_name2id(script_config.logout_event_name))) {
|
if ((npc = npc_name2id(script_config.logout_event_name))) {
|
||||||
run_script(npc->u.scr.script,0,sd->bl.id,npc->bl.id); // PCLogoutNPC
|
run_script(npc->u.scr.script,0,sd->bl.id,npc->bl.id); // PCLogoutNPC
|
||||||
sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.logout_event_name);
|
sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.logout_event_name);
|
||||||
ShowStatus(tmp_output);
|
ShowStatus(tmp_output);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
sprintf (tmp_output, "%d '"CL_WHITE"%s"CL_RESET"' events executed.\n",
|
||||||
|
npc_event_doall_id(script_config.logout_event_name, sd->bl.id), script_config.logout_event_name);
|
||||||
|
ShowStatus(tmp_output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sd->chatID) // ƒ`ƒƒƒbƒg‚©‚ç<E2809A>o‚é
|
if(sd->chatID) // ƒ`ƒƒƒbƒg‚©‚ç<E2809A>o‚é
|
||||||
@ -1601,6 +1607,18 @@ char * map_charid2nick(int id) {
|
|||||||
return p->nick;
|
return p->nick;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct map_session_data * map_charid2sd(int id) {
|
||||||
|
int i;
|
||||||
|
struct map_session_data *sd;
|
||||||
|
|
||||||
|
if (id <= 0) return 0;
|
||||||
|
|
||||||
|
for(i = 0; i < fd_max; i++)
|
||||||
|
if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) && sd->status.char_id == id)
|
||||||
|
return sd;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Search session data from a nick name
|
* Search session data from a nick name
|
||||||
|
|||||||
@ -765,6 +765,7 @@ void map_addchariddb(int charid,char *name);
|
|||||||
void map_delchariddb(int charid);
|
void map_delchariddb(int charid);
|
||||||
int map_reqchariddb(struct map_session_data * sd,int charid);
|
int map_reqchariddb(struct map_session_data * sd,int charid);
|
||||||
char * map_charid2nick(int);
|
char * map_charid2nick(int);
|
||||||
|
struct map_session_data * map_charid2sd(int);
|
||||||
|
|
||||||
struct map_session_data * map_id2sd(int);
|
struct map_session_data * map_id2sd(int);
|
||||||
struct block_list * map_id2bl(int);
|
struct block_list * map_id2bl(int);
|
||||||
|
|||||||
@ -2248,7 +2248,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
|
|||||||
if(!(type&2)) {
|
if(!(type&2)) {
|
||||||
if(sd!=NULL){
|
if(sd!=NULL){
|
||||||
for(i=0,minpos=0,mindmg=0x7fffffff;i<DAMAGELOG_SIZE;i++){
|
for(i=0,minpos=0,mindmg=0x7fffffff;i<DAMAGELOG_SIZE;i++){
|
||||||
if(md->dmglog[i].id==sd->bl.id)
|
//if(md->dmglog[i].id==sd->bl.id)
|
||||||
|
if(md->dmglog[i].id==sd->status.char_id)
|
||||||
break;
|
break;
|
||||||
if(md->dmglog[i].id==0){
|
if(md->dmglog[i].id==0){
|
||||||
minpos=i;
|
minpos=i;
|
||||||
@ -2262,7 +2263,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
|
|||||||
if(i<DAMAGELOG_SIZE)
|
if(i<DAMAGELOG_SIZE)
|
||||||
md->dmglog[i].dmg+=damage;
|
md->dmglog[i].dmg+=damage;
|
||||||
else {
|
else {
|
||||||
md->dmglog[minpos].id=sd->bl.id;
|
//md->dmglog[minpos].id=sd->bl.id;
|
||||||
|
md->dmglog[minpos].id=sd->status.char_id;
|
||||||
md->dmglog[minpos].dmg=damage;
|
md->dmglog[minpos].dmg=damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2273,7 +2275,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
|
|||||||
struct pet_data *pd = (struct pet_data *)src;
|
struct pet_data *pd = (struct pet_data *)src;
|
||||||
nullpo_retr(0, pd);
|
nullpo_retr(0, pd);
|
||||||
for(i=0,minpos=0,mindmg=0x7fffffff;i<DAMAGELOG_SIZE;i++){
|
for(i=0,minpos=0,mindmg=0x7fffffff;i<DAMAGELOG_SIZE;i++){
|
||||||
if(md->dmglog[i].id==pd->msd->bl.id)
|
//if(md->dmglog[i].id==pd->msd->bl.id)
|
||||||
|
if(md->dmglog[i].id==pd->msd->status.char_id)
|
||||||
break;
|
break;
|
||||||
if(md->dmglog[i].id==0){
|
if(md->dmglog[i].id==0){
|
||||||
minpos=i;
|
minpos=i;
|
||||||
@ -2287,7 +2290,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
|
|||||||
if(i<DAMAGELOG_SIZE)
|
if(i<DAMAGELOG_SIZE)
|
||||||
md->dmglog[i].dmg+=(damage*battle_config.pet_attack_exp_rate)/100;
|
md->dmglog[i].dmg+=(damage*battle_config.pet_attack_exp_rate)/100;
|
||||||
else {
|
else {
|
||||||
md->dmglog[minpos].id=pd->msd->bl.id;
|
//md->dmglog[minpos].id=pd->msd->bl.id;
|
||||||
|
md->dmglog[minpos].id=pd->msd->status.char_id;
|
||||||
md->dmglog[minpos].dmg=(damage*battle_config.pet_attack_exp_rate)/100;
|
md->dmglog[minpos].dmg=(damage*battle_config.pet_attack_exp_rate)/100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2454,7 +2458,12 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
|
|||||||
for(i=0,count=0,mvp_damage=0;i<DAMAGELOG_SIZE;i++){
|
for(i=0,count=0,mvp_damage=0;i<DAMAGELOG_SIZE;i++){
|
||||||
if(md->dmglog[i].id==0)
|
if(md->dmglog[i].id==0)
|
||||||
continue;
|
continue;
|
||||||
|
// Will this slow things down too much?
|
||||||
|
tmpsd[i] = map_charid2sd(md->dmglog[i].id);
|
||||||
|
// try finding again
|
||||||
|
if(tmpsd[i] == NULL)
|
||||||
tmpsd[i] = map_id2sd(md->dmglog[i].id);
|
tmpsd[i] = map_id2sd(md->dmglog[i].id);
|
||||||
|
// if we still can't find the player
|
||||||
if(tmpsd[i] == NULL)
|
if(tmpsd[i] == NULL)
|
||||||
continue;
|
continue;
|
||||||
count++;
|
count++;
|
||||||
@ -3289,13 +3298,13 @@ int mobskill_castend_pos( int tid, unsigned int tick, int id,int data )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!battle_config.monster_skill_reiteration &&
|
if (!battle_config.monster_skill_reiteration &&
|
||||||
skill_get_unit_flag(md->skillid)&UF_NOREITERATION &&
|
skill_get_unit_flag (md->skillid) & UF_NOREITERATION &&
|
||||||
skill_check_unit_range(md->bl.m,md->skillx,md->skilly,md->skillid,md->skilllv))
|
skill_check_unit_range (md->bl.m, md->skillx, md->skilly, md->skillid, md->skilllv))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(battle_config.monster_skill_nofootset &&
|
if(battle_config.monster_skill_nofootset &&
|
||||||
skill_get_unit_flag(md->skillid)&UF_NOFOOTSET &&
|
skill_get_unit_flag (md->skillid) & UF_NOFOOTSET &&
|
||||||
skill_check_unit_range2(md->bl.m,md->skillx,md->skilly,md->skillid,md->skilllv))
|
skill_check_unit_range2(&md->bl, md->bl.m, md->skillx, md->skilly, md->skillid, md->skilllv))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -311,62 +311,6 @@ int npc_event_export(void *key,void *data,va_list ap)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 全てのNPCのOn*イベント実行
|
* 全てのNPCのOn*イベント実行
|
||||||
*------------------------------------------
|
*------------------------------------------
|
||||||
@ -376,16 +320,17 @@ int npc_event_doall_sub(void *key,void *data,va_list ap)
|
|||||||
char *p=(char *)key;
|
char *p=(char *)key;
|
||||||
struct event_data *ev;
|
struct event_data *ev;
|
||||||
int *c;
|
int *c;
|
||||||
|
int rid;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
nullpo_retr(0, ev=(struct event_data *)data);
|
nullpo_retr(0, ev=(struct event_data *)data);
|
||||||
nullpo_retr(0, ap);
|
nullpo_retr(0, ap);
|
||||||
nullpo_retr(0, c=va_arg(ap,int *));
|
nullpo_retr(0, c=va_arg(ap,int *));
|
||||||
|
|
||||||
name=va_arg(ap,const char *);
|
name=va_arg(ap,const char *);
|
||||||
|
rid=va_arg(ap, int);
|
||||||
|
|
||||||
if( (p=strchr(p,':')) && p && strcmpi(name,p)==0 ){
|
if( (p=strchr(p,':')) && p && strcmpi(name,p)==0 ){
|
||||||
run_script(ev->nd->u.scr.script,ev->pos,0,ev->nd->bl.id);
|
run_script(ev->nd->u.scr.script,ev->pos,rid,ev->nd->bl.id);
|
||||||
(*c)++;
|
(*c)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,7 +342,16 @@ int npc_event_doall(const char *name)
|
|||||||
char buf[64]="::";
|
char buf[64]="::";
|
||||||
|
|
||||||
strncpy(buf+2,name,62);
|
strncpy(buf+2,name,62);
|
||||||
strdb_foreach(ev_db,npc_event_doall_sub,&c,buf);
|
strdb_foreach(ev_db,npc_event_doall_sub,&c,buf,0);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
int npc_event_doall_id(const char *name, int rid)
|
||||||
|
{
|
||||||
|
int c=0;
|
||||||
|
char buf[64]="::";
|
||||||
|
|
||||||
|
strncpy(buf+2,name,62);
|
||||||
|
strdb_foreach(ev_db,npc_event_doall_sub,&c,buf,rid);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@ int npc_do_ontimer(int,struct map_session_data *,int);
|
|||||||
|
|
||||||
int npc_event_doall(const char *name);
|
int npc_event_doall(const char *name);
|
||||||
int npc_event_do(const char *name);
|
int npc_event_do(const char *name);
|
||||||
|
int npc_event_doall_id(const char *name, int id);
|
||||||
|
|
||||||
int npc_timerevent_start(struct npc_data *nd, int rid);
|
int npc_timerevent_start(struct npc_data *nd, int rid);
|
||||||
int npc_timerevent_stop(struct npc_data *nd);
|
int npc_timerevent_stop(struct npc_data *nd);
|
||||||
|
|||||||
19
src/map/pc.c
19
src/map/pc.c
@ -840,7 +840,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
|
|||||||
sprintf(tmp_output,"Character '"CL_WHITE"%s"CL_RESET"' logged in. (Account ID: '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id);
|
sprintf(tmp_output,"Character '"CL_WHITE"%s"CL_RESET"' logged in. (Account ID: '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id);
|
||||||
ShowInfo(tmp_output);
|
ShowInfo(tmp_output);
|
||||||
|
|
||||||
{
|
if (script_config.event_script_type == 0) {
|
||||||
struct npc_data *npc;
|
struct npc_data *npc;
|
||||||
//printf("pc: OnPCLogin event done. (%d events)\n", npc_event_doall("OnPCLogin") );
|
//printf("pc: OnPCLogin event done. (%d events)\n", npc_event_doall("OnPCLogin") );
|
||||||
if ((npc = npc_name2id(script_config.login_event_name))) {
|
if ((npc = npc_name2id(script_config.login_event_name))) {
|
||||||
@ -848,7 +848,12 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
|
|||||||
sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.login_event_name);
|
sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.login_event_name);
|
||||||
ShowStatus(tmp_output);
|
ShowStatus(tmp_output);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
sprintf (tmp_output, "%d '"CL_WHITE"%s"CL_RESET"' events executed.\n",
|
||||||
|
npc_event_doall_id(script_config.login_event_name, sd->bl.id), script_config.login_event_name);
|
||||||
|
ShowStatus(tmp_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send friends list
|
// Send friends list
|
||||||
clif_friends_list_send(sd);
|
clif_friends_list_send(sd);
|
||||||
|
|
||||||
@ -4645,23 +4650,35 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
|
|||||||
if (sd->state.event_death)
|
if (sd->state.event_death)
|
||||||
pc_setglobalreg(sd,"killerrid",(ssd->status.account_id));
|
pc_setglobalreg(sd,"killerrid",(ssd->status.account_id));
|
||||||
if (ssd->state.event_kill) {
|
if (ssd->state.event_kill) {
|
||||||
|
if (script_config.event_script_type == 0) {
|
||||||
struct npc_data *npc;
|
struct npc_data *npc;
|
||||||
if ((npc = npc_name2id(script_config.kill_event_name))) {
|
if ((npc = npc_name2id(script_config.kill_event_name))) {
|
||||||
run_script(npc->u.scr.script,0,sd->bl.id,npc->bl.id); // PCKillNPC
|
run_script(npc->u.scr.script,0,sd->bl.id,npc->bl.id); // PCKillNPC
|
||||||
sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.kill_event_name);
|
sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.kill_event_name);
|
||||||
ShowStatus(tmp_output);
|
ShowStatus(tmp_output);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
sprintf (tmp_output, "%d '"CL_WHITE"%s"CL_RESET"' events executed.\n",
|
||||||
|
npc_event_doall_id(script_config.kill_event_name, sd->bl.id), script_config.kill_event_name);
|
||||||
|
ShowStatus(tmp_output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sd->state.event_death) {
|
if (sd->state.event_death) {
|
||||||
|
if (script_config.event_script_type == 0) {
|
||||||
struct npc_data *npc;
|
struct npc_data *npc;
|
||||||
if ((npc = npc_name2id(script_config.die_event_name))) {
|
if ((npc = npc_name2id(script_config.die_event_name))) {
|
||||||
run_script(npc->u.scr.script,0,sd->bl.id,npc->bl.id); // PCDeathNPC
|
run_script(npc->u.scr.script,0,sd->bl.id,npc->bl.id); // PCDeathNPC
|
||||||
sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.die_event_name);
|
sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.die_event_name);
|
||||||
ShowStatus(tmp_output);
|
ShowStatus(tmp_output);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
sprintf (tmp_output, "%d '"CL_WHITE"%s"CL_RESET"' events executed.\n",
|
||||||
|
npc_event_doall_id(script_config.die_event_name, sd->bl.id), script_config.die_event_name);
|
||||||
|
ShowStatus(tmp_output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(battle_config.bone_drop==2
|
if(battle_config.bone_drop==2
|
||||||
|
|||||||
@ -1693,9 +1693,9 @@ static int skill_check_unit_range2_sub( struct block_list *bl,va_list ap )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int skill_check_unit_range2(int m,int x,int y,int skillid, int skilllv)
|
int skill_check_unit_range2(struct block_list *bl, int m,int x,int y,int skillid, int skilllv)
|
||||||
{
|
{
|
||||||
int c = 0, range;
|
int c = 0, range, type;
|
||||||
|
|
||||||
switch (skillid) { // to be expanded later
|
switch (skillid) { // to be expanded later
|
||||||
case WZ_ICEWALL:
|
case WZ_ICEWALL:
|
||||||
@ -1714,8 +1714,15 @@ int skill_check_unit_range2(int m,int x,int y,int skillid, int skilllv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
map_foreachinarea(skill_check_unit_range2_sub,m,
|
// if the caster is a monster/NPC, only check for players
|
||||||
x-range,y-range,x+range,y+range,0,&c,skillid);
|
// otherwise just check everything
|
||||||
|
if (bl->type == BL_PC)
|
||||||
|
type = 0;
|
||||||
|
else type = BL_PC;
|
||||||
|
|
||||||
|
map_foreachinarea(skill_check_unit_range2_sub, m,
|
||||||
|
x - range, y - range, x + range, y + range,
|
||||||
|
type, &c, skillid);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
@ -6000,7 +6007,7 @@ int skill_castend_pos( int tid, unsigned int tick, int id,int data )
|
|||||||
break;*/
|
break;*/
|
||||||
if (battle_config.pc_skill_nofootset &&
|
if (battle_config.pc_skill_nofootset &&
|
||||||
skill_get_unit_flag(sd->skillid)&UF_NOFOOTSET &&
|
skill_get_unit_flag(sd->skillid)&UF_NOFOOTSET &&
|
||||||
skill_check_unit_range2(sd->bl.m,sd->skillx,sd->skilly,sd->skillid,sd->skilllv)) {
|
skill_check_unit_range2(&sd->bl,sd->bl.m,sd->skillx,sd->skilly,sd->skillid,sd->skilllv)) {
|
||||||
clif_skill_fail(sd,sd->skillid,0,0);
|
clif_skill_fail(sd,sd->skillid,0,0);
|
||||||
sd->canact_tick = tick;
|
sd->canact_tick = tick;
|
||||||
sd->canmove_tick = tick;
|
sd->canmove_tick = tick;
|
||||||
@ -7022,7 +7029,7 @@ int skill_use_id( struct map_session_data *sd, int target_id,
|
|||||||
clif_skill_fail(sd,sd->skillid,0,0);
|
clif_skill_fail(sd,sd->skillid,0,0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (skill_check_unit_range2(sd->bl.m,sd->bl.x,sd->bl.y,sd->skillid,sd->skilllv)) {
|
if (skill_check_unit_range2(&sd->bl,sd->bl.m,sd->bl.x,sd->bl.y,sd->skillid,sd->skilllv)) {
|
||||||
clif_skill_fail(sd,sd->skillid,0,0);
|
clif_skill_fail(sd,sd->skillid,0,0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -143,7 +143,7 @@ int skill_unit_ondamaged(struct skill_unit *src,struct block_list *bl,
|
|||||||
int skill_castfix( struct block_list *bl, int time );
|
int skill_castfix( struct block_list *bl, int time );
|
||||||
int skill_delayfix( struct block_list *bl, int time );
|
int skill_delayfix( struct block_list *bl, int time );
|
||||||
int skill_check_unit_range(int m,int x,int y,int skillid, int skilllv);
|
int skill_check_unit_range(int m,int x,int y,int skillid, int skilllv);
|
||||||
int skill_check_unit_range2(int m,int x,int y,int skillid, int skilllv);
|
int skill_check_unit_range2(struct block_list *bl,int m,int x,int y,int skillid, int skilllv);
|
||||||
// -- moonsoul (added skill_check_unit_cell)
|
// -- moonsoul (added skill_check_unit_cell)
|
||||||
int skill_check_unit_cell(int skillid,int m,int x,int y,int unit_id);
|
int skill_check_unit_cell(int skillid,int m,int x,int y,int unit_id);
|
||||||
int skill_unit_out_all( struct block_list *bl,unsigned int tick,int range);
|
int skill_unit_out_all( struct block_list *bl,unsigned int tick,int range);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user