16 #include "../clib/cfgelem.h" 17 #include "../clib/logfacility.h" 18 #include "../clib/streamsaver.h" 19 #include "../plib/systemstate.h" 40 else if ( descriptor.
spelltype ==
"Necro" )
42 else if ( descriptor.
spelltype ==
"Paladin" )
46 else if ( descriptor.
spelltype ==
"Mysticism" )
48 else if ( descriptor.
spelltype ==
"Bushido" )
50 else if ( descriptor.
spelltype ==
"Ninjitsu" )
52 else if ( descriptor.
spelltype ==
"SpellWeaving" )
54 else if ( descriptor.
spelltype ==
"BardMasteries" )
56 for (
int i = 0; i < 8; ++i )
64 return sizeof(
u8 ) * 8
80 send_sysmessage( client,
"Spellbooks must be equipped or in the top level backpack to use." );
94 send_sysmessage( client,
"This item requires at least the Age of Shadows Expansion." );
100 send_sysmessage( client,
"This item requires at least the Samurai Empire Expansion." );
105 send_sysmessage( client,
"This item requires at least the Mondain's Legacy Expansion." );
111 send_sysmessage( client,
"This item requires at least the Stygian Abyss Expansion." );
123 INFO_PRINT <<
"Client with AOS Expansion Account using spellbook without UOFeatureEnable " 132 msg->WriteFlipped<
u16>( 23u );
134 msg->WriteFlipped<
u16>( 1u );
140 msg->WriteFlipped<
u16>( 678u );
154 if ( spellid >= 678 && spellid <= 693 )
157 spellschool =
static_cast<u8>( spellid / 100 );
164 if ( spellid >= 678 && spellid <= 693 )
165 spellnumber =
static_cast<u16>( spellid - 677 );
167 spellnumber =
static_cast<u16>( spellid % 100 );
170 spellnumber = spellnumber & 63;
171 if ( spellnumber == 0 )
174 u8 spellslot = spellnumber & 7;
175 if ( spellslot == 0 )
178 if ( ( (
bitwise_contents[( spellnumber - 1 ) >> 3] ) & ( 1 << ( spellslot - 1 ) ) ) != 0 )
191 if ( spellid >= 678 && spellid <= 693 )
192 spellnumber =
static_cast<u16>( spellid - 677 );
194 spellnumber =
static_cast<u16>( spellid % 100 );
197 spellnumber = spellnumber & 63;
198 if ( spellnumber == 0 )
201 u8 spellslot = spellnumber & 7;
202 if ( spellslot == 0 )
217 if ( spellid >= 678 && spellid <= 693 )
218 spellnumber =
static_cast<u16>( spellid - 677 );
220 spellnumber =
static_cast<u16>( spellid % 100 );
223 spellnumber = spellnumber & 63;
224 if ( spellnumber == 0 )
227 u8 spellslot = spellnumber & 7;
228 if ( spellslot == 0 )
249 u8 spellslot = spellnum & 7;
250 if ( spellslot == 0 )
268 u8 spellslot = spellnum & 7;
269 if ( spellslot == 0 )
280 for (
int i = 0; i < 8; ++i )
288 std::ostringstream os;
289 for (
int i = 0; i < 8; ++i )
291 os <<
"Spellbits" << i;
316 u8 spellslot = spellnum & 7;
317 if ( spellslot == 0 )
342 else if ( spellnum <= 7 )
389 for (
u16 i = 0; i < 64; ++i )
393 u8 spellpos = spellnumber & 7;
397 ( 1 << ( spellpos - 1 ) ) ) != 0 )
399 msg->Write<
u32>( 0x7FFFFFFFu - spellnumber );
400 msg->WriteFlipped<
u16>( objtype );
402 msg->WriteFlipped<
u16>( spellnumber );
403 msg->WriteFlipped<
u16>( 1u );
404 msg->WriteFlipped<
u16>( 1u );
406 msg->Write<
u8>( 0u );
408 msg->WriteFlipped<
u16>( 0u );
412 u16 len = msg->offset;
414 msg->WriteFlipped<
u16>( len );
416 msg.
Send( client, len );
Contents::const_iterator const_iterator
bool add_spellid(unsigned int spellid)
void send_book_old(Network::Client *client)
virtual void printProperties(Clib::StreamWriter &sw) const POL_OVERRIDE
virtual void double_click(Network::Client *client) POL_OVERRIDE
void send_open_gump(Network::Client *client, const UContainer &cont)
virtual void printOn(Clib::StreamWriter &sw) const POL_OVERRIDE
Contents::iterator iterator
virtual void readProperties(Clib::ConfigElem &elem) POL_OVERRIDE
virtual void add_bulk(int item_count_delta, int weight_delta) POL_OVERRIDE
virtual bool script_isa(unsigned isatype) const POL_OVERRIDE
bool has_spellid(unsigned int spellid) const
virtual void printSelfOn(Clib::StreamWriter &sw) const POL_OVERRIDE
void Send(Client *client, int len=-1) const
virtual void add(Items::Item *item) POL_OVERRIDE
unsigned short uo_feature_enable
std::array< std::array< u32, 2 >, 8 > spell_scroll_objtype_limits
Core::UContainer * container
#define GET_ITEM_PTR(itr)
virtual void printOn(Clib::StreamWriter &sw) const POL_OVERRIDE
void send_wornitem(Client *client, const Character *chr, const Item *item)
SettingsManager settingsManager
unsigned int count() const
const unsigned POLCLASS_SPELLBOOK
virtual size_t estimatedSize() const POL_OVERRIDE
virtual void printProperties(Clib::StreamWriter &sw) const POL_OVERRIDE
bool remove_spellid(unsigned int spellid)
bool is_equipped(const Items::Item *item) const
virtual size_t estimatedSize() const POL_OVERRIDE
unsigned short remove_ushort(const char *propname)
virtual bool can_add(const Items::Item &item) const POL_OVERRIDE
const ItemDesc & itemdesc() const
virtual size_t estimatedSize() const POL_OVERRIDE
void send_spellbook_contents(Network::Client *client, Spellbook &spellbook)
void calc_current_bitwise_contents()
Spellbook(const Items::SpellbookDesc &descriptor)
void send_sysmessage(Network::Client *client, const char *text, unsigned short font, unsigned short color)
void send_put_in_container(Client *client, const Item *item)
virtual void readProperties(Clib::ConfigElem &elem) POL_OVERRIDE
void printContents(Clib::StreamWriter &sw) const