Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv12500
Modified Files:
items.cpp items.h makemenus.cpp player.cpp prototypes.h
wolfpack.cpp world.cpp
Log Message:
moved some properties from cItem to python
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.338
retrieving revision 1.339
diff -C2 -d -r1.338 -r1.339
*** items.cpp 27 Aug 2003 21:11:41 -0000 1.338
--- items.cpp 27 Aug 2003 21:43:57 -0000 1.339
***************
*** 74,78 ****
// constructor
cItem::cItem(): container_(0), totalweight_(0), incognito(false),
! rndvaluerate_(0), timeused_last(0), sellprice_( 0 ),
buyprice_( 0 ), restock_( 1 ), antispamtimer_( 0 )
{
--- 74,78 ----
// constructor
cItem::cItem(): container_(0), totalweight_(0), incognito(false),
! timeused_last(0), sellprice_( 0 ),
buyprice_( 0 ), restock_( 1 ), antispamtimer_( 0 )
{
***************
*** 85,94 ****
flagChanged();
this->name_ = src.name_;
- this->creator_ = src.creator_;
this->incognito = src.incognito;
- this->madewith_ = src.madewith_;
- this->rank_ = src.rank_;
- this->good_ = src.good_;
- this->rndvaluerate_ = src.rndvaluerate_;
this->setMultis( src.multis() );
--- 85,89 ----
***************
*** 110,114 ****
this->amount_ = src.amount_;
this->dye_ = src.dye_;
- this->att_ = src.att_;
this->def_ = src.def_;
this->lodamage_=src.lodamage_;
--- 105,108 ----
***************
*** 450,474 ****
addField("serial", serial());
addField("id", id());
! addStrField("creator", creator_);
! addField("sk_name", madewith_);
! addField("color", color());
SERIAL contserial = INVALID_SERIAL;
if ( container_ )
contserial = container_->serial();
! addField("cont", contserial);
! addField("layer", layer_);
! addField("type", type_);
! addField("type2", type2_);
! addField("more1", more1_);
! addField("more2", more2_);
! addField("more3", more3_);
! addField("more4", more4_);
! addField("morex", morex_);
! addField("morey", morey_);
! addField("morez", morez_);
addField("amount", amount_);
addField("dye", dye_);
addField("decaytime", (decaytime_ > uiCurrentTime) ? decaytime_ - uiCurrentTime : 0 );
- addField("att", att_);
addField("def", def_);
addField("hidamage", hidamage_);
--- 444,465 ----
addField("serial", serial());
addField("id", id());
! addField("color", color());
SERIAL contserial = INVALID_SERIAL;
if ( container_ )
contserial = container_->serial();
! addField("cont", contserial);
! addField("layer", layer_);
! addField("type", type_);
! addField("type2", type2_);
! addField("more1", more1_);
! addField("more2", more2_);
! addField("more3", more3_);
! addField("more4", more4_);
! addField("morex", morex_);
! addField("morey", morey_);
! addField("morez", morez_);
addField("amount", amount_);
addField("dye", dye_);
addField("decaytime", (decaytime_ > uiCurrentTime) ? decaytime_ - uiCurrentTime : 0 );
addField("def", def_);
addField("hidamage", hidamage_);
***************
*** 478,482 ****
addField("hp", hp_);
addField("maxhp", maxhp_);
- addField("rank", rank_);
addField("speed", speed_);
addField("poisoned", poisoned_);
--- 469,472 ----
***************
*** 490,494 ****
addField("restock", restock_);
addField("disabled", disabled_);
- addField("good", good_);
addField("accuracy", accuracy_);
--- 480,483 ----
***************
*** 583,599 ****
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)
- this->rank_ = 0; // Magius(CHE)
- this->good_=-1; // Magius(CHE)
- this->rndvaluerate_=0; // Magius(CHE) (2)
! this->setMultis( INVALID_SERIAL );//Multi serial
this->free = false;
! this->setId(0x0001); // Item visuals as stored in the client
this->setPos( Coord_cl(100, 100, 0) );
this->color_ = 0x00; // Hue
--- 572,581 ----
this->setSerial( World::instance()->findItemSerial() );
this->container_ = 0;
this->incognito=false;//AntiChrist - incognito
! this->setMultis( INVALID_SERIAL ); //Multi serial
this->free = false;
! this->setId( 0x0001 ); // Item visuals as stored in the client
this->setPos( Coord_cl(100, 100, 0) );
this->color_ = 0x00; // Hue
***************
*** 611,615 ****
this->amount_ = 1; // Amount of items in pile
this->dye_=0; // Reserved: Can item be dyed by dye kit
- this->att_=0; // Item attack
this->def_=0; // Item defense
this->lodamage_=0; //Minimum Damage weapon inflicts
--- 593,596 ----
***************
*** 1216,1223 ****
this->setSpeed( Value.toLong() );
- // <good>10</good>
- else if( TagName == "good" )
- this->good_ = Value.toInt();
-
// <lightsource>10</lightsource>
else if( TagName == "lightsource" )
--- 1197,1200 ----
***************
*** 1532,1539 ****
itemname = getName();
- // Add creator's mark (if any)
- if( !creator_.isEmpty() && madewith() )
- itemname.append( tr( " crafted by %2" ).arg( creator_ ) );
-
// Amount information
if( amount_ > 1 )
--- 1509,1512 ----
***************
*** 1834,1861 ****
}
- void cItem::applyRank( UI08 rank )
- {
- // Variables to change: LODAMAGE,HIDAMAGE,ATT,DEF,HP,MAXHP
- double minmod = (double)(rank-1) * 10.0f / 100.0f;
- double maxmod = (double)(rank+1) * 10.0f / 100.0f;
- UINT16 minhp_ = (UINT16)floor( minmod * (double)hp() );
- UINT16 maxhp_ = (UINT16)floor( maxmod * (double)hp() );
- INT16 minlodam = (UINT16)floor( minmod * (double)lodamage() );
- INT16 maxlodam = (UINT16)floor( maxmod * (double)lodamage() );
- INT16 minhidam = (UINT16)floor( minmod * (double)hidamage() );
- INT16 maxhidam = (UINT16)floor( maxmod * (double)hidamage() );
- UINT16 mindef = (UINT16)floor( minmod * (double)def() );
- UINT16 maxdef = (UINT16)floor( maxmod * (double)def() );
-
- changed( TOOLTIP );
- flagChanged();
- setLodamage( RandomNum( minlodam, maxlodam ) );
- setHidamage( RandomNum( minhidam, maxhidam ) );
- def_ = RandomNum( mindef, maxdef );
- setMaxhp( RandomNum( minhp_, maxhp_ ) );
- setHp( maxhp() );
- this->rank_ = rank_;
- }
-
void cItem::talk( const QString &message, UI16 color, UINT8 type, bool autospam, cUOSocket* socket )
{
--- 1807,1810 ----
***************
*** 2024,2029 ****
id_ = atoi( result[offset++] );
- creator_ = result[offset++];
- madewith_ = atoi( result[offset++] );
color_ = atoi( result[offset++] );
--- 1973,1976 ----
***************
*** 2054,2058 ****
if( decaytime_ > 0 )
decaytime_ += uiCurrentTime;
- att_ = atoi( result[offset++] );
def_ = atoi( result[offset++] );
hidamage_ = atoi( result[offset++] );
--- 2001,2004 ----
***************
*** 2062,2066 ****
hp_ = atoi( result[offset++] );
maxhp_ = atoi( result[offset++] );
- rank_ = atoi( result[offset++] );
speed_ = atoi( result[offset++] );
poisoned_ = atoi( result[offset++] );
--- 2008,2011 ----
***************
*** 2074,2078 ****
restock_ = atoi( result[offset++] );
disabled_ = atoi( result[offset++] );
- good_ = atoi( result[offset++] );
accuracy_ = atoi( result[offset++] );
--- 2019,2022 ----
***************
*** 2086,2090 ****
{
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.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,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" );
--- 2030,2034 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.dye,items.decaytime,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2346,2350 ****
else SET_INT_PROPERTY( "morez", morez_ )
else SET_INT_PROPERTY( "dye", dye_ )
- else SET_INT_PROPERTY( "attack", att_ )
else SET_INT_PROPERTY( "defense", def_ )
else SET_INT_PROPERTY( "decaytime", decaytime_ )
--- 2290,2293 ----
***************
*** 2376,2384 ****
else SET_INT_PROPERTY( "disabled", disabled_ )
else SET_INT_PROPERTY( "poisoned", poisoned_ )
- else SET_INT_PROPERTY( "rank", rank_ )
- else SET_STR_PROPERTY( "creator", creator_ )
- else SET_INT_PROPERTY( "good", good_ )
- else SET_INT_PROPERTY( "rndvaluerate", rndvaluerate_ )
- else SET_INT_PROPERTY( "madewith", madewith_ )
else SET_INT_PROPERTY( "incognito", incognito )
else SET_INT_PROPERTY( "timeunused", time_unused )
--- 2319,2322 ----
***************
*** 2490,2494 ****
else GET_PROPERTY( "morez", (int)morez_ )
else GET_PROPERTY( "dye", dye_ )
- else GET_PROPERTY( "attack", (int)att_ )
else GET_PROPERTY( "defense", (int)def_ )
else GET_PROPERTY( "decaytime", (int)decaytime_ )
--- 2428,2431 ----
***************
*** 2504,2512 ****
else GET_PROPERTY( "disabled", (int)disabled_ )
else GET_PROPERTY( "poisoned", (int)poisoned_ )
- else GET_PROPERTY( "rank", rank_ )
- else GET_PROPERTY( "creator", creator_ )
- else GET_PROPERTY( "good", good_ )
- else GET_PROPERTY( "rndvaluerate", rndvaluerate_ )
- else GET_PROPERTY( "madewith", madewith_ )
else GET_PROPERTY( "incognito", incognito ? 1 : 0 )
else GET_PROPERTY( "timeunused", (int)time_unused )
--- 2441,2444 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.174
retrieving revision 1.175
diff -C2 -d -r1.174 -r1.175
*** items.h 27 Aug 2003 21:11:41 -0000 1.174
--- items.h 27 Aug 2003 21:43:57 -0000 1.175
***************
*** 109,113 ****
uint morez() const { return morez_; }
uchar dye() const { return dye_; }
- uint att() const { return att_; }
uint def() const { return def_; }
uchar magic() const { return magic_; }
--- 109,112 ----
***************
*** 115,141 ****
uint disabled() const { return disabled_; }
uint poisoned() const { return poisoned_; }
- int rank() const { return rank_; }
- QString creator() const { return creator_;}
uchar visible() const { return visible_;}
uchar priv() const { return priv_; }
- int good() const { return good_; }
- int rndvaluerate() const { return rndvaluerate_; }
- int madewith() const { return madewith_; }
//***************************END ADDED GETTERS************
- //----------------------[ ADVANCED PROPERTIES GETTERS ]------------------
-
- short charge_count() const { return charge_count_; }
- short charge_spell() const { return charge_spell_; }
-
- ushort drb_base() const { return drb_base_; }
- ushort drb_current() const { return drb_current_; }
- ushort uses_base() const { return uses_base_; }
- ushort uses_current() const { return uses_current_; }
-
-
- //------------------[ END OF ADVANCED PROPERTIES GETTERS ]---------------
-
// Setters
void setId( ushort nValue ) { id_ = nValue; flagChanged();};
--- 114,122 ----
***************
*** 162,166 ****
void setAntispamtimer ( uint data ) { antispamtimer_ = data; flagChanged();}
void setAccuracy( ushort data ) { accuracy_ = data; flagChanged();}
- void setCreator( const QString& d ) { creator_ = d; flagChanged(); changed( TOOLTIP );}
cItem();
--- 143,146 ----
***************
*** 171,175 ****
void toBackpack( P_CHAR pChar );
void showName( cUOSocket *socket );
- void applyRank( uchar rank );
//*****************************************ADDED SETTERS ***************
void setMore1( uchar data ) { more1_ = data; flagChanged();}
--- 151,154 ----
***************
*** 181,185 ****
void setMoreZ( uint data ) { morez_ = data; flagChanged();}
void setDye( uchar data ) { dye_ = data; flagChanged();}
- void setAtt( uint data ) { att_ = data; flagChanged();}
void setDef( uint data ) { def_ = data; flagChanged(); changed( TOOLTIP );}
void setMagic( uchar data ) { magic_ = data; flagChanged(); changed( TOOLTIP );}
--- 160,163 ----
***************
*** 190,214 ****
void setDisabled(uint data) { disabled_ = data; flagChanged();}
void setPoisoned(uint data) { poisoned_ = data; flagChanged();}
- void setRank(int data) { rank_ = data; flagChanged();}
void setVisible( uchar d ) { visible_ = d; flagChanged();}
void setPriv( uchar d ) { priv_ = d; flagChanged(); changed( TOOLTIP );}
- void setGood( int d ) { good_ = d; flagChanged();}
- void setRndValueRate( int d ) { rndvaluerate_ = d; flagChanged();}
- void setMadeWith( int d ) { madewith_ = d; flagChanged(); changed( TOOLTIP );}
void setContainer( cUObject* d ) { container_ = d; flagChanged(); }
//*******************************************END ADDED SETTERS**********
- //----------------------[ ADVANCED PROPERTIES SETTERS ]------------------
- void setChargeCount( short data ) { charge_count_ = data; }
- void setChargeSpell( short data ) { charge_spell_ = data; }
-
- void setDrb_base( ushort data ) { drb_base_ = data; }
- void setDrb_current( ushort data ) { drb_current_ = data; }
- void setUses_base( ushort data ) { uses_base_ = data; }
- void setUses_current( ushort data ) { uses_current_ = data; }
-
- //------------------[ END OF ADVANCED PROPERTIES SETTERS ]---------------
-
SERIAL spawnserial;
--- 168,177 ----
***************
*** 325,329 ****
uint morez_;
uchar dye_; // Reserved: Can item be dyed by dye kit
- uint att_; // Item attack
uint def_; // Item defense
uchar magic_; // 0=Default as stored in client, 1=Always movable, 2=Never movable, 3=Owner movable, 4=Locked Down
--- 288,291 ----
***************
*** 331,341 ****
uint disabled_; //Item is disabled, cant trigger.
uint poisoned_; //AntiChrist -- for poisoning skill
- int rank_; //Magius(CHE) --- for rank system, this value is the LEVEL of the item from 1 to 10. Simply multiply the rank*10 and calculate the MALUS this item has from the original.
- // for example: RANK 5 ---> 5*10=50% of malus
- // this item has same values decreased by 50%..
- // RANK 1 ---> 1*10=10% this item has 90% of malus!
- // RANK 10 --> 10*10=100% this item has no malus! RANK 10 is automatically setted if you select RANKSYSTEM 0.
- // Vars: LODAMAGE,HIDAMAGE,ATT,DEF,HP,MAXHP
- QString creator_; // Store the name of the player made this item
SERIAL ownserial_;
uchar visible_; // 0=Normally Visible, 1=Owner & GM Visible, 2=GM Visible
--- 293,296 ----
***************
*** 352,370 ****
// 7 | 80 | <unused>
uchar priv_;
-
- int good_; // Store type of GOODs to trade system! (Plz not set as UNSIGNED) --- Magius(CHE)
- int rndvaluerate_; // Store the value calculated base on RANDOMVALUE in region.scp. ---- MAgius(CHE) (2)
- uchar madewith_; // Store the skills used to make this item -- Magius(CHE)
-
- // ADVANCED ITEM PROPERTIES
- // Charges
- ushort charge_count_; //Charges count
- ushort charge_spell_; //Charge spell
-
- // Durability
- ushort drb_base_; //Durability base
- ushort drb_current_; //Durability current
- ushort uses_base_; //Uses base
- ushort uses_current_; //Uses current
};
--- 307,310 ----
Index: makemenus.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/makemenus.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** makemenus.cpp 20 Aug 2003 17:10:48 -0000 1.55
--- makemenus.cpp 27 Aug 2003 21:43:57 -0000 1.56
***************
*** 541,544 ****
--- 541,546 ----
rank = 1;
+ // Currently unused. This is such a mess i just dont have an overview
+
// finally lets create the items/npcs!
***************
*** 558,562 ****
if( pItem->isPileable() )
pItem->setAmount( miit.current()->amount() );
- pItem->applyRank( rank );
pBackpack->addItem( pItem );
pItem->update();
--- 560,563 ----
***************
*** 571,575 ****
if( pItem )
{
- pItem->applyRank( rank );
pBackpack->addItem( pItem );
pItem->update();
--- 572,575 ----
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** player.cpp 27 Aug 2003 21:11:41 -0000 1.29
--- player.cpp 27 Aug 2003 21:43:57 -0000 1.30
***************
*** 703,708 ****
pMount->setDexterity( pi->tags().get("dexterity").toInt() );
pMount->setIntelligence( pi->tags().get("intelligence").toInt() );
- pMount->setWanderX2( pi->att() );
- pMount->setWanderY2( pi->def() );
pMount->setHitpoints( pi->hp() );
pMount->setFame( pi->lodamage() );
--- 703,706 ----
***************
*** 798,803 ****
pMountItem->tags().set( "dexterity", pMount->dexterity() );
pMountItem->tags().set( "intelligence", pMount->intelligence() );
! pMountItem->setAtt( pMount->wanderX2() );
! pMountItem->setDef( pMount->wanderY2() );
pMountItem->setHp( pMount->hitpoints() );
pMountItem->setLodamage( pMount->fame() );
--- 796,800 ----
pMountItem->tags().set( "dexterity", pMount->dexterity() );
pMountItem->tags().set( "intelligence", pMount->intelligence() );
!
pMountItem->setHp( pMount->hitpoints() );
pMountItem->setLodamage( pMount->fame() );
Index: prototypes.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/prototypes.h,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -d -r1.102 -r1.103
*** prototypes.h 23 Aug 2003 15:20:29 -0000 1.102
--- prototypes.h 27 Aug 2003 21:43:57 -0000 1.103
***************
*** 62,66 ****
void playmonstersound(P_CHAR monster, unsigned short id, int sfx);
void sellaction(int s);
- void StoreItemRandomValue(P_ITEM pi,QString tmpreg); // by Magius(CHE) (2) for trade system
void clearalltrades();
--- 62,65 ----
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.443
retrieving revision 1.444
diff -C2 -d -r1.443 -r1.444
*** wolfpack.cpp 27 Aug 2003 20:35:10 -0000 1.443
--- wolfpack.cpp 27 Aug 2003 21:43:57 -0000 1.444
***************
*** 1167,1215 ****
}
- void StoreItemRandomValue(P_ITEM pi,QString tmpreg)
- { // Function Created by Magius(CHE) for trade System
- int max=0,min=0;
-
- if( pi == NULL )
- return;
- if (pi->good()<0) return;
-
- if (tmpreg == "none" )
- {
- P_ITEM pio = pi->getOutmostItem();
- if (!pio) return;
- cTerritory* Region;
- if (pio->isInWorld())
- {
- Region = AllTerritories::instance()->region( pio->pos().x, pio->pos().y, pio->pos().map );
- if( Region != NULL )
- tmpreg = Region->name();
- }
- else
- {
- P_CHAR pc = dynamic_cast<P_CHAR>(pio->container());
- if (!pc) return;
- Region = AllTerritories::instance()->region( pc->pos().x, pc->pos().y, pc->pos().map );
- if( Region != NULL )
- tmpreg = Region->name();
- }
- return;
- }
-
- if( pi->good() < 0 || pi->good() > 255 )
- return;
-
- cTerritory* Region = AllTerritories::instance()->region( tmpreg );
-
- min=Region->tradesystem_[pi->good()].rndmin;
- max=Region->tradesystem_[pi->good()].rndmax;
-
- if (max!=0 || min!=0)
- {
- pi->setRndValueRate( RandomNum(min,max) );
- }
- }
-
-
void init_creatures(void) // assigns the basesound, soundflag, who_am_i flag of all npcs
// LB 9.8.99/17.9/20.9
--- 1167,1170 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** world.cpp 27 Aug 2003 20:35:10 -0000 1.31
--- world.cpp 27 Aug 2003 21:43:57 -0000 1.32
***************
*** 346,353 ****
}
- // "Store Random value", whatever it does...
- if( pi->container() && pi->container()->isItem() )
- StoreItemRandomValue(pi, "none");
-
/* // effect on dex ? like plate eg.
if( pi->dx2() && pi->container() && pi->container()->isChar() )
--- 346,349 ----
|