else if( !strcmp( name, "smelt" ) ) self->pItem->setSmelt( PyInt_AS_LONG( value ) );
int wpItem_setAttr( wpItem *self, char *name, PyObject *value ){	if( !strcmp( name, "id" ) )		self->pItem->setId( PyInt_AS_LONG( value ) );	//else setStrProperty( "name", pItem->name )	else if( !strcmp( "name", name ) )		self->pItem->setName( PyString_AS_STRING( value ) ); 	else if( !strcmp( "name2", name ) )		self->pItem->setName2( PyString_AS_STRING( value ) );		else if( !strcmp( "color", name ) )		self->pItem->setColor( PyInt_AS_LONG( value ) );	else if( !strcmp( "amount", name ) )		self->pItem->setAmount( PyInt_AS_LONG( value ) );	else if( !strcmp( "amount2", name ) )		self->pItem->setAmount2( PyInt_AS_LONG( value ) );	else setIntProperty( "serial", pItem->serial )	else if( !strcmp( name, "layer" ) )		self->pItem->setLayer( PyInt_AS_LONG( value ) );		else if( !strcmp( name, "twohanded" ) )		self->pItem->setTwohanded( ( PyInt_AS_LONG( value ) != 0 ) ? true : false );	else if( !strcmp( name, "type" ) )		self->pItem->setType( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "hp" ) )		self->pItem->setHp( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "maxhp" ) )		self->pItem->setMaxhp( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "type2" ) )		self->pItem->setType2( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "weight" ) )		self->pItem->setWeight( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "moreb1" ) )		self->pItem->setMoreb1( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "moreb2" ) )		self->pItem->setMoreb1( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "moreb3" ) )		self->pItem->setMoreb1( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "moreb4" ) )		self->pItem->setMoreb1( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "decay" ) )		if( PyObject_IsTrue( value ) )		{			self->pItem->priv |= 0x01;			self->pItem->startDecay();		}		else		{			self->pItem->priv &= 0xFE;			self->pItem->decaytime = 0;		}	// CONTAINER!!	else setIntProperty( "more1", pItem->more1 )	else setIntProperty( "more2", pItem->more2 )	else setIntProperty( "more3", pItem->more3 )	else setIntProperty( "more4", pItem->more4 )	else setIntProperty( "morex", pItem->morex )	else setIntProperty( "morey", pItem->morey )	else setIntProperty( "morez", pItem->morez )	else setIntProperty( "doordir", pItem->doordir )	else setIntProperty( "dooropen", pItem->dooropen )	// PILEABLE	else setIntProperty( "dye", pItem->dye )	else setIntProperty( "defense", pItem->def )	else setIntProperty( "str", pItem->st )	else setIntProperty( "dex", pItem->dx )	else setIntProperty( "int", pItem->in )	else setIntProperty( "str2", pItem->st2 )	else setIntProperty( "dex2", pItem->dx2 )	else setIntProperty( "int2", pItem->in2 )	else if( !strcmp( name, "speed" ) )		self->pItem->setSpeed( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "corpse" ) )		self->pItem->setCorpse( ( PyInt_AS_LONG( value ) == 0 ) ? false : true );	else if( !strcmp( name, "lodamage" ) )		self->pItem->setLodamage( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "hidamage" ) )		self->pItem->setHidamage( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "smelt" ) )		self->pItem->setSmelt( PyInt_AS_LONG( value ) );	else if( !strcmp( name, "secured" ) )		self->pItem->setSecured( ( PyInt_AS_LONG( value ) == 1 ) ? true : false );	else setIntProperty( "moveable", pItem->magic )	else setIntProperty( "gatetime", pItem->gatetime )	else setIntProperty( "gatenumber", pItem->gatenumber )	else setIntProperty( "decaytime", pItem->decaytime )	// ownserial	else setIntProperty( "visible", pItem->visible )	// spanserial	else setIntProperty( "dir", pItem->dir ) // lightsource type	else setIntProperty( "priv", pItem->priv ) 	else setIntProperty( "value", pItem->value ) 	else setIntProperty( "restock", pItem->restock )	else setIntProperty( "value", pItem->value ) 	else setIntProperty( "disabled", pItem->disabled )	else setStrProperty( "disabledmsg", pItem->disabledmsg ) 	else setIntProperty( "poisoned", pItem->poisoned ) 	else if( !strcmp( name, "murderer" ) )		self->pItem->setMurderer( PyString_AS_STRING( value ) );	else setIntProperty( "murdertime", pItem->murdertime ) 	else setIntProperty( "rank", pItem->rank ) 	else setStrProperty( "creator", pItem->creator ) 	else setIntProperty( "good", pItem->good ) 	else setIntProperty( "madewith", pItem->madewith ) 	else setStrProperty( "desc", pItem->desc ) 	else if( !strcmp( name, "spawnregion" ) )		self->pItem->setSpawnRegion( PyString_AS_STRING( value ) );		// Moving the item into a container	else if( !strcmp( name, "container" ) )	{		// Check if we're passed an item		SERIAL contserial = 0; // 0 = invalid = cancel		P_CHAR pChar = getWpChar( value );		P_ITEM pItem = getWpItem( value );		if( value == Py_None )			contserial = INVALID_SERIAL;		else if( pChar )			contserial = pChar->serial;		else if( pItem )			contserial = pItem->serial;		else if( PyInt_Check( value ) )		{			// Check if it could be a valid serial			SERIAL sSerial = PyInt_AsLong( value );			pItem = FindItemBySerial( sSerial );			pChar = FindCharBySerial( sSerial );			if( pItem )				contserial = sSerial;			else if( pChar )				contserial = sSerial;		}		if( contserial != 0 )		{			self->pItem->setContSerial( contserial );			// Get a random position			if( pItem && ( pItem->GetContGumpType() != -1 ) )				self->pItem->SetRandPosInCont( pItem );			// Or put it on the right layer (chars)			if( pChar && self->pItem->layer() == 0 )			{				tile_st tInfo = cTileCache::instance()->getTile( self->pItem->id() );				if( tInfo.layer > 0 )					self->pItem->setLayer( tInfo.layer );			}		}	}	return 0;}