summaryrefslogtreecommitdiff
path: root/npc/functions/estate.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/estate.txt')
-rw-r--r--npc/functions/estate.txt15
1 files changed, 10 insertions, 5 deletions
diff --git a/npc/functions/estate.txt b/npc/functions/estate.txt
index 5eb508e1b..7a537e579 100644
--- a/npc/functions/estate.txt
+++ b/npc/functions/estate.txt
@@ -37,11 +37,12 @@ function script realestate_sellprice {
}
// This will toggle if mobilia was purchased or not, in the right group
-// realestate_togglemobilia ( estate_id, layer_id, object_id )
+// And as an added bonus, will tell the correct Script to reload NPCs
+// realestate_togglemobilia ( estate_id, layer_id, object_id{, npc_file} )
function script realestate_togglemobilia {
switch (getarg(1)) {
case 1:
- $ESTATE_MOBILIA_128[getarg(0)] = $ESTATE_MOBILIA_128[getarg(0)] ^ getarg(2);
+ $ESTATE_MOBILIA_64[getarg(0)] = $ESTATE_MOBILIA_64[getarg(0)] ^ getarg(2);
break;
case 2:
$ESTATE_MOBILIA_4[getarg(0)] = $ESTATE_MOBILIA_4[getarg(0)] ^ getarg(2);
@@ -53,7 +54,7 @@ function script realestate_togglemobilia {
$ESTATE_MOBILIA_32[getarg(0)] = $ESTATE_MOBILIA_32[getarg(0)] ^ getarg(2);
break;
case 5:
- $ESTATE_MOBILIA_64[getarg(0)] = $ESTATE_MOBILIA_64[getarg(0)] ^ getarg(2);
+ $ESTATE_MOBILIA_128[getarg(0)] = $ESTATE_MOBILIA_128[getarg(0)] ^ getarg(2);
break;
case 6:
$ESTATE_MOBILIA_2[getarg(0)] = $ESTATE_MOBILIA_2[getarg(0)] ^ getarg(2);
@@ -62,6 +63,10 @@ function script realestate_togglemobilia {
debugmes("[ERROR] [CRITICAL] [REAL ESTATE]: Object %d have Invalid Collision Type: %d (must range 1~6)", getarg(2), getarg(1));
break;
}
+ if (getarg(3, "error") != "error") {
+ // Reload NPCs on the meanwhile
+ donpcevent getarg(3)+"::OnReload";
+ }
return;
}
@@ -71,7 +76,7 @@ function script realestate_togglemobilia {
function script realestate_hasmobilia {
switch (getarg(1)) {
case 1:
- return $ESTATE_MOBILIA_128[getarg(0)] & getarg(2);
+ return $ESTATE_MOBILIA_64[getarg(0)] & getarg(2);
case 2:
return $ESTATE_MOBILIA_4[getarg(0)] & getarg(2);
case 3:
@@ -79,7 +84,7 @@ function script realestate_hasmobilia {
case 4:
return $ESTATE_MOBILIA_32[getarg(0)] & getarg(2);
case 5:
- return $ESTATE_MOBILIA_64[getarg(0)] & getarg(2);
+ return $ESTATE_MOBILIA_128[getarg(0)] & getarg(2);
case 6:
return $ESTATE_MOBILIA_2[getarg(0)] & getarg(2);
default: