Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv30896/src
Modified Files:
Trade.cpp ai_vendors.cpp basechar.cpp basechar.h boats.cpp
boats.h books.h chars.cpp corpse.h customtags.cpp customtags.h
dbl_single_click.cpp dragdrop.cpp house.h items.cpp items.h
multis.h npc.cpp npc.h persistentobject.h player.cpp player.h
pythonscript.cpp pythonscript.h resources.cpp resources.h
targetrequests.cpp uobject.cpp uobject.h wolfpack.cpp
world.cpp
Log Message:
moved some properties from cItem to python
Index: Trade.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Trade.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -d -r1.84 -r1.85
*** Trade.cpp 20 Aug 2003 17:10:48 -0000 1.84
--- Trade.cpp 27 Aug 2003 20:35:09 -0000 1.85
***************
*** 222,237 ****
}
- // this is a q&d fix for 'sell price higher than buy price' bug (Duke, 30.3.2001)
- static bool items_match(P_ITEM pi1, P_ITEM pi2)
- {
- if (pi1 && pi2 && pi1->id()==pi2->id() &&
- pi1->type()==pi2->type() &&
- !(pi1->id()==0x14F0 && (pi1->morex()!=pi2->morex())) && // house deeds only differ by morex
- !(IsShield(pi1->id()) && pi1->name2() == pi2->name2()) && // magic shields only differ by name2
- !(IsMetalArmour(pi1->id()) && pi1->color() != pi2->color()) ) // color checking for armour
- return true;
- return false;
- }
-
void Trade::sellAction( cUOSocket *socket, cUORxSell *packet )
{
--- 222,225 ----
***************
*** 311,315 ****
continue;
! if( (*it)->id() == pItem->id() && (*it)->color() == pItem->color() && (*it)->amount() >= pItem->amount() )
{
found = true;
--- 299,306 ----
continue;
! if( (*it)->id() == pItem->id() &&
! (*it)->color() == pItem->color() &&
! (*it)->amount() >= pItem->amount() &&
! (*it)->eventList() == pItem->eventList() )
{
found = true;
Index: ai_vendors.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai_vendors.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ai_vendors.cpp 20 Aug 2003 17:10:48 -0000 1.10
--- ai_vendors.cpp 27 Aug 2003 20:35:09 -0000 1.11
***************
*** 242,246 ****
pGem->setId( 0x1ea7 );
pGem->setName( tr("petitem: %1").arg(pPet->name()) );
- pGem->setName2( player->name() );
pGem->setVisible( 2 ); // gm visible
pPack->addItem( pGem );
--- 242,245 ----
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** basechar.cpp 27 Aug 2003 01:39:58 -0000 1.36
--- basechar.cpp 27 Aug 2003 20:35:09 -0000 1.37
***************
*** 143,147 ****
fields.push_back( "characters.poison,characters.poisoned" );
fields.push_back( "characters.murderertime,characters.criminaltime,characters.nutriment" );
! fields.push_back( "characters.stealthsteps,characters.gender,characters.propertyflags" );
fields.push_back( "characters.attacker,characters.combattarget,characters.murderer" );
fields.push_back( "characters.guarding" );
--- 143,147 ----
fields.push_back( "characters.poison,characters.poisoned" );
fields.push_back( "characters.murderertime,characters.criminaltime,characters.nutriment" );
! fields.push_back( "characters.gender,characters.propertyflags" );
fields.push_back( "characters.attacker,characters.combattarget,characters.murderer" );
fields.push_back( "characters.guarding" );
***************
*** 194,198 ****
criminalTime_ = atoi( result[offset++] ) + uiCurrentTime;
nutriment_ = atoi( result[offset++] );
- stealthedSteps_ = atoi( result[offset++] );
gender_ = atoi( result[offset++] );
propertyFlags_ = atoi( result[offset++] );
--- 194,197 ----
***************
*** 638,641 ****
--- 637,641 ----
this->addItem( static_cast<cBaseChar::enLayer>(layer), pi );
+
cUOTxCharEquipment packet;
packet.setWearer( this->serial() );
***************
*** 1483,1493 ****
if ( atLayer( layer ) != 0 )
{
! clConsole.send( tr("WARNING: Trying to put an item on layer %1 which is already occupied\n").arg(layer) );
! pi->setContainer(0);
return;
}
if( !noRemove )
! pi->removeFromCont();
content_.insert( (ushort)(layer), pi );
--- 1483,1498 ----
if ( atLayer( layer ) != 0 )
{
! clConsole.log( LOG_WARNING, QString( "Trying to put an item on layer %1 which is already occupied\n" ).arg( layer ) );
! pi->setContainer( 0 );
return;
}
if( !noRemove )
! {
! // Dragging doesnt count as Equipping
! if( layer != Dragging )
! pi->onEquip( this, layer );
! pi->removeFromCont();
! }
content_.insert( (ushort)(layer), pi );
***************
*** 1504,1507 ****
--- 1509,1516 ----
if ( pi )
{
+ // Dragging doesnt count as Equipping
+ if( layer != Dragging )
+ pi->onUnequip( this, layer );
+
pi->setContainer(0);
pi->setLayer( 0 );
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** basechar.h 27 Aug 2003 01:39:58 -0000 1.25
--- basechar.h 27 Aug 2003 20:35:09 -0000 1.26
***************
*** 59,65 ****
class cBaseChar : public cUObject
{
- Q_OBJECT
-
public:
// con-/destructors
cBaseChar();
--- 59,68 ----
class cBaseChar : public cUObject
{
public:
+ const char *objectID() const
+ {
+ return "cBaseChar";
+ }
+
// con-/destructors
cBaseChar();
Index: boats.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/boats.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -C2 -d -r1.108 -r1.109
*** boats.cpp 23 Aug 2003 01:03:30 -0000 1.108
--- boats.cpp 27 Aug 2003 20:35:09 -0000 1.109
***************
*** 48,52 ****
#include "wpconsole.h"
#include "player.h"
!
#undef DBGFILE
--- 48,52 ----
#include "wpconsole.h"
#include "player.h"
! #include "inlines.h"
#undef DBGFILE
Index: boats.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/boats.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** boats.h 6 Jul 2003 13:48:01 -0000 1.26
--- boats.h 27 Aug 2003 20:35:09 -0000 1.27
***************
*** 68,76 ****
class cBoat : public cMulti
{
- Q_OBJECT
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
cBoat();
--- 68,80 ----
class cBoat : public cMulti
{
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
+ const char *objectID() const
+ {
+ return "cBoat";
+ }
+
cBoat();
Index: books.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/books.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** books.h 26 Aug 2003 15:01:05 -0000 1.28
--- books.h 27 Aug 2003 20:35:10 -0000 1.29
***************
*** 45,53 ****
class cBook : public cItem
{
- Q_OBJECT
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
cBook();
--- 45,57 ----
class cBook : public cItem
{
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
+ const char *objectID() const
+ {
+ return "cBook";
+ }
+
cBook();
Index: chars.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/chars.cpp,v
retrieving revision 1.328
retrieving revision 1.329
diff -C2 -d -r1.328 -r1.329
*** chars.cpp 20 Aug 2003 17:10:48 -0000 1.328
--- chars.cpp 27 Aug 2003 20:35:10 -0000 1.329
***************
*** 55,59 ****
#define DBGFILE "chars.cpp"
! void cCharStuff::DeleteChar (P_CHAR pc_k) // Delete character
{
if( !pc_k )
--- 55,59 ----
#define DBGFILE "chars.cpp"
! void cCharStuff::DeleteChar( P_CHAR pc_k ) // Delete character
{
if( !pc_k )
Index: corpse.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/corpse.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** corpse.h 21 Aug 2003 05:04:35 -0000 1.14
--- corpse.h 27 Aug 2003 20:35:10 -0000 1.15
***************
*** 47,51 ****
class cCorpse: public cItem
{
- Q_OBJECT
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
--- 47,50 ----
***************
*** 90,94 ****
void addEquipment( UINT8 layer, SERIAL serial );
! virtual QString objectID( void ) const { return "cCorpse"; }
virtual void flagUnchanged() { cCorpse::changed_ = false; cItem::flagUnchanged(); }
--- 89,97 ----
void addEquipment( UINT8 layer, SERIAL serial );
! const char *objectID() const
! {
! return "cCorpse";
! }
!
virtual void flagUnchanged() { cCorpse::changed_ = false; cItem::flagUnchanged(); }
Index: customtags.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** customtags.cpp 27 Aug 2003 16:06:12 -0000 1.26
--- customtags.cpp 27 Aug 2003 20:35:10 -0000 1.27
***************
*** 744,747 ****
--- 744,758 ----
}
+ bool cCustomTags::has( const QString &key )
+ {
+ if( tags_ )
+ {
+ if( tags_->find( key ) != tags_->end() )
+ return true;
+ }
+
+ return false;
+ }
+
cVariant cCustomTags::get( const QString& key )
{
Index: customtags.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** customtags.h 27 Aug 2003 13:33:17 -0000 1.19
--- customtags.h 27 Aug 2003 20:35:10 -0000 1.20
***************
*** 153,156 ****
--- 153,157 ----
cVariant get( const QString& key );
+ bool has( const QString& key );
void set( const QString& key, const cVariant& value );
void remove( const QString& key );
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.214
retrieving revision 1.215
diff -C2 -d -r1.214 -r1.215
*** dbl_single_click.cpp 23 Aug 2003 15:20:29 -0000 1.214
--- dbl_single_click.cpp 27 Aug 2003 20:35:10 -0000 1.215
***************
*** 210,214 ****
pc_currchar->action( 0x20 );
! pc_currchar->emote( tr( "*%1 loots the body of %2*" ).arg( pc_currchar->name() ).arg( pi->name2() ), 0x26 );
}
--- 210,214 ----
pc_currchar->action( 0x20 );
! pc_currchar->emote( tr( "*%1 loots the body of %2*" ).arg( pc_currchar->name() ).arg( pi->tags().get( "name" ).toString() ), 0x26 );
}
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.191
retrieving revision 1.192
diff -C2 -d -r1.191 -r1.192
*** dragdrop.cpp 20 Aug 2003 17:10:48 -0000 1.191
--- dragdrop.cpp 27 Aug 2003 20:35:10 -0000 1.192
***************
*** 339,343 ****
--- 339,350 ----
{
socket->clilocMessage( 0x7A4D5, "", 0x3b2 ); // You can't do that when you're dead.
+ socket->bounceItem( pItem, BR_NO_REASON );
+ return;
+ }
+ // No Special Layer Equipping
+ if( ( packet->layer() > cBaseChar::InnerLegs || packet->layer() <= cBaseChar::TradeWindow ) && !pChar->isGM() )
+ {
+ socket->sysMessage( tr( "You can't equip on that layer." ) );
socket->bounceItem( pItem, BR_NO_REASON );
return;
***************
*** 352,355 ****
--- 359,375 ----
}
+ // Only GM's can equip other People
+ if( pWearer != pChar && !pChar->isGM() )
+ {
+ P_NPC pNpc = dynamic_cast< P_NPC >( pWearer );
+
+ // But we are allowed to equip our own humans
+ if( !pNpc || ( pNpc->owner() != pChar && pWearer->isHuman() ) )
+ socket->sysMessage( tr( "You can't equip other players." ) );
+
+ socket->bounceItem( pItem, BR_NO_REASON );
+ return;
+ }
+
// Get our tile-information
tile_st pTile = TileCache::instance()->getTile( pItem->id() );
***************
*** 360,363 ****
--- 380,390 ----
{
socket->sysMessage( tr( "This item cannot be equipped." ) );
+ socket->bounceItem( pItem, BR_NO_REASON );
+ return;
+ }
+
+ // Check the Script for it
+ if( pItem->onWearItem( pChar, pWearer, packet->layer() ) )
+ {
socket->bounceItem( pItem, BR_NO_REASON );
return;
Index: house.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/house.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** house.h 6 Jul 2003 13:48:01 -0000 1.29
--- house.h 27 Aug 2003 20:35:10 -0000 1.30
***************
*** 62,70 ****
class cHouse : public cMulti
{
- Q_OBJECT
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
unsigned int last_used;
--- 62,73 ----
class cHouse : public cMulti
{
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
+ const char *objectID() const
+ {
+ return "cHouse";
+ }
unsigned int last_used;
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.336
retrieving revision 1.337
diff -C2 -d -r1.336 -r1.337
*** items.cpp 27 Aug 2003 01:39:58 -0000 1.336
--- items.cpp 27 Aug 2003 20:35:10 -0000 1.337
***************
*** 85,89 ****
flagChanged();
this->name_ = src.name_;
- this->name2_ = src.name2_;
this->creator_ = src.creator_;
this->incognito = src.incognito;
--- 85,88 ----
***************
*** 460,465 ****
addField("serial", serial());
addField("id", id());
- addStrField("name", name_); // warning: items do not use cUObject name! (nuts, remove it)
- addStrField("name2", name2_);
addStrField("creator", creator_);
addField("sk_name", madewith_);
--- 459,462 ----
***************
*** 603,609 ****
this->setSerial( World::instance()->findItemSerial() );
this->container_ = 0;
- this->name_ = "#";
- this->name2_ = this->name_;
this->incognito=false;//AntiChrist - incognito
this->madewith_=0; // Added by Magius(CHE)
--- 600,607 ----
this->setSerial( World::instance()->findItemSerial() );
+ // We need to implement NULL checking here.
+ this->creator_ = QString::null;
+
this->container_ = 0;
this->incognito=false;//AntiChrist - incognito
this->madewith_=0; // Added by Magius(CHE)
***************
*** 1056,1059 ****
--- 1054,1108 ----
}
+ bool cItem::onEquip( P_CHAR pChar, unsigned char layer )
+ {
+ if( scriptChain )
+ {
+ unsigned int i = 0;
+ while( scriptChain[i] )
+ {
+ if( scriptChain[ i ]->onEquip( pChar, this, layer ) )
+ return true;
+
+ ++i;
+ }
+ }
+
+ return false;
+ }
+
+ bool cItem::onUnequip( P_CHAR pChar, unsigned char layer )
+ {
+ if( scriptChain )
+ {
+ unsigned int i = 0;
+ while( scriptChain[i] )
+ {
+ if( scriptChain[ i ]->onUnequip( pChar, this, layer ) )
+ return true;
+
+ ++i;
+ }
+ }
+
+ return false;
+ }
+
+ bool cItem::onWearItem( P_PLAYER pPlayer, P_CHAR pChar, unsigned char layer )
+ {
+ if( scriptChain )
+ {
+ unsigned int i = 0;
+ while( scriptChain[i] )
+ {
+ if( scriptChain[ i ]->onWearItem( pPlayer, pChar, this, layer ) )
+ return true;
+
+ ++i;
+ }
+ }
+
+ return false;
+ }
+
bool cItem::onUse( P_CHAR pChar )
{
***************
*** 1156,1163 ****
}
- // <identified>my magic item</identified>
- else if( TagName == "identified" )
- this->setName2( Value.latin1() );
-
// <attack min="1" max="2"/>
else if( TagName == "attack" )
--- 1205,1208 ----
***************
*** 1383,1387 ****
{
// Bad: # = iron #
! if( name_ == "#" )
{
name_ = getName( true );
--- 1428,1432 ----
{
// Bad: # = iron #
! if( name_.isNull() )
{
name_ = getName( true );
***************
*** 1406,1413 ****
}
- // <identified>%1 of Hardening</identified>
- else if( TagName == "identified" )
- name2_ = Value.arg( name2_ );
-
// <attack min="-1" max="+2"/>
else if( TagName == "attack" )
--- 1451,1454 ----
***************
*** 1608,1612 ****
QString itemname( "" );
! if( name_ != "#" )
itemname = getName();
--- 1649,1653 ----
QString itemname( "" );
! if( !name_.isNull() )
itemname = getName();
***************
*** 1634,1638 ****
// Show charges for wands only if they are identified
! if( type() == 15 && name_ == name2_ )
itemname.append( tr( " [%1 charge%2]" ).arg( morez_ ).arg( ( morez_ > 1 ) ? "s" : "" ) );
else if( type() == 404 || type() == 181 )
--- 1675,1679 ----
// Show charges for wands only if they are identified
! if( type() == 15 && !tags().has( "identified" ) )
itemname.append( tr( " [%1 charge%2]" ).arg( morez_ ).arg( ( morez_ > 1 ) ? "s" : "" ) );
else if( type() == 404 || type() == 181 )
***************
*** 1640,1644 ****
// Try a localized Message
! if( name_ == "#" )
socket->clilocMessageAffix( 0xF9060 + id_, "", itemname, 0x3B2, 3, this );
else
--- 1681,1685 ----
// Try a localized Message
! if( name_.isNull() )
socket->clilocMessageAffix( 0xF9060 + id_, "", itemname, 0x3B2, 3, this );
else
***************
*** 2078,2083 ****
if( pi->maxhp() == 0)
pi->setMaxhp( pi->hp() );
- if( pi->name() == "#" )
- pi->setName( QString::null );
}
--- 2119,2122 ----
***************
*** 2105,2110 ****
id_ = atoi( result[offset++] );
- name_ = result[offset++];
- name2_ = result[offset++];
creator_ = result[offset++];
madewith_ = atoi( result[offset++] );
--- 2144,2147 ----
***************
*** 2177,2181 ****
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.name,items.name2,items.creator,items.sk_name,items.color,items.cont,items.layer,items.type,items.type2,items.offspell,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.doordir,items.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.st,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,items.st2,items.dx,items.dx2,items.intelligence,items.intelligence2,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.good,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
--- 2214,2218 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.creator,items.sk_name,items.color,items.cont,items.layer,items.type,items.type2,items.offspell,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.doordir,items.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.st,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,items.st2,items.dx,items.dx2,items.intelligence,items.intelligence2,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.good,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2369,2374 ****
}
- else SET_STR_PROPERTY( "name2", name2_ )
- else SET_STR_PROPERTY( "name", name_ )
else SET_INT_PROPERTY( "layer", layer_ )
else SET_INT_PROPERTY( "type", type_ )
--- 2406,2409 ----
***************
*** 2591,2596 ****
else GET_PROPERTY( "color", color_ )
else GET_PROPERTY( "amount", amount_ )
- else GET_PROPERTY( "name2", name2_ )
- else GET_PROPERTY( "name", name_ )
else GET_PROPERTY( "layer", layer_ )
// Flag properties are set elsewhere!!
--- 2626,2629 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.172
retrieving revision 1.173
diff -C2 -d -r1.172 -r1.173
*** items.h 27 Aug 2003 13:33:17 -0000 1.172
--- items.h 27 Aug 2003 20:35:10 -0000 1.173
***************
*** 48,92 ****
class cItem : public cUObject
{
- Q_OBJECT
- Q_PROPERTY ( ushort id READ id WRITE setId )
- Q_PROPERTY ( ushort color READ color WRITE setColor )
- Q_PROPERTY ( ushort amount READ amount WRITE setAmount )
- Q_PROPERTY ( ushort restock READ restock WRITE setRestock )
- Q_PROPERTY ( uchar layer READ layer WRITE setLayer )
- Q_PROPERTY ( int totalweight READ totalweight WRITE setTotalweight )
- Q_PROPERTY ( ushort accuracy READ accuracy WRITE setAccuracy )
- Q_PROPERTY ( int sellprice READ sellprice WRITE setSellprice )
- Q_PROPERTY ( int buyprice READ buyprice WRITE setBuyprice )
- Q_PROPERTY ( uchar more1 READ more1 WRITE setMore1 )
- Q_PROPERTY ( uchar more2 READ more2 WRITE setMore2 )
- Q_PROPERTY ( uchar more3 READ more3 WRITE setMore3 )
- Q_PROPERTY ( uchar more4 READ more4 WRITE setMore4 )
- Q_PROPERTY ( uchar morex READ morex WRITE setMoreX )
- Q_PROPERTY ( uchar morey READ morey WRITE setMoreY )
- Q_PROPERTY ( uchar morez READ morez WRITE setMoreZ )
- Q_PROPERTY ( uchar doordir READ doordir WRITE setDoorDir )
- Q_PROPERTY ( uchar dooropen READ dooropen WRITE setDoorOpen )
- Q_PROPERTY ( uchar dye READ dye WRITE setDye )
- Q_PROPERTY ( uint att READ att WRITE setAtt )
- Q_PROPERTY ( uint def READ def WRITE setDef )
- Q_PROPERTY ( short StrengthReq READ strengthReq WRITE setStrengthReq )
- Q_PROPERTY ( short strengthMod READ strengthMod WRITE setStrengthMod )
- Q_PROPERTY ( short dexterityReq READ dexterityReq WRITE setDexterityReq )
- Q_PROPERTY ( short dexterityMod READ dexterityMod WRITE setDexterityMod )
- Q_PROPERTY ( short intelligenceMod READ intelligenceMod WRITE setIntelligenceMod )
- Q_PROPERTY ( short intelligenceReq READ intelligenceReq WRITE setIntelligenceReq )
- Q_PROPERTY ( uchar magic READ magic WRITE setMagic )
- Q_PROPERTY ( uint decaytime READ decaytime WRITE setDecayTime )
- Q_PROPERTY ( uint disabled READ disabled WRITE setDisabled )
- Q_PROPERTY ( uint poisoned READ poisoned WRITE setPoisoned )
- Q_PROPERTY ( int rank READ rank WRITE setRank )
- Q_PROPERTY ( QString creator READ creator WRITE setCreator )
- Q_PROPERTY ( int ownserial READ ownSerial WRITE SetOwnSerial )
- Q_PROPERTY ( uchar visible READ visible WRITE setVisible )
- Q_PROPERTY ( uchar priv READ priv WRITE setPriv )
- Q_PROPERTY ( int good READ good WRITE setGood )
- Q_PROPERTY ( int rndvaluerate READ rndvaluerate WRITE setRndValueRate )
- Q_PROPERTY ( uchar madewith READ madewith WRITE setMadeWith )
-
private:
bool changed_;
--- 48,51 ----
***************
*** 97,100 ****
--- 56,63 ----
public:
+ const char *objectID() const
+ {
+ return "cItem";
+ }
virtual void talk( const QString &message, ushort color = 0xFFFF, UINT8 type = 0, bool autospam = false, cUOSocket* socket = NULL );
***************
*** 114,118 ****
ushort amount() const { return amount_; } // Amount of items in pile
ushort restock() const { return restock_; } // Amount of items a vendor will respawn this item to.
- QString name2() const { return name2_; } // The identified name of the item
uchar layer() const { return layer_; } // Layer if equipped on paperdoll
bool twohanded() const { return priv_&0x20; } // Is the weapon twohanded ?
--- 77,80 ----
***************
*** 190,194 ****
void setAmount( ushort nValue );
void setRestock( ushort nValue ) { restock_ = nValue; flagChanged();}
- void setName2( const QString& nValue ) { name2_ = nValue; flagChanged(); changed( TOOLTIP );};
void setLayer( uchar nValue ) { layer_ = nValue; flagChanged();};
void setTwohanded( bool nValue ) { nValue ? priv_ &= 0x20 : priv_ |= 0xDF; flagChanged(); changed( TOOLTIP );};
--- 152,155 ----
***************
*** 292,296 ****
UINT16 getWeaponSkill();
! void MoveTo(int newx, int newy, signed char newz);
long reduceAmount( short amount = 1 );
short GetContGumpType();
--- 253,257 ----
UINT16 getWeaponSkill();
! void MoveTo( int newx, int newy, signed char newz );
long reduceAmount( short amount = 1 );
short GetContGumpType();
***************
*** 319,322 ****
--- 280,286 ----
virtual bool onSingleClick( P_PLAYER Viewer );
bool onUse( P_CHAR pChar );
+ bool onWearItem( P_PLAYER pPlayer, P_CHAR pChar, unsigned char layer );
+ bool onEquip( P_CHAR pChar, unsigned char layer );
+ bool onUnequip( P_CHAR pChar, unsigned char layer );
bool onCollide( P_CHAR pChar );
bool onDropOnChar( P_CHAR pChar );
***************
*** 353,357 ****
ushort amount_;
ushort restock_;
- QString name2_;
uchar layer_;
SI16 lodamage_;
--- 317,320 ----
Index: multis.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/multis.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** multis.h 6 Jul 2003 13:48:01 -0000 1.20
--- multis.h 27 Aug 2003 20:35:10 -0000 1.21
***************
*** 49,57 ****
class cMulti : public cItem
{
- Q_OBJECT
protected:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
cMulti();
virtual void toDeed( cUOSocket* socket ) = 0;
--- 49,61 ----
class cMulti : public cItem
{
protected:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
+ const char *objectID() const
+ {
+ return "cMulti";
+ }
+
cMulti();
virtual void toDeed( cUOSocket* socket ) = 0;
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** npc.cpp 27 Aug 2003 15:29:18 -0000 1.33
--- npc.cpp 27 Aug 2003 20:35:10 -0000 1.34
***************
*** 403,407 ****
changed_ = true;
int ele;
- int nType=0;
if( free )
--- 403,406 ----
***************
*** 536,546 ****
corpse->setBodyId( orgBodyID_ );
- corpse->setMoreY( this->isHuman() ); //is human??
corpse->setCarve( carve() ); //store carve section
! corpse->setName2( name() );
corpse->moveTo( pos() );
-
- corpse->setMore1(nType);
corpse->setDirection( direction() );
--- 535,543 ----
corpse->setBodyId( orgBodyID_ );
corpse->setCarve( carve() ); //store carve section
! corpse->tags().set( "human", cVariant( isHuman() ? 1 : 0 ) );
! corpse->tags().set( "name", cVariant( name() ) );
corpse->moveTo( pos() );
corpse->setDirection( direction() );
Index: npc.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** npc.h 26 Aug 2003 15:01:05 -0000 1.20
--- npc.h 27 Aug 2003 20:35:10 -0000 1.21
***************
*** 46,51 ****
class cNPC : public cBaseChar
{
- Q_OBJECT
public:
// con-/destructors
cNPC();
--- 46,55 ----
class cNPC : public cBaseChar
{
public:
+ const char *objectID() const
+ {
+ return "cUObject";
+ }
+
// con-/destructors
cNPC();
Index: persistentobject.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentobject.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** persistentobject.h 15 Jan 2003 14:47:02 -0000 1.7
--- persistentobject.h 27 Aug 2003 20:35:10 -0000 1.8
***************
*** 35,41 ****
#include <qobject.h>
! class PersistentObject : public QObject
{
- Q_OBJECT
protected:
bool isPersistent;
--- 35,40 ----
#include <qobject.h>
! class PersistentObject
{
protected:
bool isPersistent;
***************
*** 47,53 ****
virtual void load( char **, UINT16& );
virtual void save();
! virtual QString objectID() const
{
! return QString(className());
}
--- 46,53 ----
virtual void load( char **, UINT16& );
virtual void save();
!
! virtual const char *objectID() const
{
! return "PersistentObject";
}
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** player.cpp 27 Aug 2003 15:29:18 -0000 1.27
--- player.cpp 27 Aug 2003 20:35:10 -0000 1.28
***************
*** 49,53 ****
#include "pythonscript.h"
#include "scriptmanager.h"
!
cPlayer::cPlayer()
--- 49,53 ----
#include "pythonscript.h"
#include "scriptmanager.h"
! #include "inlines.h"
cPlayer::cPlayer()
***************
*** 385,389 ****
changed_ = true;
int ele;
- int nType=0;
if( free )
--- 385,388 ----
***************
*** 558,567 ****
corpse->setBodyId( orgBodyID_ );
! corpse->setMoreY( this->isHuman() ); //is human??
! corpse->setName2( name() );
corpse->moveTo( pos() );
- corpse->setMore1(nType);
corpse->setDirection( direction() );
--- 557,565 ----
corpse->setBodyId( orgBodyID_ );
! corpse->tags().set( "human", cVariant( isHuman() ? 1 : 0 ) );
! corpse->tags().set( "name", cVariant( name() ) );
corpse->moveTo( pos() );
corpse->setDirection( direction() );
Index: player.h
===================================================================
RCS...
[truncated message content] |