From 7da9ee0b5c0aad9425441bcddeeadb745aa4c0d5 Mon Sep 17 00:00:00 2001 From: Inkfish Date: Sun, 25 Oct 2009 09:38:33 +0000 Subject: * Implemented the official version of 'OnTouch' named as 'OnTouch_'.(it can be defined in script_athena.conf) * Adapted 'map_foreachinarea' to 'map_forsomeinarea' so that it allows you to specify the number of bl you wanna operate on. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14097 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index 0d781906c..6f34e3058 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -216,7 +216,9 @@ struct Script_Config script_config = { "OnPCLogoutEvent", //logout_event_name "OnPCLoadMapEvent", //loadmap_event_name "OnPCBaseLvUpEvent", //baselvup_event_name - "OnPCJobLvUpEvent" //joblvup_event_name + "OnPCJobLvUpEvent", //joblvup_event_name + "OnTouch", //Official version of OnTouch + "OnTouch2", //Official version of OnTouch2 }; static jmp_buf error_jump; @@ -3338,6 +3340,12 @@ int script_config_read(char *cfgName) else if(strcmpi(w1,"input_max_value")==0) { script_config.input_max_value = config_switch(w2); } + else if(strcmpi(w1, "OnTouch_Label") == 0) { + safestrncpy(script_config.ontouch_name, w2, NAME_LENGTH); + } + else if(strcmpi(w1, "OnTouch2_Label") == 0) { + safestrncpy(script_config.ontouch2_name, w2, NAME_LENGTH); + } else if(strcmpi(w1,"import")==0){ script_config_read(w2); } @@ -4110,7 +4118,7 @@ BUILDIN_FUNC(areawarp) else if(!(index=mapindex_name2id(str))) return 0; - map_foreachinarea(buildin_areawarp_sub, m,x0,y0,x1,y1,BL_PC, index,x,y); + map_forsomeinarea(buildin_areawarp_sub, m,x0,y0,x1,y1,0,BL_PC, index,x,y); return 0; } @@ -4142,7 +4150,7 @@ BUILDIN_FUNC(areapercentheal) if( (m=map_mapname2mapid(mapname))< 0) return 0; - map_foreachinarea(buildin_areapercentheal_sub,m,x0,y0,x1,y1,BL_PC,hp,sp); + map_forsomeinarea(buildin_areapercentheal_sub,m,x0,y0,x1,y1,0,BL_PC,hp,sp); return 0; } @@ -8170,8 +8178,8 @@ BUILDIN_FUNC(areaannounce) if( (m=map_mapname2mapid(map))<0 ) return 0; - map_foreachinarea(buildin_mapannounce_sub, - m,x0,y0,x1,y1,BL_PC, str,strlen(str)+1,flag&0x10, color); + map_forsomeinarea(buildin_mapannounce_sub, + m,x0,y0,x1,y1,0,BL_PC, str,strlen(str)+1,flag&0x10, color); return 0; } @@ -8281,8 +8289,8 @@ BUILDIN_FUNC(getareausers) script_pushint(st,-1); return 0; } - map_foreachinarea(buildin_getareausers_sub, - m,x0,y0,x1,y1,BL_PC,&users); + map_forsomeinarea(buildin_getareausers_sub, + m,x0,y0,x1,y1,0,BL_PC,&users); script_pushint(st,users); return 0; } @@ -8328,8 +8336,8 @@ BUILDIN_FUNC(getareadropitem) script_pushint(st,-1); return 0; } - map_foreachinarea(buildin_getareadropitem_sub, - m,x0,y0,x1,y1,BL_ITEM,item,&amount); + map_forsomeinarea(buildin_getareadropitem_sub, + m,x0,y0,x1,y1,0,BL_ITEM,item,&amount); script_pushint(st,amount); return 0; } @@ -10639,7 +10647,7 @@ BUILDIN_FUNC(soundeffectall) int y0 = script_getnum(st,6); int x1 = script_getnum(st,7); int y1 = script_getnum(st,8); - map_foreachinarea(soundeffect_sub, map_mapname2mapid(map), x0, y0, x1, y1, BL_PC, name, type); + map_forsomeinarea(soundeffect_sub, map_mapname2mapid(map), x0, y0, x1, y1, 0, BL_PC, name, type); } else { -- cgit v1.2.3-60-g2f50