summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-16 16:08:01 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-16 16:08:01 +0000
commit6e4d98865963ef3e85df488716e9a97bfcacc98b (patch)
tree02501055909d8db00138b69db2a8e8c841f0cc72 /src/map
parentd5155d42388cf3540fdf415512c2bfad0c8d5f8e (diff)
downloadhercules-6e4d98865963ef3e85df488716e9a97bfcacc98b.tar.gz
hercules-6e4d98865963ef3e85df488716e9a97bfcacc98b.tar.bz2
hercules-6e4d98865963ef3e85df488716e9a97bfcacc98b.tar.xz
hercules-6e4d98865963ef3e85df488716e9a97bfcacc98b.zip
* mob_chat_sub fix. Added buildin_pcblockmove.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5628 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/mob.c4
-rw-r--r--src/map/npc_chat.c22
-rw-r--r--src/map/script.c20
5 files changed, 37 insertions, 18 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 040644127..13e936f18 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8874,8 +8874,9 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd) {
return;
}
- if (pc_issit(sd)) //No walking when you are sit!
- return;
+ // Redundancy, used in pc_can_move already
+ //if (pc_issit(sd)) //No walking when you are sit!
+ // return;
if (clif_cant_act(sd))
return;
@@ -8886,6 +8887,9 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd) {
if (!pc_can_move(sd))
return;
+ if(sd->state.blockedmove)
+ return;
+
if(sd->sc.count && sd->sc.data[SC_RUN].timer != -1)
return;
diff --git a/src/map/map.h b/src/map/map.h
index bc79073b5..cfedf527b 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -450,6 +450,7 @@ struct map_session_data {
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 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;
struct guild *gmaster_flag;
} state;
diff --git a/src/map/mob.c b/src/map/mob.c
index e239ce836..ba4bb5083 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2291,9 +2291,9 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(src){
if(md->nd){
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);
- set_var(NULL, buffer, src->type);
+ set_var(NULL, buffer, (void *)src->type);
sprintf(buffer, "%s::OnDamage", md->nd->exname);
npc_event_do(buffer);
return 0;
diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c
index 7d8e0e21f..eaab82aff 100644
--- a/src/map/npc_chat.c
+++ b/src/map/npc_chat.c
@@ -372,20 +372,6 @@ void npc_chat_finalize(struct npc_data *nd)
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
*/
@@ -491,6 +477,14 @@ int npc_chat_sub(struct block_list *bl, va_list ap)
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
int buildin_defpattern(struct script_state *st) {
diff --git a/src/map/script.c b/src/map/script.c
index 2de03d940..9b4690ca7 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -410,6 +410,7 @@ int buildin_pctalk(struct script_state *st);
int buildin_pcemote(struct script_state *st);
int buildin_pcfollow(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 mob control commands --->
int buildin_spawnmob(struct script_state *st);
@@ -737,6 +738,7 @@ struct {
{buildin_pcemote,"pcemote","ii"},
{buildin_pcfollow,"pcfollow","ii"},
{buildin_pcstopfollow,"pcstopfollow","i"},
+ {buildin_pcblockmove,"pcblockmove","ii"},
// <--- [zBuffer] List of player cont commands
// [zBuffer] List of mob control commands --->
{buildin_spawnmob,"spawnmob","*"},
@@ -9847,6 +9849,24 @@ int buildin_pcwalkxy(struct script_state *st){
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 id;
char *str;