16 #include "../bscript/berror.h" 17 #include "../bscript/bobject.h" 18 #include "../bscript/executor.h" 19 #include "../bscript/fmodule.h" 20 #include "../bscript/impstr.h" 21 #include "../clib/logfacility.h" 22 #include "../clib/strutil.h" 23 #include "../plib/systemstate.h" 40 using namespace Bscript;
41 using namespace Module;
61 chrptr = chrref_imp->
value().get();
63 if ( chrptr->orphan() )
86 if ( ( clientptr !=
nullptr ) && clientptr->isConnected() )
106 unsigned int serial = pchar_serial->
value();
107 if (
IsItem( serial ) || serial == 0 )
115 if ( chrptr !=
nullptr )
143 if ( imp ==
nullptr )
157 chrptr = chrref_imp->
value().get();
159 if ( chrptr->orphan() )
185 unsigned int serial = pchar_serial->
value();
186 if (
IsItem( serial ) || serial == 0 )
194 if ( chrptr !=
nullptr )
222 if ( imp ==
nullptr )
234 itemptr = itemref_imp->
value().get();
235 return ( !itemptr->orphan() );
246 unsigned int serial = pitem_serial->
value();
253 return ( itemptr !=
nullptr );
265 if ( imp ==
nullptr )
277 boatptr = boatref_imp->
value().
get();
278 return ( !boatptr->orphan() );
289 if ( boatptr ==
nullptr )
292 return ( !boatptr->
orphan() );
313 return ( boatptr !=
nullptr );
326 if ( imp ==
nullptr )
338 multiptr = multiref_imp->
value().
get();
339 return ( !multiptr->orphan() );
345 multiptr = boatref_imp->
value().
get();
346 return ( !multiptr->orphan() );
360 return ( multiptr !=
nullptr );
403 if ( imp ==
nullptr )
407 unsigned int objtype_long = 0;
412 objtype_long = plong->
value();
418 const char* ot_str = pstring->
data();
419 if ( !isdigit( ot_str[0] ) )
429 new BError( std::string(
"Objtype not defined: " ) + pstring->
data() ) );
437 objtype_long = strtol( ot_str,
nullptr, 0 );
444 <<
"\tParameter " << param <<
": Expected Long or String, got datatype " 452 objtype = objtype_long;
466 objtype = objtype_long;
473 <<
"\tParameter " << param <<
": Value " << objtype_long
474 <<
" is out of range for an objtype\n";
485 if ( imp ==
nullptr )
489 unsigned int objtype_long = 0;
494 objtype_long = plong->
value();
500 const char* ot_str = pstring->
data();
501 if ( !isdigit( ot_str[0] ) )
512 new BError( std::string(
"Objtype not defined: " ) + pstring->
data() ) );
520 objtype_long = strtol( ot_str,
nullptr, 0 );
531 catch ( std::exception& ex )
533 std::string message = std::string(
"Unable to create item descriptor: " ) + ex.what();
542 <<
"\tParameter " << param <<
": Expected Long, String, or Struct, got datatype " 556 itemdesc_out = itemdesc;
568 unsigned int objtype = objtype_long;
587 <<
"\tParameter " << param <<
": Value " << objtype_long
588 <<
" is out of range for an objtype\n";
600 skillid =
static_cast<USKILLID>( skillval );
void setFunctionResult(BObjectImp *imp)
unsigned short default_doubleclick_range
BApplicObjType echaracterrefobjimp_type
const std::string & value() const
Vital * FindVital(const std::string &str)
unsigned int get_objtype_byname(const char *str)
BApplicObjType eitemrefobjimp_type
virtual bool offline_access_ok() const
bool isa(BObjectType type) const
std::string decint(unsigned short v)
virtual class UBoat * as_boat()
const ItemDesc & find_itemdesc(unsigned int objtype)
BApplicObjType emultirefobjimp_type
std::unique_ptr< Items::ItemDesc > temp_itemdesc
bool getAttributeParam(Executor &exec, unsigned param, const Mobile::Attribute *&attr)
std::string hexint(unsigned short v)
const BApplicObjType * object_type() const
bool getVitalParam(Executor &exec, unsigned param, const Vital *&vital)
bool getCharacterParam(Bscript::Executor &exec, unsigned param, Mobile::Character *&chrptr)
boost_utils::function_name_flystring name
BApplicObjType eclientrefobjimp_type
Multi::UMulti * system_find_multi(u32 serial)
bool getCharacterOrClientParam(Executor &exec, unsigned param, Mobile::Character *&chrptr, Network::Client *&clientptr)
NetworkManager networkManager
BApplicObjType euboatrefobjimp_type
bool getItemParam(Executor &exec, unsigned param, Items::Item *&itemptr)
SettingsManager settingsManager
Mobile::Character * system_find_mobile(u32 serial)
bool getObjtypeParam(Executor &exec, unsigned param, unsigned int &objtype)
unsigned int default_decay_time
bool IsCharacter(u32 serial)
Items::Item * system_find_item(u32 serial)
const std::string & scriptname() const
virtual UBoat * as_boat() POL_OVERRIDE
bool getUObjectParam(Executor &exec, unsigned param, UObject *&objptr)
const String * getStringParam(unsigned param)
const ItemDesc * CreateItemDescriptor(Bscript::BStruct *itemdesc_struct)
bool getMultiParam(Executor &exec, unsigned param, Multi::UMulti *&multiptr)
D explicit_cast(const S &s)
bool getSkillIdParam(Executor &exec, unsigned param, USKILLID &skillid)
bool has_itemdesc(u32 objtype)
const char * data() const
static const char * typestr(BObjectType typ)
BObjectImp * getParamImp(unsigned param)
ModuleFunction * current_module_function
bool getUBoatParam(Executor &exec, unsigned param, Multi::UBoat *&boatptr)
static Attribute * FindAttribute(const std::string &str)
UoClientGeneral uoclient_general
bool getParam(unsigned param, int &value)