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

Development: Custom Code This is for code thatdoes not emulate live and wont be added to the official code.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2008, 03:51 AM
zeiksz2
Fire Beetle
 
Join Date: Oct 2007
Posts: 20
Default backstabb with piercer only

Mob::TryBackstab has restriction for player (mr. IsClient()) to backstabb only with piercing weapon.. this i want to apply for mob (npc/pet) too, but got some problem with code (not a pretty one tho')

Code:
	//make sure we have a proper weapon if we are a client.
	//if(IsClient()) {
		
		if (IsClient()) {
			const ItemInst* weapon = NULL;
			weapon = CastToClient()->GetInv().GetItem(SLOT_PRIMARY);
			if(!weapon || (weapon->GetItem()->ItemType != ItemTypePierce)) {  
				Message_StringID(13, BACKSTAB_WEAPON);
				return;
			}
		} else if (IsNPC()) { 
			const Item_Struct* weapon = NULL;
			int32 eid = CastToNPC()->GetEquipment(SLOT_PRIMARY);
			if (eid != 0) weapon = database.GetItem(eid);
			if (!weapon || (weapon->ItemType!=ItemTypePierce && weapon->ItemType!=ItemType2HPierce))
			{
				return;
			}
		}
	//}
so NPC part i was just copy/pasting together and seems not to work.. the cast2npc-getequipbyslot gives always zero value, so the stuff will make exit on every mob backstabb attempt

any idea?
Reply With Quote
  #2  
Old 01-21-2008, 11:34 AM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

a question for you
if no NPC can hit hard wihout a weapon - what gona happen to all the npc who do not normaly carry weapons? Like animals, insects, various non humanoid monsters?
Reply With Quote
Reply

Thread Tools
Display Modes

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 03:50 PM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3