L2NPC possible bug (Too large desire size)
Issue #20
new
Hello Emca,
First, I want to thank you for this wonderful open source project that you did!
I'm receiving these messages in the L2NPC logs using the Gracia Epilogue sources from AdvExt. I can’t find anything wrong in the AI and npcdata.txt
Log:
09/10/2020 05:17:33.083, Too large desire size[50] in npc[bdzlem_suppressor], recent desire[3]
09/10/2020 05:17:33.200, --- call stack ---
09/10/2020 05:17:33.200, [0] void IOThread_common(void *arglist)
09/10/2020 05:17:33.200, [1] void __cdecl CIOCPMessage::OnIOCallback(int,unsigned long,struct _OVERLAPPED *)
09/10/2020 05:17:33.200, [2] void __cdecl CScriptEventHelperClass::OnReceive(int)
09/10/2020 05:17:33.200, [3] int __cdecl CNPC::HandleEvent(class CNPCEvent *)
09/10/2020 05:17:33.200, [4] int __cdecl CReloadableNPCEventHandler::InterlockedHandleEvent(class ScriptEvent *,class CAIParameter *)
09/10/2020 05:17:33.200, [5] virtual int HandleEvent(ScriptEvent* pEvent, CAIParameter* pParameter)
09/10/2020 05:17:33.200, [6] virtual int HandleEvent(ScriptEvent* pEvent, CAIParameter* pParameter, CAIProperty* pProp)
09/10/2020 05:17:33.200, [7] int __cdecl CScriptEngine::RunNPCScript(class ScriptEvent *,class CNPCEventHandler *,class CScriptBinCode *,class CAIParameter *,class CAIProperty *)
09/10/2020 05:17:33.200, [8] void __cdecl CNPC::AddAttackDesire(class CSharedCreatureData *,int,float)
09/10/2020 05:17:33.200, [9] void __cdecl CNPC::AddAttackDesireEx(int,int,int,float)
09/10/2020 05:17:33.200, [10] int __cdecl CDesirePQ::AddValue(class CDesire,int &)
09/10/2020 05:17:33.210, --- script call context ---
09/10/2020 05:17:33.210, [0] warrior_basic_reed [SCRIPT_EVENT][437][3][AddAttackDesire]
09/10/2020 05:17:34.200, Can't connect to log server
09/10/2020 05:19:41.456, Too large desire size[50] in npc[bdzlem_exterminator], recent desire[3]
09/10/2020 05:19:41.456, --- call stack ---
09/10/2020 05:19:41.456, [0] void IOThread_common(void *arglist)
09/10/2020 05:19:41.456, [1] void __cdecl CIOCPMessage::OnIOCallback(int,unsigned long,struct _OVERLAPPED *)
09/10/2020 05:19:41.456, [2] void __cdecl CScriptEventHelperClass::OnReceive(int)
09/10/2020 05:19:41.456, [3] int __cdecl CNPC::HandleEvent(class CNPCEvent *)
09/10/2020 05:19:41.456, [4] int __cdecl CReloadableNPCEventHandler::InterlockedHandleEvent(class ScriptEvent *,class CAIParameter *)
09/10/2020 05:19:41.456, [5] virtual int HandleEvent(ScriptEvent* pEvent, CAIParameter* pParameter)
09/10/2020 05:19:41.456, [6] virtual int HandleEvent(ScriptEvent* pEvent, CAIParameter* pParameter, CAIProperty* pProp)
09/10/2020 05:19:41.456, [7] int __cdecl CScriptEngine::RunNPCScript(class ScriptEvent *,class CNPCEventHandler *,class CScriptBinCode *,class CAIParameter *,class CAIProperty *)
09/10/2020 05:19:41.456, [8] void __cdecl CNPC::AddAttackDesire(class CSharedCreatureData *,int,float)
09/10/2020 05:19:41.456, [9] void __cdecl CNPC::AddAttackDesireEx(int,int,int,float)
09/10/2020 05:19:41.456, [10] int __cdecl CDesirePQ::AddValue(class CDesire,int &)
09/10/2020 05:19:41.456, --- script call context ---
09/10/2020 05:19:41.456, [0] warrior_basic_reed [SCRIPT_EVENT][437][3][AddAttackDesire]
09/10/2020 05:23:47.788, [.\NPC.cpp][7572] Invalid Despawn() (npc[floating_zombie_3lv]) called count[2]
09/10/2020 05:27:52.236, [MakerEx] [dion18_2021_18m3] failed to AtomicIncreaseTotal[current(6) -> expected(7) : maximum_npc(6)]
09/10/2020 05:27:53.236, Can't connect to log server
NPC:
npc_begin warrior 22656 [bdzlem_suppressor] category={} level=83 exp=11844000000 ex_crt_effect=0 unique=0 s_npc_prop_hp_rate=2 race=construct sex=male skill_list={@s_npc_prop_race_construct;@s_npc_prop_hp_lv_m2;@s_npc_prop_mp_lv_p0;@s_npc_prop_pa_lv_p0;@s_npc_prop_ma_lv_p0;@s_npc_prop_pd_lv_p0;@s_npc_prop_md_lv_p0;@s_npc_prop_armor_type_n;@s_npc_prop_weapon_type_sword;@s_npc_resist_bow5;@s_npc_critical_power;@s_npc_critical_chance} slot_chest=[] slot_rhand=[] slot_lhand=[] collision_radius={23.5;23.5} collision_height={41.5;41.5} hit_time_factor=0.43 hit_time_factor_skill=-1 ground_high={185;0;0} ground_low={60;0;0} str=40 int=21 dex=30 wit=20 con=43 men=20 org_hp=3835.59060587002 org_hp_regen=8.5 org_mp=1777.4 org_mp_regen=3 base_attack_type=sword base_attack_range=40 base_damage_range={0;0;80;120} base_rand_dam=30 base_physical_attack=1099.42361669366 base_critical=4 physical_hit_modify=5 base_attack_speed=253 base_reuse_delay=0 base_magic_attack=750.763809564873 base_defend=353.86144 base_magic_defend=258.94045 base_attribute_attack={none;0} base_attribute_defend={150;150;150;150;150;150;100} physical_avoid_modify=0 shield_defense_rate=0 shield_defense=0 safe_height=100 soulshot_count=0 spiritshot_count=0 clan={} ignore_clan_list={} clan_help_range=300 undying=0 can_be_attacked=1 corpse_time=7 no_sleep_mode=0 agro_range=300 passable_door=0 can_move=1 flying=0 has_summoner=0 targetable=1 show_name_tag=1 npc_ai={[bdzlem_suppressor];{[Skill01_ID]=@s_npc_short_shock9};{[Skill02_ID]=@s_display_attack_tumor_close1}} event_flag={0} unsowing=0 acquire_exp_rate=3.128467125 acquire_sp=2219 acquire_rp=0 corpse_make_list={{[rp_shining_arrow];1;1;0.603};{[sealed_dynasty_sigil_piece];1;1;1.4951};{[scrl_of_ench_am_s];1;1;0.2412}} additional_make_list={} additional_make_multi_list={{{{[adena];1476;2979;100}};70};{{{[sealed_dynasty_blast_plate];1;1;0.0946};{[sealed_dynasty_gaiter];1;1;0.1513};{[sealed_dynasty_blast_plate_piece];1;1;25.2036};{[sealed_dynasty_gaiter_piece];1;1;74.5505}};0.429};{{{[cokes];1;1;58.6218};{[high_grade_suede];1;1;29.3109};{[renad];1;1;2.7587};{[oricalcum];1;1;1.8512};{[adamantium];1;1;1.5293};{[general_80_s];1;1;2.4426};{[special_80_s];1;1;0.6106};{[rare_80_s];1;1;0.0611};{[ore_of_earth];1;1;2.8138}};9.3838}} ex_item_drop_list={{{{[herb_of_hp_a];1;1;55};{[greater_herb_of_hp_a];1;1;38};{[full_herb_of_hp_a];1;1;7}};42};{{{[herb_of_mp_a];1;1;7};{[greater_herb_of_mp_a];1;1;81};{[full_herb_of_mp_a];1;1;12}};11};{{{[herb_of_pa];1;1;20};{[herb_of_pa_speed];1;1;20};{[herb_of_crt_rate];1;1;20};{[vampiric_rage_herb];1;1;20};{[death_whisper_herb];1;1;20}};25};{{{[herb_of_ma];1;1;50};{[herb_of_ma_speed];1;1;50}};10};{{{[figher_herb];1;1;33};{[magician_herb];1;1;33};{[recovery_herb];1;1;34}};1};{{{[herb_of_move_speed];1;1;94};{[big_head_herb];1;1;3};{[vitality_herb1];1;1;3}};11}} npc_end
npc_begin warrior 22657 [bdzlem_exterminator] category={} level=84 exp=15472800000 ex_crt_effect=0 unique=0 s_npc_prop_hp_rate=2 race=construct sex=male skill_list={@s_npc_prop_race_construct;@s_npc_prop_hp_lv_m2;@s_npc_prop_mp_lv_p0;@s_npc_prop_pa_lv_p0;@s_npc_prop_ma_lv_p0;@s_npc_prop_pd_lv_p0;@s_npc_prop_md_lv_p0;@s_npc_prop_armor_type_n;@s_npc_prop_weapon_type_sword;@s_npc_resist_bow5;@s_npc_critical_power;@s_npc_critical_chance} slot_chest=[] slot_rhand=[] slot_lhand=[] collision_radius={23;23} collision_height={41;41} hit_time_factor=0.43 hit_time_factor_skill=-1 ground_high={185;0;0} ground_low={60;0;0} str=40 int=21 dex=30 wit=20 con=43 men=20 org_hp=4039.04270539801 org_hp_regen=8.5 org_mp=1812 org_mp_regen=3 base_attack_type=sword base_attack_range=40 base_damage_range={0;0;80;120} base_rand_dam=30 base_physical_attack=1144.73130112535 base_critical=4 physical_hit_modify=5 base_attack_speed=253 base_reuse_delay=0 base_magic_attack=781.703083407155 base_defend=357.86723 base_magic_defend=261.87171 base_attribute_attack={none;0} base_attribute_defend={150;150;150;150;150;150;100} physical_avoid_modify=0 shield_defense_rate=0 shield_defense=0 safe_height=100 soulshot_count=0 spiritshot_count=0 clan={} ignore_clan_list={} clan_help_range=300 undying=0 can_be_attacked=1 corpse_time=7 no_sleep_mode=0 agro_range=300 passable_door=0 can_move=1 flying=0 has_summoner=0 targetable=1 show_name_tag=1 npc_ai={[bdzlem_exterminator];{[Skill01_ID]=@s_npc_short_shock9};{[Skill02_ID]=@s_display_attack_tumor_close1}} event_flag={0} unsowing=0 acquire_exp_rate=3.204306 acquire_sp=2300 acquire_rp=0 corpse_make_list={{[sealed_dynasty_helmet_piece];1;1;2.2224};{[icarus_spirits_piece];1;1;0.265};{[icarus_trident_piece];1;1;0.2641}} additional_make_list={} additional_make_multi_list={{{{[adena];1500;3065;100}};70};{{{[sealed_dynasty_leather_mail];1;1;0.1642};{[sealed_dynasty_leather_legging];1;1;0.2627};{[sealed_dynasty_leather_mail_piece];1;1;40.3139};{[sealed_dynasty_leather_legging_piece];1;1;59.2592}};0.3378};{{{[cokes];1;1;58.6218};{[high_grade_suede];1;1;29.3109};{[renad];1;1;2.7587};{[oricalcum];1;1;1.8512};{[adamantium];1;1;1.5293};{[general_80_s];1;1;2.4426};{[special_80_s];1;1;0.6106};{[rare_80_s];1;1;0.0611};{[ore_of_wind];1;1;2.8138}};9.6178}} ex_item_drop_list={{{{[herb_of_hp_a];1;1;55};{[greater_herb_of_hp_a];1;1;38};{[full_herb_of_hp_a];1;1;7}};42};{{{[herb_of_mp_a];1;1;7};{[greater_herb_of_mp_a];1;1;81};{[full_herb_of_mp_a];1;1;12}};11};{{{[herb_of_pa];1;1;20};{[herb_of_pa_speed];1;1;20};{[herb_of_crt_rate];1;1;20};{[vampiric_rage_herb];1;1;20};{[death_whisper_herb];1;1;20}};25};{{{[herb_of_ma];1;1;50};{[herb_of_ma_speed];1;1;50}};10};{{{[figher_herb];1;1;33};{[magician_herb];1;1;33};{[recovery_herb];1;1;34}};1};{{{[herb_of_move_speed];1;1;94};{[big_head_herb];1;1;3};{[vitality_herb1];1;1;3}};11}} npc_end
AI “warrior_basic_reed
“:
EventHandler SCRIPT_EVENT(script_event_arg1, script_event_arg2, c0) {
if ((script_event_arg1 == 78010077 || script_event_arg1 == 78010079) && (myself.sm.class_id == @bdzlem_suppressor || myself.sm.class_id == @bdzlem_exterminator || myself.sm.class_id == @disturbed_waterspirit || myself.sm.class_id == @angry_waterspirit) || script_event_arg1 == 78010078 && (myself.sm.class_id == @murcrokian_fanatic || myself.sm.class_id == @murcrokian_ascetic || myself.sm.class_id == @murcrokian_savior || myself.sm.class_id == @murcrokian_foreseer || myself.sm.class_id == @murcrokian_corrupted || myself.sm.class_id == @murcrokian_awakened) || script_event_arg1 == 78010082 && myself.sm.class_id == @murcrokian_awakened) {
if (babble_mode == 1) {
Say(" - ");
}
c0 = GetCreatureFromID(script_event_arg2);
if (IsNullCreature(c0) == 0 && c0.alive) {
if (Rand(3) == 0) {
if (myself.sm.class_id == @bdzlem_suppressor) {
Say(MakeFString(1800852, "", "", "", "", ""));
} else if (myself.sm.class_id == @bdzlem_exterminator) {
Say(MakeFString(1800853, "", "", "", "", ""));
} else if (myself.sm.class_id == @disturbed_waterspirit) {
Say(MakeFString(1800855, "", "", "", "", ""));
} else if (myself.sm.class_id == @angry_waterspirit) {
Say(MakeFString(1800856, "", "", "", "", ""));
} else {
Say(MakeFString(1800858, "", "", "", "", ""));
}
AddAttackDesire(c0, @AMT_MOVE_TO_TARGET, DefaultHate);
}
}
}
super;
}