* mob_chat_sub fix. Added buildin_pcblockmove.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5628 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
Lance 2006-03-16 16:08:01 +00:00
parent 46bdee18f9
commit d5cf7d95e0
6 changed files with 38 additions and 18 deletions

View File

@ -5,6 +5,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/15 2006/03/15
* mob_chat_sub fix. Added buildin_pcblockmove. [Lance]
* BL_PC and BL_MOB control script commands (experimental) [Lance] * BL_PC and BL_MOB control script commands (experimental) [Lance]
* Made an adjustment to addspiritball() to allow Gunslingers to summon up to 10 spheres [reddozen] * Made an adjustment to addspiritball() to allow Gunslingers to summon up to 10 spheres [reddozen]
* Fixed Tarot Card of Fate using time instead of time2 which is the one * Fixed Tarot Card of Fate using time instead of time2 which is the one

View File

@ -8874,8 +8874,9 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd) {
return; return;
} }
if (pc_issit(sd)) //No walking when you are sit! // Redundancy, used in pc_can_move already
return; //if (pc_issit(sd)) //No walking when you are sit!
// return;
if (clif_cant_act(sd)) if (clif_cant_act(sd))
return; return;
@ -8886,6 +8887,9 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd) {
if (!pc_can_move(sd)) if (!pc_can_move(sd))
return; return;
if(sd->state.blockedmove)
return;
if(sd->sc.count && sd->sc.data[SC_RUN].timer != -1) if(sd->sc.count && sd->sc.data[SC_RUN].timer != -1)
return; return;

View File

@ -450,6 +450,7 @@ struct map_session_data {
unsigned size :2; // for tiny/large types unsigned size :2; // for tiny/large types
unsigned night :1; //Holds whether or not the player currently has the SI_NIGHT effect on. [Skotlex] unsigned night :1; //Holds whether or not the player currently has the SI_NIGHT effect on. [Skotlex]
unsigned finalsave :1; //Signals whether the final save for the char was done or not yet. Meant to prevent exploits and the like. [Skotlex] unsigned finalsave :1; //Signals whether the final save for the char was done or not yet. Meant to prevent exploits and the like. [Skotlex]
unsigned blockedmove :1;
unsigned short autoloot; unsigned short autoloot;
struct guild *gmaster_flag; struct guild *gmaster_flag;
} state; } state;

View File

@ -2291,9 +2291,9 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(src){ if(src){
if(md->nd){ if(md->nd){
sprintf(buffer, "$@%d_attacker", md->bl.id); sprintf(buffer, "$@%d_attacker", md->bl.id);
set_var(NULL, buffer, src->id); set_var(NULL, buffer, (void *)src->id);
sprintf(buffer, "$@%d_attacktype", md->bl.id); sprintf(buffer, "$@%d_attacktype", md->bl.id);
set_var(NULL, buffer, src->type); set_var(NULL, buffer, (void *)src->type);
sprintf(buffer, "%s::OnDamage", md->nd->exname); sprintf(buffer, "%s::OnDamage", md->nd->exname);
npc_event_do(buffer); npc_event_do(buffer);
return 0; return 0;

View File

@ -372,20 +372,6 @@ void npc_chat_finalize(struct npc_data *nd)
aFree(npcParse); aFree(npcParse);
} }
int mob_chat_sub(struct block_list *bl, va_list ap){
int len;
unsigned char *msg = NULL;
struct map_session_data *sd = NULL;
struct mob_data *md = (struct mob_data *)bl;
if(md->nd){
msg = va_arg(ap,unsigned char*);
len = va_arg(ap,int);
sd = va_arg(ap,struct map_session_data *);
npc_chat_sub(&md->nd->bl, msg, len, sd);
}
return 0;
}
/** /**
* Handler called whenever a global message is spoken in a NPC's area * Handler called whenever a global message is spoken in a NPC's area
*/ */
@ -491,6 +477,14 @@ int npc_chat_sub(struct block_list *bl, va_list ap)
return 0; return 0;
} }
int mob_chat_sub(struct block_list *bl, va_list ap){
struct mob_data *md = (struct mob_data *)bl;
if(md->nd){
npc_chat_sub(&md->nd->bl, ap);
}
return 0;
}
// Various script builtins used to support these functions // Various script builtins used to support these functions
int buildin_defpattern(struct script_state *st) { int buildin_defpattern(struct script_state *st) {

View File

@ -410,6 +410,7 @@ int buildin_pctalk(struct script_state *st);
int buildin_pcemote(struct script_state *st); int buildin_pcemote(struct script_state *st);
int buildin_pcfollow(struct script_state *st); int buildin_pcfollow(struct script_state *st);
int buildin_pcstopfollow(struct script_state *st); int buildin_pcstopfollow(struct script_state *st);
int buildin_pcblockmove(struct script_state *st);
// <--- [zBuffer] List of player cont commands // <--- [zBuffer] List of player cont commands
// [zBuffer] List of mob control commands ---> // [zBuffer] List of mob control commands --->
int buildin_spawnmob(struct script_state *st); int buildin_spawnmob(struct script_state *st);
@ -737,6 +738,7 @@ struct {
{buildin_pcemote,"pcemote","ii"}, {buildin_pcemote,"pcemote","ii"},
{buildin_pcfollow,"pcfollow","ii"}, {buildin_pcfollow,"pcfollow","ii"},
{buildin_pcstopfollow,"pcstopfollow","i"}, {buildin_pcstopfollow,"pcstopfollow","i"},
{buildin_pcblockmove,"pcblockmove","ii"},
// <--- [zBuffer] List of player cont commands // <--- [zBuffer] List of player cont commands
// [zBuffer] List of mob control commands ---> // [zBuffer] List of mob control commands --->
{buildin_spawnmob,"spawnmob","*"}, {buildin_spawnmob,"spawnmob","*"},
@ -9847,6 +9849,24 @@ int buildin_pcwalkxy(struct script_state *st){
return 0; return 0;
} }
int buildin_pcblockmove(struct script_state *st){
int id, flag;
struct map_session_data *sd = NULL;
id = conv_num(st, & (st->stack->stack_data[st->start + 2]));
flag = conv_num(st, & (st->stack->stack_data[st->start + 3]));
if(id)
sd = map_id2sd(id);
else
sd = script_rid2sd(st);
if(sd)
sd->state.blockedmove = flag > 0;
return 0;
}
int buildin_pctalk(struct script_state *st){ int buildin_pctalk(struct script_state *st){
int id; int id;
char *str; char *str;