Pol  Revision:cb584c9
Pol::Mobile::NPC Class Reference

#include <npc.h>

+ Inheritance diagram for Pol::Mobile::NPC:

Public Member Functions

 NPC (u32 objtype, const Clib::ConfigElem &elem)
 
virtual ~NPC ()
 
Core::NpcTemplate::ALIGNMENT alignment () const
 
bool anchor_allows_move (Core::UFACING dir) const
 
virtual void apply_raw_damage_hundredths (unsigned int damage, Character *source, bool userepsys=true, bool send_damage_packet=false) POL_OVERRIDE
 
virtual unsigned short ar () const POL_OVERRIDE
 
virtual double armor_absorb_damage (double damage) POL_OVERRIDE
 
bool can_accept_event (Core::EVENTID eventid)
 
virtual bool can_be_renamed_by (const Character *chr) const POL_OVERRIDE
 
bool could_move (Core::UFACING dir) const
 
virtual Bscript::BObjectImpcustom_script_method (const char *methodname, Bscript::Executor &ex) POL_OVERRIDE
 
virtual void destroy () POL_OVERRIDE
 
virtual size_t estimatedSize () const POL_OVERRIDE
 
virtual void get_hitscript_params (double damage, Items::UArmor **parmor, unsigned short *rawdamage) POL_OVERRIDE
 
virtual Bscript::BObjectImpget_script_member (const char *membername) const POL_OVERRIDE
 
virtual Bscript::BObjectImpget_script_member_id (const int id) const POL_OVERRIDE
 
virtual unsigned char hilite_color_idx (const Character *seen_by) const POL_OVERRIDE
 [16] NPC Highlighting If the NPC has a master, Highlight color is the same as the Master's. Else the NPC is invul Hilite them invul is ssopt.cfg option says to. Else Highlight Good NPCs INNOCENT (Blue) Highlight Neutral NPCs ATTACKABLE (Grey) Highlight Evil NPCs MURDERER (Red) More...
 
virtual void inform_criminal (Character *thecriminal) POL_OVERRIDE
 
virtual void inform_disengaged (Character *disengaged) POL_OVERRIDE
 
virtual void inform_engaged (Character *engaged) POL_OVERRIDE
 
virtual void inform_enteredarea (Character *whoentered) POL_OVERRIDE
 
virtual void inform_imoved (Character *chr) POL_OVERRIDE
 
virtual void inform_leftarea (Character *wholeft) POL_OVERRIDE
 
virtual void inform_moved (Character *moved) POL_OVERRIDE
 
virtual Items::UWeaponintrinsic_weapon () POL_OVERRIDE
 
Charactermaster () const
 
virtual unsigned short name_color (const Character *seen_by) const POL_OVERRIDE
 
bool no_drop_exception () const
 
void no_drop_exception (bool newvalue)
 
bool npc_path_blocked (Core::UFACING dir) const
 
virtual void on_death (Items::Item *corpse) POL_OVERRIDE
 
void on_ghost_pc_spoke (Character *src_chr, const char *speech, u8 texttype)
 
void on_ghost_pc_spoke (Character *src_chr, const char *speech, u8 texttype, const u16 *wspeech, const char lang[4], Bscript::ObjArray *speechtokens=nullptr)
 
void on_pc_spoke (Character *src_chr, const char *speech, u8 texttype)
 
void on_pc_spoke (Character *src_chr, const char *speech, u8 texttype, const u16 *wspeech, const char lang[4], Bscript::ObjArray *speechtokens=nullptr)
 
virtual void readProperties (Clib::ConfigElem &elem) POL_OVERRIDE
 
void readPropertiesForNewNPC (Clib::ConfigElem &elem)
 
virtual void refresh_ar () POL_OVERRIDE
 
virtual void repsys_on_attack (Character *defender) POL_OVERRIDE
 [13.2] NPC (MA) Attacks Mobile (MB) If MA has a Master (Amy), Apply 'Player Attacks Mobile' rules[->13.1] for Amy vs MB Else Exit with no (RepSystem) effect. More...
 
virtual void repsys_on_damage (Character *defender) POL_OVERRIDE
 [14.2] NPC (MA) Damages Mobile (MB) If MA has a Master (Amy), Apply 'Player Damages Mobile' rules[->14.1] for Amy vs MB Else Exit with no (RepSystem) effect. More...
 
virtual void repsys_on_help (Character *recipient) POL_OVERRIDE
 [15.2] NPC (MA) Helps Mobile (MB) If MA has a Master (Amy), Apply 'Player Helps Mobile' rules[->15.1] for Amy helps MB Else Exit with no (RepSystem) effect. More...
 
void restart_script ()
 
virtual bool script_isa (unsigned isatype) const POL_OVERRIDE
 
virtual Bscript::BObjectImpscript_method (const char *methodname, Bscript::Executor &ex) POL_OVERRIDE
 
virtual Bscript::BObjectImpscript_method_id (const int id, Bscript::Executor &ex) POL_OVERRIDE
 
bool send_event (Bscript::BObjectImp *event)
 
Bscript::BObjectImpsend_event_script (Bscript::BObjectImp *event)
 
virtual Bscript::BObjectImpset_script_member (const char *membername, int value) POL_OVERRIDE
 id test More...
 
virtual Bscript::BObjectImpset_script_member (const char *membername, const std::string &) POL_OVERRIDE
 id test More...
 
virtual Bscript::BObjectImpset_script_member_id (const int id, int value) POL_OVERRIDE
 
virtual Bscript::BObjectImpset_script_member_id (const int id, const std::string &) POL_OVERRIDE
 
