Skip to content

Commit ced9b8a

Browse files
Add support for custom housing (#154)
* Initial commit with some placeholders. closecustomhouse.src from Agata WOD files: https://github.com/agata-wod/wod * WIP - gump placements etc "working". House menu allows for customize house gump. Haven't done any further testing from there. * Fixed issue with incorrectly named script in config file. * Add CustomHouseCommitScript * Fix includes, formatting in CustomHouseCommitScript * some updates to support master --------- Co-authored-by: Jonathan Morland-Barrett <jmorland.barrett@gmail.com>
1 parent 7959d2c commit ced9b8a

17 files changed

Lines changed: 3544 additions & 3 deletions

File tree

pkg/items/alchSymbol/pkg.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
#
44

5-
Enabled 1
5+
Enabled 0
66
Name alchSymbol
77

88
Version 1.0

pkg/items/anvil/config/itemdesc.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,63 @@ Item 0x0FAF
33
Name anvil
44
Desc Anvil
55
MethodScript anvil/method
6+
Graphic 0x0FAF
67
}
78

89
Item 0x0FB0
910
{
1011
Name anvil2
1112
Desc Anvil
1213
MethodScript anvil/method
14+
Graphic 0x0FB0
1315
}
1416

1517
Item 0x2DD5
1618
{
1719
Name ElvenAnvilSouth
1820
Desc Elven Anvil
1921
MethodScript anvil/method
22+
Graphic 0x2DD5
2023
}
2124

2225
Item 0x2DD6
2326
{
2427
Name ElvenAnvilEast
2528
Desc Elven Anvil
2629
MethodScript anvil/method
30+
Graphic 0x2DD6
2731
}
2832

2933
Item 0x4254
3034
{
3135
Name soulforgeanvil1
3236
Desc soul forge anvil
3337
MethodScript anvil/method
38+
Graphic 0x4254
3439
}
3540

3641
Item 0x4255
3742
{
3843
Name soulforgeanvil2
3944
Desc soul forge anvil
4045
MethodScript anvil/method
46+
Graphic 0x4255
4147
}
4248

4349
Item 0x4256
4450
{
4551
Name soulforgeanvil3
4652
Desc soul forge anvil
4753
MethodScript anvil/method
54+
Graphic 0x4256
4855
}
4956

5057
Item 0x4257
5158
{
5259
Name soulforgeanvil4
5360
Desc soul forge anvil
5461
MethodScript anvil/method
62+
Graphic 0x4257
5563
}
5664

5765

pkg/items/doors/include/doors.inc

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ use uo;
33
use util;
44
use cfgfile;
55

6+
include "include/client";
67
include ":keys:key";
78

9+
var doordesc := ReadConfigFile (":doors:itemdesc");
10+
811
// New requried functions.....
912
// Checks to see if the item can be used...
1013
function CanUseDoor( byref mobile, byref door )
@@ -75,3 +78,80 @@ function IsOccupied( item )
7578

7679
return ListMobilesNearLocationEX( x, y, item.z, 0, LISTEX_FLAG_HIDDEN+LISTEX_FLAG_NORMAL, item.realm );
7780
endfunction
81+
82+
///////////////////
83+
// closes the given door, ignoring locked status
84+
///////////////////
85+
86+
function CloseDoor (door)
87+
if (door.graphic == door.objtype)
88+
return;
89+
endif
90+
91+
var xmod := CINT (doordesc[door.objtype].xmod);
92+
var ymod := CINT (doordesc[door.objtype].ymod);
93+
94+
var newx := door.x - xmod;
95+
var newy := door.y - ymod;
96+
if (GetObjProperty (door, "x"))
97+
newx := GetObjProperty (door, "x");
98+
newy := GetObjProperty (door, "y");
99+
EraseObjProperty (door, "x");
100+
EraseObjProperty (door, "y");
101+
endif
102+
103+
var newz := door.z;
104+
var newr := door.realm;
105+
if (door.graphic != door.objtype)
106+
set_critical (1);
107+
door.movable := 1;
108+
door.graphic := door.objtype;
109+
MoveObjectToLocation( door, newx, newy, newz, newr, flags :=MOVEOBJECT_FORCELOCATION );
110+
door.movable := 0;
111+
set_critical (0);
112+
PlayDoorCloseSound (door);
113+
endif
114+
endfunction
115+
116+
///////////////////
117+
// plays the sound effect for opening the door
118+
///////////////////
119+
120+
function PlayDoorOpenSound (door)
121+
case (doordesc[door.objtype].doortype)
122+
"wood":
123+
PlaySoundEffect (door, SFX_OPEN_WOODEN_DOOR);
124+
"stone":
125+
PlaySoundEffect (door, SFX_OPEN_STONE_DOOR);
126+
"metal":
127+
PlaySoundEffect (door, SFX_OPEN_METAL_DOOR);
128+
"sliding":
129+
PlaySoundEffect (door, SFX_OPEN_SLIDING_DOOR);
130+
default:
131+
PlaySoundEffect (door, SFX_OPEN_METAL_DOOR);
132+
endcase
133+
endfunction
134+
135+
136+
137+
138+
///////////////////
139+
// plays the sound effect for closing the door
140+
///////////////////
141+
142+
function PlayDoorCloseSound (door)
143+
case (doordesc[door.objtype].doortype)
144+
"wood":
145+
PlaySoundEffect (door, SFX_CLOSE_WOODEN_DOOR);
146+
"stone":
147+
PlaySoundEffect (door, SFX_CLOSE_STONE_DOOR);
148+
"metal":
149+
PlaySoundEffect (door, SFX_CLOSE_METAL_DOOR);
150+
"sliding":
151+
PlaySoundEffect (door, SFX_CLOSE_SLIDING_DOOR);
152+
default:
153+
PlaySoundEffect (door, SFX_CLOSE_METAL_DOOR);
154+
endcase
155+
endfunction
156+
157+

pkg/servmgmt/www/script_profiles.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ program HTMLPage()
4343

4444
foreach profile in ( core.script_profiles )
4545
WriteHTML("<TR>");
46-
WriteHTML("<TD>"+profile.name+"</TD><TD>"+profile.instr+"</TD><TD>"+profile.invocations+"</TD><TD>"+profile.instr_per_invoc+"</TD><TD>"+profile.instr_percent+"%</TD>");
46+
WriteHTML("<TD>"+profile.name+"</TD><TD>"+profile.instr+"</TD><TD>"+profile.invocations+"</TD><TD>"+profile.instr_per_invoc+"</TD><TD>"+cdbl(profile.instr_percent)+"%</TD>");
4747
WriteHTML("</TR>");
4848
SleepMS(2);
4949
endforeach
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# $Id: icp.cfg 375 2006-06-17 19:26:32Z austinheilman $
2+
#
3+
#
4+
ICP Register
5+
{
6+
Name Custom Housing
7+
Version 1.0
8+
Description Custom housing scripts that allow for player placed housing to be customized.
9+
10+
Creator POL Distro Team
11+
C_Email poldistro@polserver.com
12+
13+
Maintainer POL Distro Team
14+
M_Email distro@polserver.com
15+
16+
#Script cmdlevel path
17+
18+
#TextCmd cmdlevel path
19+
20+
}

0 commit comments

Comments
 (0)