Suggestion: checkwall script command (#3393)
* Added checkwall script command - Included the checkwall in npc folder
This commit is contained in:
parent
9cba66c22e
commit
3d8104d7fb
@ -8660,6 +8660,12 @@ same as NPC sprite facing directions: 0=north, 1=northwest, 2=west, etc.
|
||||
|
||||
---------------------------------------
|
||||
|
||||
*checkwall "<name>";
|
||||
|
||||
This command will return true if the wall with the given name exists, false otherwise.
|
||||
|
||||
---------------------------------------
|
||||
|
||||
*readbook <book id>,<page>;
|
||||
|
||||
This command will open a book item at the specified page.
|
||||
|
@ -208,7 +208,8 @@ OnEnable:
|
||||
|
||||
OnKill:
|
||||
killmonster "bat_a01","barricade#bat_a01_a::OnMyMobDead";
|
||||
delwall "bat_a01_c1";
|
||||
if (checkwall("bat_a01_c1") == true)
|
||||
delwall "bat_a01_c1";
|
||||
end;
|
||||
|
||||
OnMyMobDead:
|
||||
@ -230,7 +231,8 @@ OnEnable:
|
||||
|
||||
OnKill:
|
||||
killmonster "bat_a01","barricade#bat_a01_b::OnMyMobDead";
|
||||
delwall "bat_a01_g1";
|
||||
if (checkwall("bat_a01_g1") == true)
|
||||
delwall "bat_a01_g1";
|
||||
end;
|
||||
|
||||
OnMyMobDead:
|
||||
|
@ -207,7 +207,8 @@ OnEnable:
|
||||
|
||||
OnKill:
|
||||
killmonster "bat_a02","barricade#bat_a02_a::OnMyMobDead";
|
||||
delwall "bat_a02_c1";
|
||||
if (checkwall("bat_a02_c1") == true)
|
||||
delwall "bat_a02_c1";
|
||||
end;
|
||||
|
||||
OnMyMobDead:
|
||||
@ -229,7 +230,8 @@ OnEnable:
|
||||
|
||||
OnKill:
|
||||
killmonster "bat_a02","barricade#bat_a02_b::OnMyMobDead";
|
||||
delwall "bat_a02_g1";
|
||||
if (checkwall("bat_a02_g1") == true)
|
||||
delwall "bat_a02_g1";
|
||||
end;
|
||||
|
||||
OnMyMobDead:
|
||||
|
@ -275,7 +275,8 @@ OnBuild:
|
||||
|
||||
OnDestroy:
|
||||
killmonster "bat_a01","Guillaume_TV1B::OnWall";
|
||||
delwall "bat_a01_g1";
|
||||
if (checkwall("bat_a01_g1") == true)
|
||||
delwall "bat_a01_g1";
|
||||
set .MyMobCount,0;
|
||||
end;
|
||||
|
||||
|
@ -275,7 +275,8 @@ OnBuild:
|
||||
|
||||
OnDestroy:
|
||||
killmonster "bat_a02","Guillaume_TV2B::OnWall";
|
||||
delwall "bat_a02_g1";
|
||||
if (checkwall("bat_a02_g1") == true)
|
||||
delwall "bat_a02_g1";
|
||||
set .MyMobCount,0;
|
||||
end;
|
||||
|
||||
|
@ -1700,7 +1700,9 @@ OnBarrierDestroyed:
|
||||
end;
|
||||
|
||||
OnDisable:
|
||||
delwall substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9)+"_"+strnpcinfo(1);
|
||||
.@wall_name$ = substr(strnpcinfo(2),0,1) + substr(strnpcinfo(2),8,9) + "_" + strnpcinfo(1);
|
||||
if (checkwall(.@wall_name$) == true)
|
||||
delwall .@wall_name$;
|
||||
killmonster strnpcinfo(2),strnpcinfo(0)+"::OnBarrierDestroyed";
|
||||
end;
|
||||
}
|
||||
|
@ -3228,6 +3228,11 @@ void map_setgatcell(int16 m, int16 x, int16 y, int gat)
|
||||
*------------------------------------------*/
|
||||
static DBMap* iwall_db;
|
||||
|
||||
bool map_iwall_exist(const char* wall_name)
|
||||
{
|
||||
return strdb_exists(iwall_db, wall_name);
|
||||
}
|
||||
|
||||
void map_iwall_nextxy(int16 x, int16 y, int8 dir, int pos, int16 *x1, int16 *y1)
|
||||
{
|
||||
if( dir == 0 || dir == 4 )
|
||||
|
@ -1098,6 +1098,7 @@ int cleanup_sub(struct block_list *bl, va_list ap);
|
||||
int map_delmap(char* mapname);
|
||||
void map_flags_init(void);
|
||||
|
||||
bool map_iwall_exist(const char* wall_name);
|
||||
bool map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable, const char* wall_name);
|
||||
void map_iwall_get(struct map_session_data *sd);
|
||||
bool map_iwall_remove(const char *wall_name);
|
||||
|
@ -13327,6 +13327,14 @@ BUILDIN_FUNC(delwall)
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
}
|
||||
|
||||
BUILDIN_FUNC(checkwall)
|
||||
{
|
||||
const char *wall_name = script_getstr(st, 2);
|
||||
|
||||
script_pushint(st, map_iwall_exist(wall_name));
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
}
|
||||
|
||||
/// Retrieves various information about the specified guardian.
|
||||
///
|
||||
/// guardianinfo("<map_name>", <index>, <type>) -> <value>
|
||||
@ -24267,6 +24275,7 @@ struct script_function buildin_func[] = {
|
||||
BUILDIN_DEF(getfreecell,"srr?????"),
|
||||
BUILDIN_DEF(setwall,"siiiiis"),
|
||||
BUILDIN_DEF(delwall,"s"),
|
||||
BUILDIN_DEF(checkwall,"s"),
|
||||
BUILDIN_DEF(searchitem,"rs"),
|
||||
BUILDIN_DEF(mercenary_create,"ii"),
|
||||
BUILDIN_DEF(mercenary_heal,"ii"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user