void start_script ()
 
std::string templatename () const
 
bool use_adjustments () const
 
void use_adjustments (bool newvalue)
 
- Public Member Functions inherited from Pol::Mobile::Character
 Character (u32 objtype, Core::UOBJ_CLASS uobj_class=Core::UOBJ_CLASS::CLASS_CHARACTER)
 
virtual ~Character ()
 
void add_remote_container (Items::Item *)
 
void add_to_be_reportable (u32 serial)
 
void addBuff (u16 icon, u16 duration, u32 cl_name, u32 cl_descr, const std::vector< u32 > &arguments)
 
std::string all_privs () const
 
std::string all_settings () const
 
double apply_damage (double damage, Character *source=nullptr, bool userepsys=true, bool send_damage_packet=false)
 
void attack (Character *opponent)
 
const AttributeValueattribute (unsigned attrid) const
 
AttributeValueattribute (unsigned attrid)
 
Core::UContainerbackpack () const
 
void calc_single_attribute (const Attribute *pAttr)
 
void calc_single_vital (const Core::Vital *pVital)
 
void calc_vital_stuff (bool i_mod=true, bool v_mod=true)
 
bool can_access (const Items::Item *item, int range=-1) const
 
bool can_be_heard_as_ghost () const
 
bool can_clothe (const Character *chr) const
 
bool can_dblclickany () const
 
bool can_face (Core::UFACING i_facing)
 
bool can_freemove () const
 
bool can_hearghosts () const
 
bool can_move (const Items::Item *item) const
 
bool can_moveanydist () const
 
bool can_plogany () const
 
bool can_rename (const Character *chr) const
 
bool can_seeinvisitems () const
 
bool can_speedhack () const
 
void cancel_menu ()
 
void cancel_party_invite_timeout ()
 
unsigned short carrying_capacity () const
 A Mobile's carrying capacity is (40 + 3.5*STR + chr.carrying_capacity_mod)*ssopt.carrying_capacity_mod stones. More...
 
bool casting_spell () const
 
int charindex () const
 
void check_attack_after_move ()
 
void check_concealment_level ()
 
void check_justice_region_change ()
 
void check_light_region_change ()
 
void check_music_region_change ()
 
void check_region_changes ()
 
bool check_skill (Core::USKILLID skillid, int difficulty, unsigned short pointvalue)
 
void check_undamaged ()
 Clear a Mobile's ToBeReportable list when all of the following are true: 1) hits are at maximum 2) mobile is not poisoned 3) mobile is not paralyzed. More...
 
void check_weather_region_change (bool force=false)
 
bool CheckPushthrough ()
 
Items::UArmorchoose_armor () const
 
void clear_criminal_timer ()
 
void clear_gotten_item ()
 
void clear_my_aggressors ()
 
void clear_my_lawful_damagers ()
 
void clear_opponent_of ()
 
void clear_reportable (u32 serial, Core::polclock_t time)
 
void clear_to_be_reportables ()
 
void clearBuffs ()
 
unsigned char cmdlevel () const
 
void cmdlevel (unsigned char value, bool update_on_change=true)
 
void commit_to_reportables ()
 
unsigned char concealed () const
 
void concealed (unsigned char value)
 
bool connected () const
 
void connected (bool newvalue)
 
bool consume (const Core::Vital *pVital, VitalValue &vv, unsigned int amt)
 
void create_trade_container ()
 
bool CustomHousingMove (unsigned char i_dir)
 
void damage_weapon ()
 
bool dead () const
 
bool deafened () const
 
bool delBuff (u16 icon)
 
u16 dexterity () const
 
void die ()
 
void disable_regeneration_for (int seconds)
 
void disconnect_cleanup ()
 
void do_attack_effects (Character *target)
 
void do_hit_failure_effects ()
 
void do_hit_success_effects ()
 
void do_imhit_effects ()
 
bool doors_block () const
 
 DYN_PROPERTY (lightoverride, int, Core::PROP_LIGHTOVERRIDE,-1)
 
 DYN_PROPERTY (lightoverride_until, Core::gameclock_t, Core::PROP_LIGHTOVERRIDE_UNTIL, 0)
 
 DYN_PROPERTY (movement_cost, Core::MovementCostMod, Core::PROP_MOVEMENTCOST_MOD, Core::MovementCostMod::DEFAULT)
 
 DYN_PROPERTY (disable_skills_until, time_t, Core::PROP_DISABLE_SKILLS_UNTIL, 0)
 
 DYN_PROPERTY (skillstatcap, Core::SkillStatCap, Core::PROP_STATCAP_SKILLCAP, Core::SkillStatCap::DEFAULT)
 
 DYN_PROPERTY (luck, s16, Core::PROP_EXT_STATBAR_LUCK, 0)
 
 DYN_PROPERTY (followers, Core::ExtStatBarFollowers, Core::PROP_EXT_STATBAR_FOLLOWERS, Core::ExtStatBarFollowers::DEFAULT)
 
 DYN_PROPERTY (tithing, s32, Core::PROP_EXT_STATBAR_TITHING, 0)
 
 DYN_PROPERTY (dblclick_wait, u32, Core::PROP_DOUBLECLICK_WAIT, 0)
 
 DYN_PROPERTY (title_prefix, std::string, Core::PROP_TITLE_PREFIX,"")
 
 DYN_PROPERTY (title_suffix, std::string, Core::PROP_TITLE_SUFFIX,"")
 
 DYN_PROPERTY (title_guild, std::string, Core::PROP_TITLE_GUILD,"")
 
 DYN_PROPERTY (title_race, std::string, Core::PROP_TITLE_RACE,"")
 
 DYN_PROPERTY_POINTER (gotten_item, Items::Item *, Core::PROP_GOTTEN_BY)
 
 DYN_PROPERTY_POINTER (guild, Core::Guild *, Core::PROP_GUILD)
 
 DYN_PROPERTY_POINTER (party, Core::Party *, Core::PROP_PARTY)
 
 DYN_PROPERTY_POINTER (candidate_of, Core::Party *, Core::PROP_PARTY_CANDIDATE)
 
 DYN_PROPERTY_POINTER (offline_mem_of, Core::Party *, Core::PROP_PARTY_OFFLINE)
 
