8 #include "../../bscript/bobject.h" 9 #include "../../clib/cfgelem.h" 10 #include "../../clib/cfgfile.h" 11 #include "../../clib/logfacility.h" 12 #include "../../clib/passert.h" 13 #include "../../clib/rawtypes.h" 14 #include "../globals/object_storage.h" 15 #include "../globals/uvars.h" 16 #include "../item/item.h" 17 #include "../item/itemdesc.h" 18 #include "../mobile/npc.h" 19 #include "../multi/multi.h" 20 #include "../npctmpl.h" 22 #include "../uworld.h" 45 INFO_PRINT <<
"Successes: " << successes <<
"\n" 46 <<
"Failures: " << failures <<
"\n";
49 using namespace Items;
62 Item*
add_item(
unsigned int objtype,
unsigned short x,
unsigned short y,
short z )
69 item->
z =
static_cast<s8>( z );
75 void add_multi(
unsigned int objtype,
unsigned short x,
unsigned short y,
short z )
81 multi->
z =
static_cast<s8>( z );
86 void add_multi(
unsigned int objtype,
unsigned short x,
unsigned short y,
short z,
int flags )
90 static_cast<s8>( z ), realm, flags ) );
99 throw std::runtime_error( std::string(
"NPC template '" ) + npctype +
"' not found" );
112 npc->readPropertiesForNewNPC( elem );
173 test_guard_door =
add_item( 0x6e7, 1412, 1621, 30 );
175 test_banker =
add_npc(
"banker", 1412, 1624, 25 );
176 test_water_elemental =
add_npc(
"waterelemental", 1482, 1780, -2 );
177 test_seaserpent =
add_npc(
"seaserpent", 1479, 1763, -5 );
186 test_chest1 =
add_item( 0xe42, 1479, 1755, -2 );
187 test_chest2 =
add_item( 0xe43, 1479, 1755, -2 );
188 test_banker2 =
add_npc(
"banker", 1479, 1754, -2 );
191 test_orclord =
add_npc(
"orclord", 2648, 2193, -20 );
192 test_banker3 =
add_npc(
"banker", 2648, 2193, 4 );
200 for (
int i = 0; i < 100; ++i )
void add_multi(unsigned int objtype, unsigned short x, unsigned short y, short z)
static Item * create(u32 objtype, u32 serial=0)
void clear_prop(const char *propname)
void add_item_to_world(Items::Item *item)
void display_test_results()
bool FindNpcTemplate(const char *template_name, Clib::ConfigElem &elem)
void SetCharacterWorldPosition(Mobile::Character *chr, Realms::WorldChangeReason reason)
u32 GetNextSerialNumber(void)
Mobile::NPC * test_banker2
void create_test_environment()
Mobile::NPC * test_seaserpent
const ItemDesc & find_itemdesc(unsigned int objtype)
const int CRMULTI_FACING_WEST
void add_multi_to_world(Multi::UMulti *multi)
Mobile::NPC * add_npc(const char *npctype, unsigned short x, unsigned short y, short z)
void add_prop(std::string propname, std::string propval)
static Bscript::BObjectImp * scripted_create(const Items::ItemDesc &descriptor, u16 x, u16 y, s8 z, Realms::Realm *realm, int flags)
static UMulti * create(const Items::ItemDesc &descriptor, u32 serial=0)
bool Insert(UObject *obj)
ObjectStorageManager objStorageManager
unsigned short remove_ushort(const char *propname)
Mobile::NPC * test_orclord
const int CRMULTI_FACING_NORTH
Mobile::NPC * test_banker3
Realms::Realm * main_realm
Mobile::NPC * test_water_elemental
Item * add_item(unsigned int objtype, unsigned short x, unsigned short y, short z)
Mobile::NPC * test_banker