diff options
author | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-01 02:11:23 +0000 |
---|---|---|
committer | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-01 02:11:23 +0000 |
commit | 454ae6b78937da966545207b94b1e0a037fdb098 (patch) | |
tree | 4bbf37710cab966b03bab7280b5f425b6cebad36 /src/map/script.c | |
parent | bab1ce1992acc67b814e3de9f09ac58d569265b1 (diff) | |
download | hercules-454ae6b78937da966545207b94b1e0a037fdb098.tar.gz hercules-454ae6b78937da966545207b94b1e0a037fdb098.tar.bz2 hercules-454ae6b78937da966545207b94b1e0a037fdb098.tar.xz hercules-454ae6b78937da966545207b94b1e0a037fdb098.zip |
* April fool! Improved soundeffectall script command. (No, this is not a lie)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5832 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/src/map/script.c b/src/map/script.c index acf09a796..8e09ad061 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -645,7 +645,7 @@ struct { {buildin_classchange,"classchange","ii"},
{buildin_misceffect,"misceffect","i"},
{buildin_soundeffect,"soundeffect","si"},
- {buildin_soundeffectall,"soundeffectall","si"}, // SoundEffectAll [Codemaster]
+ {buildin_soundeffectall,"soundeffectall","*"}, // SoundEffectAll [Codemaster]
{buildin_strmobinfo,"strmobinfo","ii"}, // display mob data [Valaris]
{buildin_guardian,"guardian","siisii*i"}, // summon guardians
{buildin_guardianinfo,"guardianinfo","i"}, // display guardian data [Valaris]
@@ -8148,23 +8148,55 @@ int buildin_soundeffect(struct script_state *st) return 0;
}
+int soundeffect_sub(struct block_list* bl,va_list ap)
+{
+ char *name;
+ int type;
+
+ nullpo_retr(0, bl);
+ nullpo_retr(0, ap);
+
+ name = va_arg(ap,char *);
+ type = va_arg(ap,int);
+
+ clif_soundeffect((struct map_session_data *)bl, bl, name, type);
+
+ return 0;
+}
+
int buildin_soundeffectall(struct script_state *st)
{
// [Lance] - Improved.
struct map_session_data *sd=NULL;
- char *name;
- int type=0;
+ char *name, *map = NULL;
+ struct block_list *bl;
+ int type, coverage, x0, y0, x1, y1;
name=conv_str(st,& (st->stack->stack_data[st->start+2]));
type=conv_num(st,& (st->stack->stack_data[st->start+3]));
- //if(sd)
- //{
- if(st->oid)
- clif_soundeffectall(map_id2bl(st->oid),name,type);
- else
- if((sd=script_rid2sd(st)))
- clif_soundeffectall(&sd->bl,name,type);
- //}
+ coverage=conv_num(st,& (st->stack->stack_data[st->start+4]));
+
+ if(st->oid)
+ bl = map_id2bl(st->oid);
+ else
+ bl = &(script_rid2sd(st)->bl);
+
+ if(bl){
+ if(coverage < 23){
+ clif_soundeffectall(bl,name,type,coverage);
+ }else {
+ if(st->end > st->start+9){
+ map=conv_str(st,& (st->stack->stack_data[st->start+5]));
+ x0 = conv_num(st,& (st->stack->stack_data[st->start+6]));
+ y0 = conv_num(st,& (st->stack->stack_data[st->start+7]));
+ x1 = conv_num(st,& (st->stack->stack_data[st->start+8]));
+ y1 = conv_num(st,& (st->stack->stack_data[st->start+9]));
+ map_foreachinarea(soundeffect_sub,map_mapname2mapid(map),x0,y0,x1,y1,BL_PC,name,type);
+ } else {
+ ShowError("buildin_soundeffectall: insufficient arguments for specific area broadcast.\n");
+ }
+ }
+ }
return 0;
}
/*==========================================
|