Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2010, 04:49 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Looks like pet classes are going to love you for this

My questions are:
1. In bonuses.cpp, what happens if the pet has multiple haste items? Do the hastes all stack or does it just use the highest value like haste should?

2. I don't know anything about pet focuses, but I assume they could work on charmed pets as well. If so, will your code that adds their loot to them but doesn't care about charges be able to cause any exploits? You can't get items with charges back from normal pet corpses, but you can from charmed ones.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 02-25-2010, 10:02 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

Quote:
Originally Posted by trevius View Post
Looks like pet classes are going to love you for this

My questions are:
1. In bonuses.cpp, what happens if the pet has multiple haste items? Do the hastes all stack or does it just use the highest value like haste should?

2. I don't know anything about pet focuses, but I assume they could work on charmed pets as well. If so, will your code that adds their loot to them but doesn't care about charges be able to cause any exploits? You can't get items with charges back from normal pet corpses, but you can from charmed ones.
You're right about the haste. You can tell I was a caster!
This fixes that, so it's just like the client bonuses. Only picks the highest one. I also changed the loop so that it checks all slots but ammo, as I guess you don't get stats from ammo slot as mentioned in the client CalcItemBonuses?

Code:
--- bonuses.cpp	(revision 991)
+++ bonuses.cpp	(working copy)
@@ -1126,8 +1126,8 @@
 {
 	if(newbon){
 
-		for(int i = 0; i < 8; i++){
-			const Item_Struct *cur = database.GetItem(equipment[i]);
+		for(int i = 0; i < MAX_INVENTORY_SLOTS-1; i++){
+			const Item_Struct *cur = database.GetItem(equipped_items[i]);
 			if(cur){
 				//basic stats
 				newbon->AC += cur->AC;
@@ -1146,7 +1146,6 @@
 				newbon->CR += cur->CR;
 				newbon->PR += cur->PR;
 				newbon->DR += cur->DR;
-				
 
 				//more complex stats
 				if(cur->Regen > 0) {
@@ -1182,12 +1181,14 @@
 				if(cur->CombatEffects > 0) {
 					newbon->ProcChance += cur->CombatEffects;
 				}
+				if(newbon->haste < (sint8)cur->Haste) {
+					newbon->haste = cur->Haste;
+				}
 				if (cur->Worn.Effect>0 && (cur->Worn.Type == ET_WornEffect)) { // latent 

effects
 					ApplySpellsBonuses(cur->Worn.Effect, cur->Worn.Level, newbon);
 				}
 			}
 		}
-	
 	}
 }
And I'm not sure about your question #2. Do you mean the equipment that automatically is summoned with the pet or just giving equipment to the charmed pet? Unless I'm mistaken, charmed pets will not get any of the pre-summoned equipment, and I don't believe they benefit from any focus effect. Only a summoned pet would gain from it. The focus affects the pet within MakePet, which I don't believe is used when an npc is charmed.

The only code I changed with regards to charmed pets would be that they now have an expanded inventory. The mechanism for giving the pet equipment remains the same, so I assume whatever precautions were taken into account before would still be in effect. I also believe no nodrop items can be given, but on that I'm not certain. Again, it should be just as it was before.

In AddLootDrop, a serverLootItem_Struct named item is created, assigned an id, and # of charges set.
Code:
item->item_id = item2->ID;
	item->charges = charges;
	item->aug1 = 0;
	item->aug2 = 0;
	item->aug3 = 0;
	item->aug4 = 0;
	item->aug5 = 0;
Then that item is pushed into the item list, which should contain the same number of charges.
Code:
if(itemlist != NULL)
		itemlist->push_back(item);
	else
		safe_delete(item);
I don't believe there was a restriction on the number of items a loottable can contain in its itemlist, but only a certain few would have been visible. When an npc is looted, it pulls from the itemlist. With the changes I've made, the only difference should be that besides the visible list of items (which doesn't affect the items available for loot), there is also a list of items that are just there to calculate bonuses and such from. Again, I don't believe this list would in any way affect what items can or can't be looted.

I may be incorrect, but I don't think that would be an issue.
Reply With Quote
  #3  
Old 02-25-2010, 03:30 PM
steve
Discordant
 
Join Date: Jan 2002
Posts: 305
Default

Quote:
Originally Posted by bad_captain View Post
And I'm not sure about your question #2. Do you mean the equipment that automatically is summoned with the pet or just giving equipment to the charmed pet? Unless I'm mistaken, charmed pets will not get any of the pre-summoned equipment, and I don't believe they benefit from any focus effect. Only a summoned pet would gain from it. The focus affects the pet within MakePet, which I don't believe is used when an npc is charmed.
This is correct. Charmed pets are not focused and do not get any equipment when they are charmed. As far as which pets get equipment when summoned, it used to be just mage pets -- I distinctly remember beastlords and necros asking for summoned weapons and armor. I'm not sure if it's changed since SoD was released.

Quote:
Originally Posted by bad_captain View Post
I also believe no nodrop items can be given, but on that I'm not certain.
You can give a pet a NO-DROP item, but they won't use or equip it. This is easily tested on Live by attempting to give a summoned pet a NO-DROP weapon.
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 06:00 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3