void equip (Items::Item *item)
 
bool equippable (const Items::Item *item) const
 
bool face (Core::UFACING i_facing, int flags=0)
 
Items::Itemfind_wornitem (u32 find_serial) const
 
bool frozen () const
 
Characterget_attackable_opponent () const
 
u8 get_flag1 (Network::Client *other_client) const
 
Characterget_opponent () const
 
Items::UArmorget_shield () const
 
unsigned short get_weapon_skill () const
 
Bscript::ObjArrayGetAggressorTo () const
 
Bscript::ObjArrayGetLawFullyDamaged () const
 
void getpos_ifmove (Core::UFACING i_facing, unsigned short *px, unsigned short *py)
 
Bscript::ObjArrayGetReportables () const
 
unsigned int gold_carried () const
 
void grant_privilege (const char *priv)
 
unsigned int guildid () const
 
bool has_active_client () const
 
bool has_active_gump () const
 
bool has_active_prompt () const
 
bool has_lawfully_damaged (const Character *chr) const
 
bool has_party_invite_timeout () const
 
bool has_privilege (const char *priv) const
 
bool has_shield () const
 
void heal_damage_hundredths (unsigned int damage)
 When a Mobile is Healed. More...
 
bool hidden () const
 
void hidden (bool value)
 
const CharacterSethostiles () const
 
bool ignores_line_of_sight () const
 
u16 intelligence () const
 
bool invul () const
 
bool is_aggressor_to (const Character *chr) const
 
bool is_attackable (Character *who) const
 
bool is_concealed_from_me (const Character *chr) const
 
bool is_criminal () const
 A Mobile is Criminal if: he has an active Criminal Timer, which has not timed out. OR he is a murderer. More...
 
bool is_equipped (const Items::Item *item) const
 
bool is_guild_ally (const Character *chr) const
 [10] Guild Rules The following Guild Rules are only temporary pending a more complete system More...
 
bool is_guild_enemy (const Character *chr) const
 [10.2] Guild Enemies Bob and Amy are Guild Enemies if: Bob is in a guild, AND Amy is in a guild, AND Bob's Guild is an Enemy Guild of Amy's Guild More...
 
bool is_house_editing () const
 
bool is_innocent_to (const Character *chr) const
 [9] Innocent Status

Bob is Innocent to Amy if:

Bob is Innocent to Amy only if NONE of the following are true: Bob is a murderer; Bob is a criminal Bob is an Aggressor to Amy Bob is a Guild Ally of Amy Bob is a Guild Enemy of Amy Amy has Lawfully Damaged Bob More...
 
bool is_murderer () const
 
bool is_temporally_criminal () const
 
bool is_trading () const
 
bool is_visible () const
 
bool is_visible_to_me (const Character *chr) const
 
u16 last_textcolor () const
 
void last_textcolor (u16 new_color)
 
bool layer_is_equipped (int layer) const
 
bool logged_in () const
 
void logged_in (bool newvalue)
 
void make_aggressor_to (Character *chr)
 
void make_criminal (int level=1)
 To Set Amy Criminal (For a LevelOfOffense) More...
 
void make_lawfullydamaged_to (Character *chr)
 
void make_murderer (bool newlval=true)
 
Bscript::BObjectImpmake_offline_ref ()
 
virtual Bscript::BObjectImpmake_ref () POL_OVERRIDE
 
bool manual_set_swing_timer (int time)
 
u16 max_hits () const
 
u32 max_hits_hundredths () const
 
u16 max_mana () const
 
u16 max_stamina () const
 
unsigned short max_weapon_damage () const
 
bool mightsee (const Items::Item *item) const
 
unsigned short min_weapon_damage () const
 
bool move (unsigned char dir)
 
void on_aggressor_changed ()
 
void on_aos_ext_stat_changed ()
 
void on_cmdlevel_changed ()
 
virtual void on_color_changed () POL_OVERRIDE
 
void on_concealed_changed ()
 
void on_criminal_changed ()
 
void on_delete_from_account ()
 
virtual void on_facing_changed () POL_OVERRIDE
 
void on_hidden_changed ()
 
void on_lawfullydamaged_changed ()
 
bool on_mount () const
 
void on_murderer_changed ()
 
void on_poison_changed ()
 
void on_swing_failure (Character *attacker)
 
bool paralyzed () const
 
bool party_can_loot () const
 
bool poisoned () const
 
void poisoned (bool value)
 
void position_changed (void)
 
void produce (const Core::Vital *pVital, VitalValue &vv, unsigned int amt)
 
unsigned short random_weapon_damage () const
 
void readAttributesAndVitals (Clib::ConfigElem &elem)
 
void readCommonProperties (Clib::ConfigElem &elem)
 
void realm_changed ()
 
void regen_vital (const Core::Vital *)
 
void removal_cleanup ()
 
