Obrigado julio, irei fazer, se eu conseguir postarei a edição aqui.
ok, consegui fazer oque queria
arquivo unit.c
procure por
// Check if warping and not changing the map.
if ( sd->state.warping && !sd->state.changemap ) {
status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
}
basta adicionar a linha
status_change_end(bl, SC_CHASEWALK, INVALID_TIMER);
vai ficar assim
// Check if warping and not changing the map.
if ( sd->state.warping && !sd->state.changemap ) {
status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
status_change_end(bl, SC_CHASEWALK, INVALID_TIMER);
}
- Viewing Profile: Posts: deadzero
Community Stats
- Group Members
- Active Posts 12
- Profile Views 2624
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
-
Github
FrosT
Posts I've Made
In Topic: Skill Espreitar
02 February 2016 - 10:57 AM
In Topic: [AJUDA] Script NPC
15 January 2016 - 05:34 PM
Não sei se npc pode receber dano, mas você pode criar 3 monstros, ai quando 1 morre você invoca o outro.
monster("turbo_n_1",147,375,"Pedra1",1906,1,"c_maluca::OnMATOU1MOB1");
end;
OnMATOU1MOB1:
monster("turbo_n_1",147,375,"Pedra2",1907,1,"c_maluca::OnMATOU1MOB2");
end;
OnMATOU1MOB2:
monster("turbo_n_1",147,375,"Pedra3",1908,1,"c_maluca::OnMATOU1MOB1");
end;
É só um exemplo de como fazer, você pode substituir os ids de monstros pelo que você criou.
monster("turbo_n_1",147,375,"Pedra1",1906,1,"c_maluca::OnMATOU1MOB1");
end;
OnMATOU1MOB1:
monster("turbo_n_1",147,375,"Pedra2",1907,1,"c_maluca::OnMATOU1MOB2");
end;
OnMATOU1MOB2:
monster("turbo_n_1",147,375,"Pedra3",1908,1,"c_maluca::OnMATOU1MOB1");
end;
É só um exemplo de como fazer, você pode substituir os ids de monstros pelo que você criou.
In Topic: Web Vending Database (Standalone and FluxCP Addon)
28 December 2015 - 01:11 PM
My flux don't show the item images, someone knows what?
In Topic: Bug when teleporting or changing a map
03 October 2015 - 04:59 PM
The problem was in the script of resident evil.
Does someone knows where is the error?
Spoiler
Index: atcommand.c
===================================================================
--- atcommand.c (revision 15066)
+++ atcommand.c (working copy)
@@ -4432,6 +4432,8 @@
strcat(atcmd_output, "PartyLock | ");
if (map[m_id].flag.guildlock)
strcat(atcmd_output, "GuildLock | ");
+ if (map[m_id].flag.resident)
+ strcat(atcmd_output, "Resident | ");
clif_displaymessage(fd, atcmd_output);
switch (list) {
Index: battle.c
===================================================================
--- battle.c (revision 15066)
+++ battle.c (working copy)
@@ -1013,6 +1013,11 @@
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
+ if( sd && map[sd->bl.m].flag.resident && sd->state.resident && tsd && tsd->state.resident )
+ {
+ wd.damage = 1;
+ return wd;
+ }
if(sd)
wd.blewcount += battle_blewcount_bonus(sd, skill_num);
@@ -3458,6 +3463,10 @@
struct map_session_data *sd = BL_CAST(BL_PC, s_bl);
if( s_bl != t_bl )
{
+ if(map[sd->bl.m].flag.resident &&
+ ((sd->state.resident == 1 ) || (sd->state.resident == 2 && ((TBL_PC*)t_bl)->state.resident == 2))
+ || (!sd->state.resident && ((TBL_PC*)t_bl)->state.resident) || (sd->state.resident && !((TBL_PC*)t_bl)->state.resident))
+ return 0;
if( sd->state.killer )
{
state |= BCT_ENEMY; // Can kill anything
@@ -3483,6 +3492,8 @@
if( !((agit_flag || agit2_flag) && map[m].flag.gvg_castle) && md->guardian_data && md->guardian_data->guild_id )
return 0; // Disable guardians/emperium owned by Guilds on non-woe times.
+ if(((TBL_PC*)t_bl)->state.resident)
+ return 0;
if( !md->special_state.ai )
{ //Normal mobs.
if( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai )
Index: clif.c
===================================================================
--- clif.c (revision 15066)
+++ clif.c (working copy)
@@ -9150,6 +9150,12 @@
#ifndef TXT_ONLY
mail_clear(sd);
#endif
+ status_calc_pc(sd, true);
+ if(!map[sd->bl.m].flag.resident && sd->state.resident)
+ {
+ sd->state.resident = 0;
+ pc_disguise(sd,0);
+ }
if(map[sd->bl.m].flag.loadevent) // Lance
npc_script_event(sd, NPCE_LOADMAP);
Index: map.h
===================================================================
--- map.h (revision 15066)
+++ map.h (working copy)
@@ -492,6 +492,8 @@
unsigned guildlock :1;
unsigned src4instance : 1; // To flag this map when it's used as a src map for instances
unsigned reset :1; // [Daegaladh]
+
+ .flag.resident :1;
} flag;
struct point save;
struct npc_data *npc[MAX_NPC_PER_MAP];
Index: npc.c
===================================================================
--- npc.c (revision 15066)
+++ npc.c (working copy)
@@ -3114,6 +3114,8 @@
map[m].flag.guildlock=state;
else if (!strcmpi(w3,"reset"))
map[m].flag.reset=state;
+ else if(!strcmpi(w3,"resident"))
+ map[m].flag.resident=state;
else
ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').n", w3, filepath, strline(buffer,start-buffer));
@@ -3300,6 +3302,7 @@
{"Die Event",script_config.die_event_name},
{"Kill PC Event",script_config.kill_pc_event_name},
{"Kill NPC Event",script_config.kill_mob_event_name},
+ {"Damage Event",script_config.damage_event_name},
};
for (i = 0; i < NPCE_MAX; i++)
Index: npc.h
===================================================================
--- npc.h (revision 15066)
+++ npc.h (working copy)
@@ -97,6 +97,7 @@
NPCE_DIE,
NPCE_KILLPC,
NPCE_KILLNPC,
+ NPCE_DAMAGE,
NPCE_MAX
};
struct view_data* npc_get_viewdata(int class_);
Index: pc.c
===================================================================
--- pc.c (revision 15066)
+++ pc.c (working copy)
@@ -5661,7 +5661,9 @@
pc_setstand(sd);
skill_sit(sd,0);
}
-
+ if(map[sd->bl.m].flag.resident && sd->state.resident == 1)
+ {
+ npc_script_event(sd,NPCE_DAMAGE);
+ pc_stop_attack((TBL_PC*)src);
+ }
+
if( sd->progressbar.npc_id )
clif_progressbar_abort(sd);
@@ -7120,6 +7122,9 @@
nullpo_ret(sd);
+ if(map[sd->bl.m].flag.resident)
+ return 0;
+
if( n < 0 || n >= MAX_INVENTORY ) {
clif_equipitemack(sd,0,0,0);
return 0;
Index: pc.h
===================================================================
--- pc.h (revision 15066)
+++ pc.h (working copy)
@@ -137,6 +137,7 @@
unsigned short autolootid; // [Zephyrus]
unsigned short autobonus; //flag to indicate if an autobonus is activated. [Inkfish]
struct guild *gmaster_flag;
+ unsigned int resident :2;
} state;
struct {
unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
Index: script.c
===================================================================
--- script.c (revision 15066)
+++ script.c (working copy)
@@ -232,6 +232,7 @@
"OnPCLoadMapEvent", //loadmap_event_name
"OnPCBaseLvUpEvent", //baselvup_event_name
"OnPCJobLvUpEvent", //joblvup_event_name
+ "OnPCDamage",
"OnTouch_", //ontouch_name (runs on first visible char to enter area, picks another char if the first char leaves)
"OnTouch", //ontouch2_name (run whenever a char walks into the OnTouch area)
};
@@ -357,7 +358,8 @@
MF_MONSTER_NOTELEPORT,
MF_PVP_NOCALCRANK, //50
MF_BATTLEGROUND,
- MF_RESET
+ MF_RESET,
+ MF_RESIDENT
};
const char* script_op2name(int op)
@@ -14963,7 +14965,25 @@
return 0;
}
+BUILDIN_FUNC(resident)
+{
+ struct map_session_data* sd;
+ int resident;
+ const char * name;
+
+ name = script_getstr(st,2);
+ sd = map_nick2sd(name);
+
+ if(sd)
+ {
+ resident = script_getnum(st,3);
+ sd->state.resident = (resident > 2?0:resident);
+ pc_disguise(sd,sd->state.resident == 2?1865:0);
+ }
+ return 0;
+}
+
// declarations that were supposed to be exported from npc_chat.c
#ifdef PCRE_SUPPORT
BUILDIN_FUNC(defpattern);
@@ -14976,6 +14996,8 @@
/// for an explanation on args, see add_buildin_func
struct script_function buildin_func[] = {
// NPC interaction
+ BUILDIN_DEF(resident,"si"),
+
BUILDIN_DEF(mes,"s"),
BUILDIN_DEF(next,""),
BUILDIN_DEF(close,""),
Index: script.h
===================================================================
--- script.h (revision 15066)
+++ script.h (working copy)
@@ -26,6 +26,7 @@
const char *loadmap_event_name;
const char *baselvup_event_name;
const char *joblvup_event_name;
+ const char *damage_event_name;
const char* ontouch_name;
const char* ontouch2_name;
Index: status.c
===================================================================
--- status.c (revision 15066)
+++ status.c (working copy)
@@ -3905,6 +3905,9 @@
speed = speed * 100 / sc->data[SC_WALKSPEED]->val1;
}
+ if(sd && map[sd->bl.m].flag.resident)
+ speed = 200;
+
return (short)cap_value(speed,10,USHRT_MAX);
}
===================================================================
--- atcommand.c (revision 15066)
+++ atcommand.c (working copy)
@@ -4432,6 +4432,8 @@
strcat(atcmd_output, "PartyLock | ");
if (map[m_id].flag.guildlock)
strcat(atcmd_output, "GuildLock | ");
+ if (map[m_id].flag.resident)
+ strcat(atcmd_output, "Resident | ");
clif_displaymessage(fd, atcmd_output);
switch (list) {
Index: battle.c
===================================================================
--- battle.c (revision 15066)
+++ battle.c (working copy)
@@ -1013,6 +1013,11 @@
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
+ if( sd && map[sd->bl.m].flag.resident && sd->state.resident && tsd && tsd->state.resident )
+ {
+ wd.damage = 1;
+ return wd;
+ }
if(sd)
wd.blewcount += battle_blewcount_bonus(sd, skill_num);
@@ -3458,6 +3463,10 @@
struct map_session_data *sd = BL_CAST(BL_PC, s_bl);
if( s_bl != t_bl )
{
+ if(map[sd->bl.m].flag.resident &&
+ ((sd->state.resident == 1 ) || (sd->state.resident == 2 && ((TBL_PC*)t_bl)->state.resident == 2))
+ || (!sd->state.resident && ((TBL_PC*)t_bl)->state.resident) || (sd->state.resident && !((TBL_PC*)t_bl)->state.resident))
+ return 0;
if( sd->state.killer )
{
state |= BCT_ENEMY; // Can kill anything
@@ -3483,6 +3492,8 @@
if( !((agit_flag || agit2_flag) && map[m].flag.gvg_castle) && md->guardian_data && md->guardian_data->guild_id )
return 0; // Disable guardians/emperium owned by Guilds on non-woe times.
+ if(((TBL_PC*)t_bl)->state.resident)
+ return 0;
if( !md->special_state.ai )
{ //Normal mobs.
if( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai )
Index: clif.c
===================================================================
--- clif.c (revision 15066)
+++ clif.c (working copy)
@@ -9150,6 +9150,12 @@
#ifndef TXT_ONLY
mail_clear(sd);
#endif
+ status_calc_pc(sd, true);
+ if(!map[sd->bl.m].flag.resident && sd->state.resident)
+ {
+ sd->state.resident = 0;
+ pc_disguise(sd,0);
+ }
if(map[sd->bl.m].flag.loadevent) // Lance
npc_script_event(sd, NPCE_LOADMAP);
Index: map.h
===================================================================
--- map.h (revision 15066)
+++ map.h (working copy)
@@ -492,6 +492,8 @@
unsigned guildlock :1;
unsigned src4instance : 1; // To flag this map when it's used as a src map for instances
unsigned reset :1; // [Daegaladh]
+
+ .flag.resident :1;
} flag;
struct point save;
struct npc_data *npc[MAX_NPC_PER_MAP];
Index: npc.c
===================================================================
--- npc.c (revision 15066)
+++ npc.c (working copy)
@@ -3114,6 +3114,8 @@
map[m].flag.guildlock=state;
else if (!strcmpi(w3,"reset"))
map[m].flag.reset=state;
+ else if(!strcmpi(w3,"resident"))
+ map[m].flag.resident=state;
else
ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').n", w3, filepath, strline(buffer,start-buffer));
@@ -3300,6 +3302,7 @@
{"Die Event",script_config.die_event_name},
{"Kill PC Event",script_config.kill_pc_event_name},
{"Kill NPC Event",script_config.kill_mob_event_name},
+ {"Damage Event",script_config.damage_event_name},
};
for (i = 0; i < NPCE_MAX; i++)
Index: npc.h
===================================================================
--- npc.h (revision 15066)
+++ npc.h (working copy)
@@ -97,6 +97,7 @@
NPCE_DIE,
NPCE_KILLPC,
NPCE_KILLNPC,
+ NPCE_DAMAGE,
NPCE_MAX
};
struct view_data* npc_get_viewdata(int class_);
Index: pc.c
===================================================================
--- pc.c (revision 15066)
+++ pc.c (working copy)
@@ -5661,7 +5661,9 @@
pc_setstand(sd);
skill_sit(sd,0);
}
-
+ if(map[sd->bl.m].flag.resident && sd->state.resident == 1)
+ {
+ npc_script_event(sd,NPCE_DAMAGE);
+ pc_stop_attack((TBL_PC*)src);
+ }
+
if( sd->progressbar.npc_id )
clif_progressbar_abort(sd);
@@ -7120,6 +7122,9 @@
nullpo_ret(sd);
+ if(map[sd->bl.m].flag.resident)
+ return 0;
+
if( n < 0 || n >= MAX_INVENTORY ) {
clif_equipitemack(sd,0,0,0);
return 0;
Index: pc.h
===================================================================
--- pc.h (revision 15066)
+++ pc.h (working copy)
@@ -137,6 +137,7 @@
unsigned short autolootid; // [Zephyrus]
unsigned short autobonus; //flag to indicate if an autobonus is activated. [Inkfish]
struct guild *gmaster_flag;
+ unsigned int resident :2;
} state;
struct {
unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
Index: script.c
===================================================================
--- script.c (revision 15066)
+++ script.c (working copy)
@@ -232,6 +232,7 @@
"OnPCLoadMapEvent", //loadmap_event_name
"OnPCBaseLvUpEvent", //baselvup_event_name
"OnPCJobLvUpEvent", //joblvup_event_name
+ "OnPCDamage",
"OnTouch_", //ontouch_name (runs on first visible char to enter area, picks another char if the first char leaves)
"OnTouch", //ontouch2_name (run whenever a char walks into the OnTouch area)
};
@@ -357,7 +358,8 @@
MF_MONSTER_NOTELEPORT,
MF_PVP_NOCALCRANK, //50
MF_BATTLEGROUND,
- MF_RESET
+ MF_RESET,
+ MF_RESIDENT
};
const char* script_op2name(int op)
@@ -14963,7 +14965,25 @@
return 0;
}
+BUILDIN_FUNC(resident)
+{
+ struct map_session_data* sd;
+ int resident;
+ const char * name;
+
+ name = script_getstr(st,2);
+ sd = map_nick2sd(name);
+
+ if(sd)
+ {
+ resident = script_getnum(st,3);
+ sd->state.resident = (resident > 2?0:resident);
+ pc_disguise(sd,sd->state.resident == 2?1865:0);
+ }
+ return 0;
+}
+
// declarations that were supposed to be exported from npc_chat.c
#ifdef PCRE_SUPPORT
BUILDIN_FUNC(defpattern);
@@ -14976,6 +14996,8 @@
/// for an explanation on args, see add_buildin_func
struct script_function buildin_func[] = {
// NPC interaction
+ BUILDIN_DEF(resident,"si"),
+
BUILDIN_DEF(mes,"s"),
BUILDIN_DEF(next,""),
BUILDIN_DEF(close,""),
Index: script.h
===================================================================
--- script.h (revision 15066)
+++ script.h (working copy)
@@ -26,6 +26,7 @@
const char *loadmap_event_name;
const char *baselvup_event_name;
const char *joblvup_event_name;
+ const char *damage_event_name;
const char* ontouch_name;
const char* ontouch2_name;
Index: status.c
===================================================================
--- status.c (revision 15066)
+++ status.c (working copy)
@@ -3905,6 +3905,9 @@
speed = speed * 100 / sc->data[SC_WALKSPEED]->val1;
}
+ if(sd && map[sd->bl.m].flag.resident)
+ speed = 200;
+
return (short)cap_value(speed,10,USHRT_MAX);
}
Does someone knows where is the error?
In Topic: Bug when teleporting or changing a map
02 October 2015 - 11:40 PM
@winterox
Emulador: Hercules
Client: 2014-03-05
My source run with BG expansive system and Resident evil event.
- Viewing Profile: Posts: deadzero
- Privacy Policy
- Hercules Forum Rules ·