Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv4263/src
Modified Files:
dbl_single_click.cpp house.cpp items.cpp prototypes.h
targetrequests.cpp wolfpack.cpp
Log Message:
Removed door code from the core.
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.213
retrieving revision 1.214
diff -C2 -d -r1.213 -r1.214
*** dbl_single_click.cpp 21 Aug 2003 22:34:38 -0000 1.213
--- dbl_single_click.cpp 23 Aug 2003 15:20:29 -0000 1.214
***************
*** 312,328 ****
// End Boats --^
return;
-
- case 2: // Order gates?
- return;// order gates
- case 4: // Chaos gates?
- return;// chaos gates
- case 6: // teleport item (ring?)
- return;// case 6
- case 7: // key
- return;// case 7 (keys)
- case 8: // locked item spawner
- pc_currchar->setObjectDelay( 0 );
- socket->sysMessage( tr("This item is locked.") );
- return;// case 8/64 (locked container)
// Book
--- 312,315 ----
***************
*** 336,385 ****
}
return;
! }
! case 12: // door(unlocked)
! pc_currchar->setObjectDelay( 0 );
! dooruse( socket, pi );
! return;
! case 13: // locked door
! {
! if( pi->multis() != INVALID_SERIAL )
! {
! cMulti* pMulti = dynamic_cast< cMulti* >( FindItemBySerial( pi->multis() ) );
! if( pMulti )
! {
! if( pMulti->authorized( pc_currchar ) )
! {
! socket->sysMessage( tr( "You quickly unlock, use, and then relock the door." ) );
! pc_currchar->setObjectDelay( 0 );
! dooruse( socket, pi );
! return;
! }
! }
! }
! else
! {
! P_ITEM pPack = pc_currchar->getBackpack();
! if( pPack )
! {
! cItem::ContainerContent container = pPack->content();
! cItem::ContainerContent::const_iterator it(container.begin());
! for( ; it != container.end(); ++it )
! {
! P_ITEM pj = *it;
! if( pj && pj->type() == 7 &&
! pj->tags().get( "linkserial" ).isValid() && pj->tags().get( "linkserial" ).toInt() == pi->serial() )
! {
! socket->sysMessage( tr( "You quickly unlock, use, and then relock the door." ) );
! pc_currchar->setObjectDelay( 0 );
! dooruse( socket, pi );
! return;
! }
! }
! }
! }
!
! socket->sysMessage( tr( "This door is locked." ) );
! return;
! }
// Food, OSI style
--- 323,327 ----
}
return;
! }
// Food, OSI style
Index: house.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/house.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -C2 -d -r1.111 -r1.112
*** house.cpp 20 Aug 2003 17:10:48 -0000 1.111
--- house.cpp 23 Aug 2003 15:20:29 -0000 1.112
***************
*** 202,206 ****
void cHouse::build( const cElement *Tag, UI16 posx, UI16 posy, SI08 posz, SERIAL senderserial, SERIAL deedserial )
{
! P_PLAYER pc_currchar = dynamic_cast<P_PLAYER>(FindCharBySerial( senderserial ));
if ( !pc_currchar )
return;
--- 202,206 ----
void cHouse::build( const cElement *Tag, UI16 posx, UI16 posy, SI08 posz, SERIAL senderserial, SERIAL deedserial )
{
! P_PLAYER pc_currchar = dynamic_cast<P_PLAYER>( FindCharBySerial( senderserial ) );
if ( !pc_currchar )
return;
***************
*** 219,225 ****
socket->sysMessage( tr("Can not build a house at this location!") );
this->remove();
- this->remove();
return;
}
this->update();
--- 219,225 ----
socket->sysMessage( tr("Can not build a house at this location!") );
this->remove();
return;
}
+
this->update();
***************
*** 229,235 ****
if( !nokey_ )
! createKeys( pc_currchar, tr("house key") );
! RegionIterator4Items ri(this->pos());
for(ri.Begin(); !ri.atEnd(); ri++)
{
--- 229,235 ----
if( !nokey_ )
! createKeys( pc_currchar, tr( "house key" ) );
! RegionIterator4Items ri( this->pos() );
for(ri.Begin(); !ri.atEnd(); ri++)
{
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.333
retrieving revision 1.334
diff -C2 -d -r1.333 -r1.334
*** items.cpp 23 Aug 2003 01:03:31 -0000 1.333
--- items.cpp 23 Aug 2003 15:20:29 -0000 1.334
***************
*** 2570,2574 ****
// Flags
! else GET_PROPERTY( "decay", priv_ & 0x01 ? 1 : 0 )
else GET_PROPERTY( "newbie", priv_ & 0x02 ? 1 : 0 )
else GET_PROPERTY( "dispellable", priv_ & 0x04 ? 1 : 0 )
--- 2570,2574 ----
// Flags
! else GET_PROPERTY( "decay", priv_ & 0x01 ? 0 : 1 )
else GET_PROPERTY( "newbie", priv_ & 0x02 ? 1 : 0 )
else GET_PROPERTY( "dispellable", priv_ & 0x04 ? 1 : 0 )
Index: prototypes.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/prototypes.h,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -d -r1.101 -r1.102
*** prototypes.h 20 Aug 2003 17:10:48 -0000 1.101
--- prototypes.h 23 Aug 2003 15:20:29 -0000 1.102
***************
*** 60,64 ****
int getamount(P_CHAR pc, short id);
void delequan(P_CHAR pc, short id, int amount, int *not_deleted = NULL);
- void dooruse( cUOSocket*, P_ITEM );
void playmonstersound(P_CHAR monster, unsigned short id, int sfx);
void sellaction(int s);
--- 60,63 ----
Index: targetrequests.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -d -r1.71 -r1.72
*** targetrequests.cpp 20 Aug 2003 17:10:48 -0000 1.71
--- targetrequests.cpp 23 Aug 2003 15:20:29 -0000 1.72
***************
*** 161,171 ****
bool cBuildMultiTarget::responsed( cUOSocket *socket, cUORxTarget *target )
{
! if( target->x() & 0xFFFF || target->y() & 0xFFFF || target->z() & 0xFF )
return true;
const cElement* DefSection = DefManager->getDefinition( WPDT_MULTI, multisection_ );
if( !DefSection )
return true;
if( DefSection->getAttribute( "type" ) == "house" )
--- 161,177 ----
bool cBuildMultiTarget::responsed( cUOSocket *socket, cUORxTarget *target )
{
! if( target->x() == 0xFFFF || target->y() == 0xFFFF || target->z() == 0xFF )
! {
! socket->sysMessage( "Invalid target." );
return true;
+ }
const cElement* DefSection = DefManager->getDefinition( WPDT_MULTI, multisection_ );
if( !DefSection )
+ {
+ socket->sysMessage( "Invalid multisection." );
return true;
+ }
if( DefSection->getAttribute( "type" ) == "house" )
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.436
retrieving revision 1.437
diff -C2 -d -r1.436 -r1.437
*** wolfpack.cpp 20 Aug 2003 17:10:48 -0000 1.436
--- wolfpack.cpp 23 Aug 2003 15:20:29 -0000 1.437
***************
*** 209,467 ****
}
- // Plays the proper door sfx for doors/gates/secretdoors
- static void doorsfx(P_ITEM pi, int x, int y)
- {
- const int OPENWOOD = 0x00EA;
- const int OPENGATE = 0x00EB;
- const int OPENSTEEL = 0x00EC;
- const int OPENSECRET = 0x00ED;
- const int CLOSEWOOD = 0x00F1;
- const int CLOSEGATE = 0x00F2;
- const int CLOSESTEEL = 0x00F3;
- const int CLOSESECRET = 0x00F4;
-
- if (y==0) // Request open door sfx
- {
- if (((x>=0x0695)&&(x<0x06C5))|| // Open wooden / ratan door
- ((x>=0x06D5)&&(x<=0x06F4)))
- pi->soundEffect( OPENWOOD );
-
- else if (((x>=0x0839)&&(x<=0x0848))|| // Open gate
- ((x>=0x084C)&&(x<=0x085B))||
- ((x>=0x0866)&&(x<=0x0875)))
- pi->soundEffect( OPENGATE );
-
- else if (((x>=0x0675)&&(x<0x0695))|| // Open metal
- ((x>=0x06C5)&&(x<0x06D5)))
- pi->soundEffect( OPENSTEEL );
-
- else if ((x>=0x0314)&&(x<=0x0365)) // Open secret
- pi->soundEffect( OPENSECRET );
- }
- else if (y==1) // Request close door sfx
- {
- if (((x>=0x0695)&&(x<0x06C5))|| // close wooden / ratan door
- ((x>=0x06D5)&&(x<=0x06F4)))
- pi->soundEffect( CLOSEWOOD );
-
- else if (((x>=0x0839)&&(x<=0x0848))|| // close gate
- ((x>=0x084C)&&(x<=0x085B))||
- ((x>=0x0866)&&(x<=0x0875)))
- pi->soundEffect( CLOSEGATE );
-
- else if (((x>=0x0675)&&(x<0x0695))|| // close metal
- ((x>=0x06C5)&&(x<0x06D5)))
- pi->soundEffect( CLOSESTEEL );
-
- else if ((x>=0x0314)&&(x<=0x0365)) // close secret
- pi->soundEffect( CLOSESECRET );
- }
- }
-
- void dooruse( cUOSocket *socket, P_ITEM pi )
- {
- if( !pi )
- return;
- #pragma fixme("dunno how to replace the old tempeffect2, commented out but this introduces a bug here!! please review.")
- if( socket && socket->player() && !socket->player()->inRange( pi, 2 ) )
- {
- socket->sysMessage( tr( "You cannot reach the handle from here." ) );
- return;
- }
-
- UINT16 x = pi->id();
- UINT16 db;
-
- for( UINT32 i = 0; i < DOORTYPES; ++i )
- {
- db = doorbase[i];
-
- if( x == ( db + 0 ) )
- {
- pi->setId( pi->id() + 1 );
- Coord_cl pos( pi->pos() );
- pos.x--;
- pos.y++;
- pi->moveTo( pos );
- doorsfx(pi, x, 0);
- // tempeffect2(0, pi, 13, 0, 0, 0);
- }
- else if( x == ( db + 1 ) )
- {
- pi->setId( pi->id() - 1 );
- Coord_cl pos( pi->pos() );
- pos.x++;
- pos.y--;
- pi->moveTo( pos );
- doorsfx(pi, x, 1);
- pi->setDoorOpen(0);
- }
- else if (x==(db+2))
- {
- pi->setId( pi->id() + 1 );
- Coord_cl pos( pi->pos() );
- pos.x++;
- pos.y++;
- pi->moveTo( pos );
- doorsfx(pi, x, 0);
- // tempeffect2(0, pi, 13, 0, 0, 0);
- }
- else if (x==(db+3))
- {
- pi->setId( pi->id() - 1 );
- Coord_cl pos( pi->pos() );
- pos.x--;
- pos.y--;
- pi->moveTo( pos );
- doorsfx(pi, x, 1);
- pi->setDoorOpen(0);
- }
- else if (x==(db+4))
- {
- pi->setId( pi->id() + 1 );
- Coord_cl pos( pi->pos() );
- pos.x--;
- pi->moveTo( pos );
- doorsfx(pi, x, 0);
- // tempeffect2(0, pi, 13, 0, 0, 0);
- }
- else if (x==(db+5))
- {
- pi->setId( pi->id() - 1 );
- Coord_cl pos( pi->pos() );
- pos.x++;
- pi->moveTo( pos );
- doorsfx(pi, x, 1);
- pi->setDoorOpen(0);
- }
- else if (x==(db+6))
- {
- pi->setId( pi->id() + 1 );
- Coord_cl pos( pi->pos() );
- pos.x++;
- pos.y--;
- pi->moveTo( pos );
- doorsfx(pi, x, 0);
- // tempeffect2(0, pi, 13, 0, 0, 0);
- }
- else if (x==(db+7))
- {
- pi->setId( pi->id() - 1 );
- Coord_cl pos( pi->pos() );
- pos.x--;
- pos.y++;
- pi->moveTo( pos );
- doorsfx(pi, x, 1);
- pi->setDoorOpen(0);
- }
- else if (x==(db+8))
- {
- pi->setId( pi->id() + 1 );
- Coord_cl pos( pi->pos() );
- pos.x++;
- pos.y++;
- pi->moveTo( pos );
- doorsfx(pi, x, 0);
- // tempeffect2(0, pi, 13, 0, 0, 0);
- }
- else if (x==(db+9))
- {
- pi->setId( pi->id() - 1 );
- Coord_cl pos( pi->pos() );
- pos.x--;
- pos.y--;
- pi->moveTo( pos );
- doorsfx(pi, x, 1);
- pi->setDoorOpen(0);
- }
- else if (x==(db+10))
- {
- pi->setId( pi->id() + 1 );
- Coord_cl pos( pi->pos() );
- pos.x++;
- pos.y--;
- pi->moveTo( pos );
- doorsfx(pi, x, 0);
- // tempeffect2(0, pi, 13, 0, 0, 0);
- }
- else if (x==(db+11))
- {
- pi->setId( pi->id() - 1 );
- Coord_cl pos( pi->pos() );
- pos.x--;
- pos.y++;
- pi->moveTo( pos );
- doorsfx(pi, x, 1);
- pi->setDoorOpen(0);
- }
- else if (x==(db+12))
- {
- pi->setId( pi->id() + 1 );
- doorsfx(pi, x, 0);
- // tempeffect2(0, pi, 13, 0, 0, 0);
- }
- else if (x==(db+13))
- {
- pi->setId( pi->id() - 1 );
- doorsfx(pi, x, 1);
- pi->setDoorOpen(0);
- }
- else if( x == ( db + 14 ) )
- {
- pi->setId( pi->id() + 1 );
- Coord_cl pos( pi->pos() );
- pos.y--;
- pi->moveTo( pos );
- doorsfx(pi, x, 0);
- // tempeffect2(0, pi, 13, 0, 0, 0);
- }
- else if( x == ( db + 15 ) )
- {
- pi->setId( pi->id() - 1 );
- Coord_cl pos( pi->pos() );
- pos.y++;
- pi->moveTo( pos );
- doorsfx(pi, x, 1);
- pi->setDoorOpen(0);
- }
-
- // This is *so* obvious...
- if( x != pi->id() )
- {
- pi->update();
- break;
- }
- }
-
- if( socket && ( x != pi->id() ) )
- {
- // house refreshment when a house owner or friend of a houe opens the house door
- float ds = 0;
- P_CHAR pChar = socket->player();
-
- if( !pChar )
- return;
-
- cHouse* pHouse = dynamic_cast<cHouse*>( cMulti::findMulti( pi->pos() ) );
- if( !pHouse )
- return;
-
- if( !( pChar->Owns( pHouse ) || pHouse->isFriend( pChar ) ) )
- return;
-
- if( SrvParams->housedecay_secs() != 0 )
- ds = static_cast<float>((pHouse->time_unused)*100) / (SrvParams->housedecay_secs());
- else
- ds = -1;
-
- if( ds >= 50 ) // sysmessage if decay status >= 50%
- {
- socket->sysMessage( tr( "You refreshed the house" ) );
- }
- pHouse->time_unused = 0;
- pHouse->last_used = getNormalizedTime();
- }
- }
-
void endmessage(int x) // If shutdown is initialized
{
--- 209,212 ----
***************
*** 1351,1378 ****
}
-
- // not_deleted = output parameter, returns number of items that could NOT be deleted
- // somewhat dirty that it defaults to a global dummy variable, sorry for that.
- // but i couldnt find any other way to keep the old signature and old name.
- // if theres a cleaner way, let me know, LB
-
- void delequan(P_CHAR pc, short id, int amount, int *not_deleted)
- {
- if ( pc == NULL )
- return;
-
- P_ITEM pi=pc->getBackpack();
- if (pi == NULL)
- {
- if (not_deleted != NULL)
- *not_deleted = amount;
- return;
- }
-
- int nd = pi->DeleteAmount(amount, id);
- if (not_deleted != NULL)
- *not_deleted = nd;
- }
-
void goldsfx( cUOSocket *socket, UINT16 amount, bool hearall )
{
--- 1096,1099 ----
|