Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 03-08-2016, 03:13 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default Switch skill - C++

Any idea why this would not work?

Code:
CastToNPC()->SetPrimSkill(SkillHandtoHand);
I know this code is firing but the NPC still is using a 1hs, but does not have it.

EDIT: So I went back and did a log.out on what skill the NPC was using after I switched it to h2h and it is showing skill 28 which is hand to hand correct? Then the NPC should not be slashing. Missing something here.
Reply With Quote
  #2  
Old 03-08-2016, 05:27 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 506
Default

At a glance, SetPrimSkill just sets the prim_melee_type to the passed type inside npc.h.
In one of my code sets that sets prim_melee_type, I do it prior to the npc being instantiated/spawned, it's possible there's an appearance struct packet that needs to be sent.

I didn't look too deep, but just wanted to share my recent experience in this area. Hope it helps.
__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #3  
Old 03-08-2016, 05:36 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Might have something to do with what 'weapons' the NPC thinks it has equipped too..never messed with this, though.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #4  
Old 03-08-2016, 05:37 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Yeah I found out the same thing. I know where my issue is now. When I thought the item was gone, it is not, just the appearance.
Reply With Quote
  #5  
Old 03-09-2016, 09:07 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Well it is almost like the title of the topic needs to change now. This has nothing to do with the NPC's attack type, which is 28 and never changed. So I hand an NPC a weapon and then iterate every single item in it's inventory, remove everything from the mob. I verify the mob has no items by iterating through the inventory again. It is still slashing and procing with the item. Even #npcstats shows no items on the mob. I could of course do a change appearance on the mob for the visual effect but that does not solve the issue of the mob procing the item or continuing to slash.
Reply With Quote
  #6  
Old 03-09-2016, 05:16 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I think you're problem probably lies in two places:

skill_type: https://github.com/EQEmu/Server/blob...pawn2.cpp#L218

weapons/procs: https://github.com/EQEmu/Server/blob...ables.cpp#L332 - and the surrounding code


NPCs are complex beasts..and most of the code is very old.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #7  
Old 03-09-2016, 05:39 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Quote:
Originally Posted by Uleat View Post
I think you're problem probably lies in two places:

skill_type: https://github.com/EQEmu/Server/blob...pawn2.cpp#L218

weapons/procs: https://github.com/EQEmu/Server/blob...ables.cpp#L332 - and the surrounding code


NPCs are complex beasts..and most of the code is very old.

Yep already been up and down those sections. I even remarked out where the procs are added under loottables and the mob still gets procs when handed the items. They are getting the procs from elsewhere, damned if I can find it. This is a bear to figure out so far. If I could find out out how the procs are added I may have a little better chance figuring it out. I have also messed with player states, setting them back to 0.
Reply With Quote
  #8  
Old 03-09-2016, 06:05 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Handing an NPC an item and loading a spawn2 are different..lemme look for that.

(Might also want to check out the quest api..spawns loaded from quest scripts have different handlers as well.)


Try this one for npc trading: https://github.com/EQEmu/Server/blob...ading.cpp#L909

Still calls the 'AddLootDrop' function..but, this is another way in.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #9  
Old 03-10-2016, 12:23 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Okay I have what I wanted done accomplished. A few things I did not know that I know now. When an NPC's items are added to the loottable at spawn and it can equip them, the procs for the weapons appear to be permanent npc procs, at least they do for me. Second thing I noticed is that you can remove the items all day long and they still slash, you have to change the equipment MainPrimary to force it.... equipment[MainPrimary]=0;

That was my experience.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:23 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3