void remove_as_aggressor_to (Character *chr)
 
void remove_as_lawful_damager (Character *chr)
 
void reset_swing_timer ()
 
void resetEquipableProperties ()
 
void restart_aggressor_timer (Character *chr, Core::polclock_t until)
 
void restart_criminal_timer (Core::polclock_t until)
 
void restart_lawfully_damaged_timer (Character *chr, Core::polclock_t until)
 
void resurrect ()
 
void revoke_privilege (const char *priv)
 
void run_hit_script (Character *defender, double damage)
 
void schedule_spell (Core::USpell *)
 
Items::Itemsearch_remote_containers (u32 find_serial, bool *isRemoteContainer) const
 
void select_opponent (u32 opp_serial)
 
void send_buffs ()
 
void send_highlight () const
 
void send_warmode ()
 
void set_caps_to_default ()
 
void set_current (const Core::Vital *pVital, VitalValue &vv, unsigned int ones)
 
void set_current_ones (const Core::Vital *pVital, VitalValue &vv, unsigned int ones)
 
void set_dexterity (u16 dexterity)
 
void set_intelligence (u16 intelligence)
 
void set_opponent (Character *opponent, bool inform_old_opponent=true)
 
void set_party_can_loot (bool)
 
void set_party_invite_timeout ()
 
void set_privs (const std::string &privlist)
 
virtual Bscript::BObjectImpset_script_member_id_double (const int id, double value) POL_OVERRIDE
 
void set_setting (const char *setting, bool value)
 
void set_stealthsteps (unsigned short newval)
 
void set_strength (u16 strength)
 
void set_vitals_to_maximum ()
 
void set_warmode (bool warmode)
 
virtual void setfacing (u8 newfacing) POL_OVERRIDE
 
virtual bool setgraphic (u16 newobjtype) POL_OVERRIDE
 
bool setting_enabled (const char *setting) const
 
void showarmor () const
 
bool skill_ex_active () const
 
Core::Spellbookspellbook (u8 school) const
 
void spend_gold (unsigned int amount)
 
bool squelched () const
 
bool start_itemuse_script (Bscript::EScriptProgram *prog, Items::Item *item, bool start_attached)
 
bool start_script (Bscript::EScriptProgram *prog, bool start_attached, Bscript::BObjectImp *param2=nullptr, Bscript::BObjectImp *param3=nullptr, Bscript::BObjectImp *param4=nullptr)
 
bool start_skill_script (Bscript::EScriptProgram *prog)
 
bool start_spell_script (Bscript::EScriptProgram *prog, Core::USpell *spell)
 
u16 strength () const
 
bool strong_enough_to_equip (const Items::Item *item) const
 
bool target_cursor_busy () const
 
virtual const char * target_tag () const POL_OVERRIDE
 
void tellmove (void)
 
bool trade_accepted () const
 
void trade_accepted (bool newvalue)
 
Core::UContainertrade_container ()
 
void unequip (Items::Item *item)
 
void unhide ()
 
void updateEquipableProperties (Items::Item *item)
 
void validate_stat_ranges ()
 
const VitalValuevital (unsigned vitalid) const
 
VitalValuevital (unsigned vitalid)
 
bool warmode () const
 
Core::UACTION weapon_anim () const
 
const AttributeValueweapon_attribute () const
 
Core::USKILLID weapon_skillid () const
 
virtual unsigned int weight () const POL_OVERRIDE
 A Mobile's weight is 10 stones + the weight of their equipment. More...
 
Items::Itemwornitem (int layer) const
 
- Public Member Functions inherited from Pol::Core::UObject
ref_countedas_ref_counted ()
 
void clear_dirty () const
 
void copyprops (const UObject &obj)
 
void copyprops (const PropertyList &proplist)
 
virtual std::string description () const
 
