When a i try to create a boat from a multi, he don't place the tillerman and gangplank as expected. Resulting in: syslog [pkg/multis/boat/boat.ecl]: [ERROR] [boat.src] No tillerman for boat at: 1553,1483,-5; destroying the boat...
ItemDesc.cfg
Code: Select all
Item 0x16027
{
Name smallboatdeed
Desc deed to a small boat
Graphic 0x14F2
Script shipdeed
cprop shiptype i69632
VendorSellsFor 25000
VendorBuysFor 25000
newbie 1
}
Item 0x16028
{
Name smalldragonboatdeed
Desc deed to a small dragon boat
Graphic 0x14F2
Script shipdeed
cprop shiptype i69636
VendorSellsFor 35000
VendorBuysFor 35000
newbie 1
}
Item 0x16029
{
Name mediumboatdeed
Desc deed to a medium boat
Graphic 0x14F2
Script shipdeed
cprop shiptype i69640
VendorSellsFor 50000
VendorBuysFor 50000
newbie 1
}
Item 0x1602A
{
Name mediumdragonboatdeed
Desc deed to a medium dragon boat
Graphic 0x14F2
Script shipdeed
cprop shiptype i69644
VendorSellsFor 60000
VendorBuysFor 60000
newbie 1
}
Item 0x1602B
{
Name largeboatdeed
Desc deed to a large boat
Graphic 0x14F2
Script shipdeed
cprop shiptype i69648
VendorSellsFor 80000
VendorBuysFor 80000
newbie 1
}
Item 0x1602C
{
Name largedragonboatdeed
Desc deed to a large dragon boat
Graphic 0x14F2
Script shipdeed
cprop shiptype i69652
VendorSellsFor 90000
VendorBuysFor 90000
newbie 1
}
Boat 0x11000
{
Name SmallBoat
MultiID 0x0000
OldObjtype 0x11001
OldObjtype 0x11002
OldObjtype 0x11003
}
Boat 0x11004
{
Name SmallDragonBoat
MultiID 0x0004
OldObjtype 0x11005
OldObjtype 0x11006
OldObjtype 0x11007
}
Boat 0x11008
{
Name MediumBoat
MultiID 0x0008
OldObjtype 0x11009
OldObjtype 0x1100a
OldObjtype 0x1100b
}
Boat 0x1100c
{
Name MediumDragonBoat
MultiID 0x000c
OldObjtype 0x1100d
OldObjtype 0x1100e
OldObjtype 0x1100f
}
Boat 0x11010
{
Name LargeBoat
MultiID 0x0010
OldObjtype 0x11011
OldObjtype 0x11012
OldObjtype 0x11013
}
Boat 0x11014
{
Name LargeDragonBoat
MultiID 0x0014
OldObjtype 0x11015
OldObjtype 0x11016
OldObjtype 0x11017
}
Item 0xF010
{
Name Tillerman
graphic 1
script tillerman
OldObjType 0xF010
}
Item 0xF011
{
Name gangplank
Graphic 1
Lockable 1
RequiresAttention 0
DoubleclickRange 20
Script plank
WalkOnScript plankWalk
ControlScript plankControl
OldObjType 0xF011
}
Item 0xF012
{
Name gangplank2
Graphic 1
Lockable 1
RequiresAttention 0
DoubleclickRange 20
Script plank
WalkOnScript plankWalk
ControlScript plankControl
OldObjType 0xF012
}
Code: Select all
#######################################################
### Small Boat - 0x0 to 0x3 ###
#######################################################
# Small Boat Facing North
Boat
{
MultiID 0x0
TillerMan 0x3e4e 1 4
PortGangplankExtended 0x3ed5 -2 0 0
PortGangplankRetracted 0x3eb1 -2 0 0
StarboardGangplankExtended 0x3ed4 2 0 0
StarboardGangplankRetracted 0x3eb2 2 0 0
Hold 0x3eae 0 -4 0
}
# Small Boat Facing East
Boat
{
MultiID 0x1
TillerMan 0x3e55 -4 0 0
PortGangplankExtended 0x3e89 0 -2 0
PortGangplankRetracted 0x3e8a 0 -2 0
StarboardGangplankExtended 0x3e84 0 2 0
StarboardGangplankRetracted 0x3e85 0 2 0
Hold 0x3e65 4 0 0
}
# Small Boat Facing South
Boat
{
MultiID 0x2
TillerMan 0x3e4b 0 -4 0
PortGangplankExtended 0x3ed4 2 0 0
PortGangplankRetracted 0x3eb2 2 0 0
StarboardGangplankExtended 0x3ed5 -2 0 0
StarboardGangplankRetracted 0x3eb1 -2 0 0
Hold 0x3eb9 0 4 0
}
# Small Boat Facing West
Boat
{
MultiID 0x3
TillerMan 0x3e50 4 0 0
PortGangplankExtended 0x3e84 0 2 0
PortGangplankRetracted 0x3e85 0 2 0
StarboardGangplankExtended 0x3e89 0 -2 0
StarboardGangplankRetracted 0x3e8a 0 -2 0
Hold 0x3e93 -4 0 0
}
#######################################################
### Small Dragon Boat - 0x4 to 0x7 ###
#######################################################
# Small Dragon Boat Facing North
Boat
{
MultiID 0x4
TillerMan 0x3e4e 1 4 0
PortGangplankExtended 0x3ed5 -2 0 0
PortGangplankRetracted 0x3eb1 -2 0 0
StarboardGangplankExtended 0x3ed4 2 0 0
StarboardGangplankRetracted 0x3eb2 2 0 0
Hold 0x3eae 0 -4 0
}
# Small Dragon Boat Facing East
Boat
{
MultiID 0x5
TillerMan 0x3e55 -4 0 0
PortGangplankExtended 0x3e89 0 -2 0
PortGangplankRetracted 0x3e8a 0 -2 0
StarboardGangplankExtended 0x3e84 0 2 0
StarboardGangplankRetracted 0x3e85 0 2 0
Hold 0x3e65 4 0 0
}
# Small Dragon Boat Facing South
Boat
{
MultiID 0x6
TillerMan 0x3e4b 0 -4 0
PortGangplankExtended 0x3ed4 2 0 0
PortGangplankRetracted 0x3eb2 2 0 0
StarboardGangplankExtended 0x3ed5 -2 0 0
StarboardGangplankRetracted 0x3eb1 -2 0 0
Hold 0x3eb9 0 4 0
}
# Small Dragon Boat Facing West
Boat
{
MultiID 0x7
TillerMan 0x3e50 4 0 0
PortGangplankExtended 0x3e84 0 2 0
PortGangplankRetracted 0x3e85 0 2 0
StarboardGangplankExtended 0x3e89 0 -2 0
StarboardGangplankRetracted 0x3e8a 0 -2 0
Hold 0x3e93 -4 0 0
}
#######################################################
### Medium Boat - 0x8 to 0xB ###
#######################################################
# Medium Boat Facing North
Boat
{
MultiID 0x8
TillerMan 0x3e4e 1 5 0
PortGangplankExtended 0x3ed5 -2 0 0
PortGangplankRetracted 0x3eb1 -2 0 0
StarboardGangplankExtended 0x3ed4 2 0 0
StarboardGangplankRetracted 0x3eb2 2 0 0
Hold 0x3eae 0 -4 0
}
# Medium Boat Facing East
Boat
{
MultiID 0x9
TillerMan 0x3e55 -5 0 0
PortGangplankExtended 0x3e89 0 -2 0
PortGangplankRetracted 0x3e8a 0 -2 0
StarboardGangplankExtended 0x3e84 0 2 0
StarboardGangplankRetracted 0x3e85 0 2 0
Hold 0x3e65 4 0 0
}
# Medium Boat Facing South
Boat
{
MultiID 0xA
TillerMan 0x3e4b 0 -5 0
PortGangplankExtended 0x3ed4 2 0 0
PortGangplankRetracted 0x3eb2 2 0 0
StarboardGangplankExtended 0x3ed5 -2 0 0
StarboardGangplankRetracted 0x3eb1 -2 0 0
Hold 0x3eb9 0 4 0
}
# Medium Boat Facing West
Boat
{
MultiID 0xB
TillerMan 0x3e50 5 0 0
PortGangplankExtended 0x3e84 0 2 0
PortGangplankRetracted 0x3e85 0 2 0
StarboardGangplankExtended 0x3e89 0 -2 0
StarboardGangplankRetracted 0x3e8a 0 -2 0
Hold 0x3e93 -4 0 0
}
#######################################################
### Medium Dragon Boat - 0xC to 0xF ###
#######################################################
# Medium Dragon Boat Facing North
Boat
{
MultiID 0xC
TillerMan 0x3e4e 1 5 0
PortGangplankExtended 0x3ed5 -2 0 0
PortGangplankRetracted 0x3eb1 -2 0 0
StarboardGangplankExtended 0x3ed4 2 0 0
StarboardGangplankRetracted 0x3eb2 2 0 0
Hold 0x3eae 0 -4 0
}
# Medium Dragon Boat Facing East
Boat
{
MultiID 0xD
TillerMan 0x3e55 -5 0 0
PortGangplankExtended 0x3e89 0 -2 0
PortGangplankRetracted 0x3e8a 0 -2 0
StarboardGangplankExtended 0x3e84 0 2 0
StarboardGangplankRetracted 0x3e85 0 2 0
Hold 0x3e65 4 0 0
}
# Medium Dragon Boat Facing South
Boat
{
MultiID 0xE
TillerMan 0x3e4b 0 -5 0
PortGangplankExtended 0x3ed4 2 0 0
PortGangplankRetracted 0x3eb2 2 0 0
StarboardGangplankExtended 0x3ed5 -2 0 0
StarboardGangplankRetracted 0x3eb1 -2 0 0
Hold 0x3eb9 0 4 0
}
# Medium Dragon Boat Facing West
Boat
{
MultiID 0xF
TillerMan 0x3e50 5 0 0
PortGangplankExtended 0x3e84 0 2 0
PortGangplankRetracted 0x3e85 0 2 0
StarboardGangplankExtended 0x3e89 0 -2 0
StarboardGangplankRetracted 0x3e8a 0 -2 0
Hold 0x3e93 -4 0 0
}
#######################################################
### Long Boat - 0x10 to 0x13 ###
#######################################################
# Long Boat Facing North
Boat
{
MultiID 0x10
TillerMan 0x3e4e 1 5 0
PortGangplankExtended 0x3ed5 -2 -1 0
PortGangplankRetracted 0x3eb1 -2 -1 0
StarboardGangplankExtended 0x3ed4 2 -1 0
StarboardGangplankRetracted 0x3eb2 2 -1 0
Hold 0x3eae 0 -5 0
}
# Long Boat Facing East
Boat
{
MultiID 0x11
TillerMan 0x3e55 -5 0 0
PortGangplankExtended 0x3e89 1 -2 0
PortGangplankRetracted 0x3e8a 1 -2 0
StarboardGangplankExtended 0x3e84 1 2 0
StarboardGangplankRetracted 0x3e85 1 2 0
Hold 0x3e65 5 0 0
}
# Long Boat Facing South
Boat
{
MultiID 0x12
TillerMan 0x3e4b 0 -5 0
PortGangplankExtended 0x3ed4 2 1 0
PortGangplankRetracted 0x3eb2 2 1 0
StarboardGangplankExtended 0x3ed5 -2 1 0
StarboardGangplankRetracted 0x3eb1 -2 1 0
Hold 0x3eb9 0 5 0
}
# Long Boat Facing West
Boat
{
MultiID 0x13
TillerMan 0x3e50 5 0 0
PortGangplankExtended 0x3e84 -1 2 0
PortGangplankRetracted 0x3e85 -1 2 0
StarboardGangplankExtended 0x3e89 -1 -2 0
StarboardGangplankRetracted 0x3e8a -1 -2 0
Hold 0x3e93 -5 0 0
}
#######################################################
### Long Dragon Boat - 0x14 to 0x17 ###
#######################################################
# Long Dragon Boat Facing North
Boat
{
MultiID 0x14
TillerMan 0x3e4e 1 5 0
PortGangplankExtended 0x3ed5 -2 -1 0
PortGangplankRetracted 0x3eb1 -2 -1 0
StarboardGangplankExtended 0x3ed4 2 -1 0
StarboardGangplankRetracted 0x3eb2 2 -1 0
Hold 0x3eae 0 -5 0
}
# Long Dragon Boat Facing East
Boat
{
MultiID 0x15
TillerMan 0x3e55 -5 0 0
PortGangplankExtended 0x3e89 1 -2 0
PortGangplankRetracted 0x3e8a 1 -2 0
StarboardGangplankExtended 0x3e84 1 2 0
StarboardGangplankRetracted 0x3e85 1 2 0
Hold 0x3e65 5 0 0
}
# Long Dragon Boat Facing South
Boat
{
MultiID 0x16
TillerMan 0x3e4b 0 -5 0
PortGangplankExtended 0x3ed4 2 1 0
PortGangplankRetracted 0x3eb2 2 1 0
StarboardGangplankExtended 0x3ed5 -2 1 0
StarboardGangplankRetracted 0x3eb1 -2 1 0
Hold 0x3eb9 0 5 0
}
# Long Dragon Boat Facing West
Boat
{
MultiID 0x17
TillerMan 0x3e50 5 0 0
PortGangplankExtended 0x3e84 -1 2 0
PortGangplankRetracted 0x3e85 -1 2 0
StarboardGangplankExtended 0x3e89 -1 -2 0
StarboardGangplankRetracted 0x3e8a -1 -2 0
Hold 0x3e93 -5 0 0
}
Code: Select all
use uo;
use os;
include ":keys:key";
program useshipdeed( character, deed )
if (DeedAlreadyBuiltFrom (deed))
PrintTextAbovePrivate( deed, "That ship has already been built.", character );
return;
endif
if (!ReserveItem (deed))
SendSysMessage (character, "You can't use that right now!");
return;
endif
if (character.x > 5120)
SendSysMessage (character, "You can't place a boat here!");
if (!character.cmdlevel)
return;
endif
SendSysMessage (character, "But since you're a GM, I'll forgive you.");
endif
var shiptype := GetObjProperty (deed, "shiptype");
if (!shiptype)
PrintTextAbovePrivate (deed, "That ship deed appears to be broken.", character);
return;
endif
var facing := GetShipCreationFacing (character);
var where := TargetMultiPlacement (character, shiptype, facing);
if (!where)
if ( deed.graphic == 5363 )
deed.graphic := 5364;
elseif ( deed.graphic == 5364 )
deed.graphic := 5363;
else
SendSysMessage (character, "Canceled.");
endif
return;
endif
if (character.x > 5120)
SendSysMessage (character, "You can't place a boat here!");
if (!character.cmdlevel)
return;
endif
SendSysMessage (character, "But since you're a GM, I'll forgive you.");
endif
if (where.x == deed.x and where.y == deed.y)
if ( deed.graphic == 5363 )
deed.graphic := 5364;
elseif ( deed.graphic == 5364 )
deed.graphic := 5363;
endif
return;
endif
set_critical( 1 );
if (where.x < character.x-7 or where.y < character.y-7 or
where.x > character.x+7 or where.y > character.y+7)
SendSysMessage (character, "That's too far away!");
if ( deed.graphic == 5363 )
deed.graphic := 5364;
elseif ( deed.graphic == 5364 )
deed.graphic := 5363;
endif
return;
endif
if (!CheckLOSAt (character, where.x, where.y, where.z) )
SendSysMessage (character, "You can't see that!");
if ( deed.graphic == 5363 )
deed.graphic := 5364;
elseif ( deed.graphic == 5364 )
deed.graphic := 5363;
endif
return;
endif
var created := CreateShipKeysAndBuiltDeed (character, shiptype, where.x, where.y, where.z, where.realm);
if (!created)
if ( deed.graphic == 5363 )
deed.graphic := 5364;
elseif ( deed.graphic == 5364 )
deed.graphic := 5363;
endif
return;
endif
created.ship.color := deed.color;
foreach compo in (created.ship.hull)
compo.color := deed.color;
endforeach
foreach compo in (created.ship.wheel)
compo.color := deed.color;
endforeach
foreach compo in (created.ship.sails)
compo.color := deed.color;
endforeach
foreach compo in (created.ship.storage)
compo.color := deed.color;
endforeach
foreach compo in (created.ship.weaponslot)
compo.color := deed.color;
endforeach
var deedtype := deed.objtype;
if (deed.name != "a toy boat" and !deed.name["deed"])
created.ship.tillerman.name := deed.name;
created.packkey.name := "a key for " + deed.name;
else
created.packkey.name := "a boat key";
endif
DestroyItem (deed);
created.ship.starboardplank.locked := 1;
created.ship.portplank.locked := 1;
created.ship.hold.locked := 1;
var lockid := AllocLockId();
SetObjProperty (created.ship.starboardplank, "lockid", lockid );
SetObjProperty (created.ship.portplank, "lockid", lockid );
SetObjProperty (created.ship.hold, "lockid", lockid );
SetObjProperty (created.ship.hold, "owner", character.serial );
SetObjProperty (created.ship.hold, "shiptype", deedtype );
SetObjProperty (created.ship.tillerman, "owner", character.serial );
SetObjProperty (created.packkey, "lockid", lockid );
created.ship.tillerman.usescript := ":boat:tillerman";
endprogram
function GetShipCreationFacing (character)
case (character.facing)
0:
1:
return CRMULTI_FACING_NORTH;
2:
3:
return CRMULTI_FACING_EAST;
4:
5:
return CRMULTI_FACING_SOUTH;
6:
7:
return CRMULTI_FACING_WEST;
endcase
return CRMULTI_FACING_NORTH;
endfunction
function CreateShipKeysAndBuiltDeed( character, shiptype, x, y, z, rlm )
var packkey := CreateItemInBackpack (character, 0x100E);
if (!packkey)
PrintTextAbovePrivate (character, "My backpack is too full!", character);
return 0;
endif
var facing := GetShipCreationFacing (character);
var ship := CreateMultiAtLocation (x, y, z, shiptype, facing, rlm);
if (!ship)
PrintTextAbovePrivate( character, "I can't place the ship there!!", character );
DestroyItem( packkey );
return 0;
endif
SetObjProperty( ship.hold,"owner", character.serial );
if(!getObjProperty (ship.hold,"owner"))
PrintTextAbovePrivate (character, "I can't place the ship there.", character);
DestroyItem (packkey);
return 0;
endif
var result := array {};
result.+packkey := packkey;
result.+ship := ship;
sendsysmessage (character, "All aboard!");
var sh := GetStandingHeight (ship.x, ship.y, ship.z, ship.realm);
MoveObjectToLocation( character, ship.x, ship.y, sh.z, ship.realm, MOVEOBJECT_FORCELOCATION );
return result;
endfunction
function DeedAlreadyBuiltFrom( deed )
if (GetObjProperty( deed, "builtserial" ))
return 1;
else
return 0;
endif
endfunction