bool dirty () const
 
 DYN_PROPERTY (maxhp_mod, s16, PROP_MAXHP_MOD, 0)
 
 DYN_PROPERTY (fire_resist, ValueModPack, PROP_RESIST_FIRE, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (cold_resist, ValueModPack, PROP_RESIST_COLD, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (energy_resist, ValueModPack, PROP_RESIST_ENERGY, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (poison_resist, ValueModPack, PROP_RESIST_POISON, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (physical_resist, ValueModPack, PROP_RESIST_PHYSICAL, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (fire_damage, ValueModPack, PROP_DAMAGE_FIRE, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (cold_damage, ValueModPack, PROP_DAMAGE_COLD, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (energy_damage, ValueModPack, PROP_DAMAGE_ENERGY, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (poison_damage, ValueModPack, PROP_DAMAGE_POISON, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (physical_damage, ValueModPack, PROP_DAMAGE_PHYSICAL, ValueModPack::DEFAULT)
 
void eraseprop (const std::string &propname)
 
virtual void fixInvalidGraphic ()
 Fixes invalid graphic, moving here to allow it to be overridden in subclass (see Multi) More...
 
bool getprop (const std::string &propname, std::string &propvalue) const
 
void getpropnames (std::vector< std::string > &propnames) const
 
const PropertyListgetprops () const
 
void increv ()
 
virtual std::string name () const
 
virtual UObjectowner ()
 
virtual const UObjectowner () const
 
virtual void printOnDebug (Clib::StreamWriter &sw) const
 
void ref_counted_add_ref ()
 
unsigned ref_counted_count () const
 
void ref_counted_release ()
 
u32 rev () const
 
bool saveonexit () const
 
void saveonexit (bool newvalue)
 
virtual UObjectself_as_owner ()
 
virtual const UObjectself_as_owner () const
 
void set_dirty ()
 
virtual Bscript::BObjectImpset_script_member_double (const char *membername, double value)
 
virtual bool setcolor (u16 newcolor)
 
void setname (const std::string &)
 
void setprop (const std::string &propname, const std::string &propvalue)
 
bool specific_name () const
 
virtual UObjecttoplevel_owner ()
 
virtual const UObjecttoplevel_owner () const
 
- Public Member Functions inherited from Pol::Core::ULWObject
bool isa (UOBJ_CLASS uobj_class) const
 
bool isitem () const
 
bool ismobile () const
 
bool ismulti () const
 
u8 look_height () const
 
bool orphan () const
 
- Public Member Functions inherited from Pol::Core::DynamicPropsHolder
 DynamicPropsHolder ()
 
size_t estimateSizeDynProps () const
 
template<typename V >
bool getmember (DynPropTypes member, V *value) const
 
bool hasmember (DynPropTypes member) const
 
template<typename V >
void setmember (DynPropTypes member, const V &value, const V &defaultvalue)
 
template<typename V >
void setmemberPointer (DynPropTypes member, V value)
 

Public Attributes

unsigned short damaged_sound
 
unsigned short run_speed
 
- Public Attributes inherited from Pol::Mobile::Character
Core::AccountRef acct
 
std::vector< AttributeValueattributes
 
Network::Clientclient
 
u8 cmdlevel_
 
u8 dir
 
time_t disable_regeneration_until
 
Core::UGENDER gender
 
enum Pol::Mobile::Character::GOTTEN_ITEM_TYPE gotten_item_source
 
short gradual_boost
 
u32 last_corpse
 
u16 lastx
 
u16 lasty
 
s8 lastz
 
weak_ptr< Core::Menumenu
 
enum Pol::Mobile::Character::MOVEREASON move_reason
 
Core::MOVEMODE movemode
 
void(* on_menu_selection )(Network::Client *client, Core::MenuItem *mi, Core::PKTIN_7D *msg)
 
void(* on_popup_menu_selection )(Network::Client *client, u32 serial, u16 id)
 
Core::URACE race
 
u32 registered_house
 
std::vector< Core::ItemRefremote_containers_
 
Core::TargetCursortcursor2
 
ref_ptr< Core::UContainertrading_cont
 
Core::CharacterRef trading_with
 
u16 truecolor
 
u32 trueobjtype
 
std::string uclang
 
std::vector< VitalValuevitals
 
u32 warmode_wait
 
- Public Attributes inherited from Pol::Core::UObject
u16 color
 
u8 facing
 
const u32 objtype_
 
u32 serial_ext
 
- Public Attributes inherited from Pol::Core::ULWObject
u16 graphic
 
u8 height
 
Realms::Realmrealm
 
u32 serial
 
u16 x
 
u16 y
 
s8 z
 

Protected Member Functions

virtual const char * classname () const POL_OVERRIDE
 
virtual u16 get_damaged_sound () const POL_OVERRIDE
 
virtual void printDebugProperties (Clib::StreamWriter &sw) const POL_OVERRIDE
 
virtual void printOn (Clib::StreamWriter &sw) const POL_OVERRIDE
 
virtual void printProperties (Clib::StreamWriter &sw) const POL_OVERRIDE
 
virtual void printSelfOn (Clib::StreamWriter &sw) const POL_OVERRIDE
 
void stop_scripts ()
 
- Protected Member Functions inherited from Pol::Mobile::Character
 DYN_PROPERTY (carrying_capacity_mod, s16, Core::PROP_CARRY_CAPACITY_MOD, 0)
 
 DYN_PROPERTY (ar_mod, s16, Core::PROP_AR_MOD, 0)
 
 DYN_PROPERTY (delay_mod, s16, Core::PROP_DELAY_MOD, 0)
 
 DYN_PROPERTY (hitchance_mod, s16, Core::PROP_HITCHANCE_MOD, 0)
 
 DYN_PROPERTY (evasionchance_mod, s16, Core::PROP_EVASIONCHANCE_MOD, 0)
 
 DYN_PROPERTY (squelched_until, Core::gameclock_t, Core::PROP_SQUELCHED_UNTIL, 0)
 
 DYN_PROPERTY (deafened_until, Core::gameclock_t, Core::PROP_DEAFENED_UNTIL, 0)
 
void printWornItems (Clib::StreamWriter &sw_pc, Clib::StreamWriter &sw_equip) const
 
- Protected Member Functions inherited from Pol::Core::UObject
 UObject (u32 objtype, UOBJ_CLASS uobj_class)
 
virtual ~UObject ()
 
- Protected Member Functions inherited from ref_counted
 ref_counted ()
 
 ~ref_counted ()=default
 
unsigned int add_ref ()
 
unsigned int count () const
 
unsigned int release ()
 
- Protected Member Functions inherited from Pol::Core::ULWObject
 ULWObject (UOBJ_CLASS uobj_class)
 
 ULWObject (const ULWObject &)=delete
 
 ~ULWObject ()=default
 
ULWObjectoperator= (const ULWObject &)=delete
 
bool isa (UOBJ_CLASS uobj_class) const
 
bool isitem () const
 
bool ismobile () const
 
bool ismulti () const
 
u8 look_height () const
 
bool orphan () const
 
- Protected Member Functions inherited from Pol::Core::DynamicPropsHolder
 ~DynamicPropsHolder ()=default
 
 DynamicPropsHolder ()
 
size_t estimateSizeDynProps () const
 
template<typename V >
bool getmember (DynPropTypes member, V *value) const
 
bool hasmember (DynPropTypes member) const
 
template<typename V >
void setmember (DynPropTypes member, const V &value, const V &defaultvalue)
 
template<typename V >
void setmemberPointer (DynPropTypes member, V value)
 

Protected Attributes

Core::UOExecutorex
 
boost_utils::npctemplate_name_flystring template_name
 
- Protected Attributes inherited from Pol::Mobile::Character
u16 ar_
 
std::vector< Items::UArmor * > armor_
 
std::map< u16, Buffbuffs_
 
Core::AttributeFlags< PRIV_FLAGScached_settings
 
u8 concealed_
 
Core::gameclock_t created_at
 
Core::AttributeFlags< MOB_FLAGSmob_flags_
 
u32 mountedsteps_
 
Characteropponent_
 
CharacterSet opponent_of
 
Clib::StringSet privs
 
Core::UOExecutorscript_ex
 
Clib::StringSet settings
 
Items::UArmorshield
 
Core::OneShotTaskspell_task
 
u16 stealthsteps_
 
Core::OneShotTaskswing_task
 
Core::polclock_t swing_timer_start_clock_
 
Items::UWeaponweapon
 
ref_ptr< Core::WornItemsContainerwornitems
 
- Protected Attributes inherited from Pol::Core::UObject
AttributeFlags< OBJ_FLAGSflags_
 
boost_utils::object_name_flystring name_
 
- Protected Attributes inherited from ref_counted
std::atomic< unsigned int > _count
 
- Protected Attributes inherited from Pol::Core::ULWObject
const UOBJ_CLASS uobj_class_
 
u16 graphic
 
u8 height
 
Realms::Realmrealm
 
u32 serial
 
u16 x
 
u16 y
 
s8 z
 

Private Types

typedef Character base
 

Private Member Functions

 NPC (const NPC &npc)
 
 DYN_PROPERTY (orig_fire_resist, s16, Core::PROP_ORIG_RESIST_FIRE, 0)
 
 DYN_PROPERTY (orig_cold_resist, s16, Core::PROP_ORIG_RESIST_COLD, 0)
 
 DYN_PROPERTY (orig_energy_resist, s16, Core::PROP_ORIG_RESIST_ENERGY, 0)
 
 DYN_PROPERTY (orig_poison_resist, s16, Core::PROP_ORIG_RESIST_POISON, 0)
 
 DYN_PROPERTY (orig_physical_resist, s16, Core::PROP_ORIG_RESIST_PHYSICAL, 0)
 
 DYN_PROPERTY (orig_fire_damage, s16, Core::PROP_ORIG_DAMAGE_FIRE, 0)
 
 DYN_PROPERTY (orig_cold_damage, s16, Core::PROP_ORIG_DAMAGE_COLD, 0)
 
 DYN_PROPERTY (orig_energy_damage, s16, Core::PROP_ORIG_DAMAGE_ENERGY, 0)
 
 DYN_PROPERTY (orig_poison_damage, s16, Core::PROP_ORIG_DAMAGE_POISON, 0)
 
 DYN_PROPERTY (orig_physical_damage, s16, Core::PROP_ORIG_DAMAGE_PHYSICAL, 0)
 
 DYN_PROPERTY (speech_color, u16, Core::PROP_SPEECH_COLOR, Core::DEFAULT_TEXT_COLOR)
 
 DYN_PROPERTY (speech_font, u16, Core::PROP_SPEECH_FONT, Core::DEFAULT_TEXT_FONT)
 
void loadEquipablePropertiesNPC (Clib::ConfigElem &elem)
 
NPCoperator= (const NPC &npc)
 
void readNewNpcAttributes (Clib::ConfigElem &elem)
 
void readNpcProperties (Clib::ConfigElem &elem)
 
void resetEquipablePropertiesNPC ()
 

Private Attributes

Anchor anchor
 
Core::CharacterRef master_
 
unsigned short npc_ar_
 
boost_utils::script_name_flystring script
 
const Core::NpcTemplatetemplate_
 

Friends

class Core::RepSystem
 
class Module::NPCExecutorModule
 
class ref_ptr< NPC >
 

Additional Inherited Members

- Public Types inherited from Pol::Mobile::Character
enum  GOTTEN_ITEM_TYPE : u8 { GOTTEN_ITEM_ON_GROUND, GOTTEN_ITEM_EQUIPPED_ON_SELF, GOTTEN_ITEM_IN_CONTAINER }
 
enum  MOVEREASON : u8 { WALKED = 0, OTHER = 0, MULTIMOVE = 1 }
 
- Static Public Member Functions inherited from Pol::Mobile::Character
static Core::MOVEMODE decode_movemode (const std::string &str)
 
static std::string encode_movemode (Core::MOVEMODE movemode)
 
- Static Public Attributes inherited from Pol::Core::UObject
static std::atomic< unsigned int > clean_writes
 
static std::atomic< unsigned int > dirty_writes
 

Detailed Description

Definition at line 85 of file npc.h.

Member Typedef Documentation

Definition at line 87 of file npc.h.

Constructor & Destructor Documentation

Pol::Mobile::NPC::~NPC ( )
virtual
Pol::Mobile::NPC::NPC ( const NPC npc)
private

Member Function Documentation

void Pol::Mobile::NPC::apply_raw_damage_hundredths ( unsigned int  damage,
Character source,
bool  userepsys = true,
bool  send_damage_packet = false 
)
virtual
unsigned short Pol::Mobile::NPC::ar ( ) const
inlinevirtual

Reimplemented from Pol::Mobile::Character.

Definition at line 275 of file npc.h.

double Pol::Mobile::NPC::armor_absorb_damage ( double  damage)
virtual
bool Pol::Mobile::NPC::can_be_renamed_by ( const Character chr) const
virtual

Reimplemented from Pol::Mobile::Character.

Definition at line 626 of file npc.cpp.

References master_.

const char * Pol::Mobile::NPC::classname ( ) const
protectedvirtual

Reimplemented from Pol::Mobile::Character.

Definition at line 139 of file npc.cpp.

Referenced by printOn().

BObjectImp * Pol::Mobile::NPC::custom_script_method ( const char *  methodname,
Bscript::Executor ex 
)
virtual

Reimplemented from Pol::Mobile::Character.

Definition at line 3261 of file uoscrobj.cpp.

References Pol::Bscript::Executor::fparams, and Pol::Bscript::Executor::numParams().

Pol::Mobile::NPC::DYN_PROPERTY ( orig_fire_resist  ,
s16  ,
Core::PROP_ORIG_RESIST_FIRE  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( orig_cold_resist  ,
s16  ,
Core::PROP_ORIG_RESIST_COLD  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( orig_energy_resist  ,
s16  ,
Core::PROP_ORIG_RESIST_ENERGY  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( orig_poison_resist  ,
s16  ,
Core::PROP_ORIG_RESIST_POISON  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( orig_physical_resist  ,
s16  ,
Core::PROP_ORIG_RESIST_PHYSICAL  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( orig_fire_damage  ,
s16  ,
Core::PROP_ORIG_DAMAGE_FIRE  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( orig_cold_damage  ,
s16  ,
Core::PROP_ORIG_DAMAGE_COLD  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( orig_energy_damage  ,
s16  ,
Core::PROP_ORIG_DAMAGE_ENERGY  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( orig_poison_damage  ,
s16  ,
Core::PROP_ORIG_DAMAGE_POISON  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( orig_physical_damage  ,
s16  ,
Core::PROP_ORIG_DAMAGE_PHYSICAL  ,
 
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( speech_color  ,
u16  ,
Core::PROP_SPEECH_COLOR  ,
Core::DEFAULT_TEXT_COLOR   
)
private
Pol::Mobile::NPC::DYN_PROPERTY ( speech_font  ,
u16  ,
Core::PROP_SPEECH_FONT  ,
Core::DEFAULT_TEXT_FONT   
)
private
size_t Pol::Mobile::NPC::estimatedSize ( ) const
virtual

Reimplemented from Pol::Mobile::Character.

Definition at line 1029 of file npc.cpp.

References anchor, and Pol::Mobile::Character::estimatedSize().

u16 Pol::Mobile::NPC::get_damaged_sound ( ) const
protectedvirtual

Reimplemented from Pol::Mobile::Character.

Definition at line 1041 of file npc.cpp.

References damaged_sound, and Pol::Mobile::Character::get_damaged_sound().

void Pol::Mobile::NPC::get_hitscript_params ( double  damage,
Items::UArmor **  parmor,
unsigned short *  rawdamage 
)
virtual
BObjectImp * Pol::Mobile::NPC::get_script_member ( const char *  membername) const
virtual

Reimplemented from Pol::Mobile::Character.

Definition at line 3152 of file uoscrobj.cpp.

References Pol::Bscript::getKnownObjMember(), and Pol::Bscript::ObjMember::id.

unsigned char Pol::Mobile::NPC::hilite_color_idx ( const Character seen_by) const
virtual

[16] NPC Highlighting If the NPC has a master, Highlight color is the same as the Master's. Else the NPC is invul Hilite them invul is ssopt.cfg option says to. Else Highlight Good NPCs INNOCENT (Blue) Highlight Neutral NPCs ATTACKABLE (Grey) Highlight Evil NPCs MURDERER (Red)

Reimplemented from Pol::Mobile::Character.

Definition at line 1001 of file repsys.cpp.

References Pol::Core::ExportedFunction::call_long(), CHAR_HILITE_ATTACKABLE, CHAR_HILITE_INNOCENT, CHAR_HILITE_INVUL, CHAR_HILITE_MURDERER, Pol::Core::NpcTemplate::EVIL, Pol::Core::NpcTemplate::GOOD, Pol::Core::RepSys_Cfg::HighLightColor, Pol::Core::RepSystem::hilite_color_idx(), Pol::Core::RepSys_Cfg::Hooks, Pol::Mobile::Character::make_ref(), Pol::Core::NpcTemplate::NEUTRAL, Pol::Core::SettingsManager::repsys_cfg, and Pol::Core::settingsManager.

void Pol::Mobile::NPC::inform_disengaged ( Character disengaged)
virtual
void Pol::Mobile::NPC::inform_engaged ( Character engaged)
virtual
Items::UWeapon * Pol::Mobile::NPC::intrinsic_weapon ( )
virtual
void Pol::Mobile::NPC::loadEquipablePropertiesNPC ( Clib::ConfigElem elem)
private
NPC& Pol::Mobile::NPC::operator= ( const NPC npc)
private
void Pol::Mobile::NPC::printDebugProperties ( Clib::StreamWriter sw) const
protectedvirtual
void Pol::Mobile::NPC::printOn ( Clib::StreamWriter sw) const
protectedvirtual

Reimplemented from Pol::Mobile::Character.

Definition at line 255 of file npc.cpp.

References classname(), pf_endl, printProperties(), and template_name.

Referenced by printSelfOn().

void Pol::Mobile::NPC::printProperties ( Clib::StreamWriter sw) const
protectedvirtual
void Pol::Mobile::NPC::printSelfOn ( Clib::StreamWriter sw) const
protectedvirtual

Reimplemented from Pol::Mobile::Character.

Definition at line 265 of file npc.cpp.

References printOn().

void Pol::Mobile::NPC::readProperties ( Clib::ConfigElem elem)
virtual
void Pol::Mobile::NPC::repsys_on_attack ( Character defender)
virtual

[13.2] NPC (MA) Attacks Mobile (MB) If MA has a Master (Amy), Apply 'Player Attacks Mobile' rules[->13.1] for Amy vs MB Else Exit with no (RepSystem) effect.

Reimplemented from Pol::Mobile::Character.

Definition at line 844 of file repsys.cpp.

References Pol::Mobile::Character::make_ref(), and Pol::Core::settingsManager.

void Pol::Mobile::NPC::repsys_on_damage ( Character defender)
virtual

[14.2] NPC (MA) Damages Mobile (MB) If MA has a Master (Amy), Apply 'Player Damages Mobile' rules[->14.1] for Amy vs MB Else Exit with no (RepSystem) effect.

Reimplemented from Pol::Mobile::Character.

Definition at line 906 of file repsys.cpp.

References Pol::Mobile::Character::make_ref(), and Pol::Core::settingsManager.

void Pol::Mobile::NPC::repsys_on_help ( Character recipient)
virtual

[15.2] NPC (MA) Helps Mobile (MB) If MA has a Master (Amy), Apply 'Player Helps Mobile' rules[->15.1] for Amy helps MB Else Exit with no (RepSystem) effect.

Reimplemented from Pol::Mobile::Character.

Definition at line 967 of file repsys.cpp.

References Pol::Mobile::Character::make_ref(), and Pol::Core::settingsManager.

void Pol::Mobile::NPC::resetEquipablePropertiesNPC ( )
private

Definition at line 1004 of file npc.cpp.

Referenced by refresh_ar().

bool Pol::Mobile::NPC::script_isa ( unsigned  isatype) const
virtual

Reimplemented from Pol::Mobile::Character.

Definition at line 4632 of file uoscrobj.cpp.

References Pol::Core::Multi, and Pol::Core::POLCLASS_NPC.

BObjectImp * Pol::Mobile::NPC::script_method ( const char *  methodname,
Bscript::Executor ex 
)
virtual

Reimplemented from Pol::Mobile::Character.

Definition at line 3252 of file uoscrobj.cpp.

References Pol::Bscript::getKnownObjMethod(), and Pol::Bscript::ObjMethod::id.

BObjectImp * Pol::Mobile::NPC::script_method_id ( const int  id,
Bscript::Executor ex 
)
virtual
Bscript::BObjectImp * Pol::Mobile::NPC::send_event_script ( Bscript::BObjectImp event)
BObjectImp * Pol::Mobile::NPC::set_script_member ( const char *  membername,
int  value 
)
virtual

id test

Reimplemented from Pol::Mobile::Character.

Definition at line 3212 of file uoscrobj.cpp.

References Pol::Bscript::getKnownObjMember(), and Pol::Bscript::ObjMember::id.

BObjectImp * Pol::Mobile::NPC::set_script_member ( const char *  membername,
const std::string &  value 
)
virtual

id test

Reimplemented from Pol::Mobile::Character.

Definition at line 3175 of file uoscrobj.cpp.

References Pol::Bscript::getKnownObjMember(), and Pol::Bscript::ObjMember::id.

BObjectImp * Pol::Mobile::NPC::set_script_member_id ( const int  id,
int  value 
)
virtual
BObjectImp * Pol::Mobile::NPC::set_script_member_id ( const int  id,
const std::string &  value 
)
virtual

Reimplemented from Pol::Mobile::Character.

Definition at line 3161 of file uoscrobj.cpp.

References Pol::Bscript::MBR_SCRIPT.

std::string Pol::Mobile::NPC::templatename ( ) const

Definition at line 1068 of file npc.cpp.

References template_name.

Friends And Related Function Documentation

friend class Core::RepSystem
friend

Definition at line 227 of file npc.h.

friend class Module::NPCExecutorModule
friend

Definition at line 228 of file npc.h.

friend class ref_ptr< NPC >
friend

Definition at line 229 of file npc.h.

Member Data Documentation

Anchor Pol::Mobile::NPC::anchor
private
unsigned short Pol::Mobile::NPC::damaged_sound

Definition at line 255 of file npc.h.

Referenced by get_damaged_sound(), and readNpcProperties().

Core::CharacterRef Pol::Mobile::NPC::master_
private

Definition at line 261 of file npc.h.

Referenced by can_be_renamed_by(), printProperties(), and readNpcProperties().

unsigned short Pol::Mobile::NPC::npc_ar_
private
unsigned short Pol::Mobile::NPC::run_speed
boost_utils::script_name_flystring Pol::Mobile::NPC::script
private

Definition at line 247 of file npc.h.

Referenced by printProperties(), readNpcProperties(), restart_script(), and start_script().

const Core::NpcTemplate& Pol::Mobile::NPC::template_
private

Definition at line 262 of file npc.h.

Referenced by intrinsic_weapon(), readNpcProperties(), and start_script().

boost_utils::npctemplate_name_flystring Pol::Mobile::NPC::template_name
protected

Definition at line 258 of file npc.h.

Referenced by on_death(), printOn(), readNpcProperties(), readProperties(), and templatename().


The documentation for this class was generated from the following files: