EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Global Lootdrop Boost (https://www.eqemulator.org/forums/showthread.php?t=23497)

cbodmer 08-16-2007 07:27 PM

Global Lootdrop Boost
 
I've come up with a new Rule to allow a server administrator to boost droprates across the board without having to modify the underlying database. This can be used for server special events and occasions, etc. The default setting does not change anything so this is save to apply, even if you don't intend to make use of it.

ruletypes.h
Code:

--- EQEmu-0.7.0-1030/common/ruletypes.h        2007-04-03 05:08:39.000000000 +0200
+++ EQEmu-0.7.0-1030-cb/common/ruletypes.h        2007-08-16 09:32:14.000000000 +0200
@@ -52,6 +52,7 @@
 
 RULE_CATEGORY( Zone )
 RULE_INT ( Zone,  NPCGlobalPositionUpdateInterval, 60000 ) //ms between intervals of sending a position update to the entire zone.
+RULE_INT ( Zone, LootProbabilityBoost, 0 ) // adds XX% probability to all drops across the world
 
 RULE_CATEGORY( Spells )
 RULE_INT (Spells, SpellAggroModifier, 100)

zone/loottables.cpp
Code:

--- EQEmu-0.7.0-1030/zone/loottables.cpp        2007-07-21 06:42:55.000000000 +0200
+++ EQEmu-0.7.0-1030-cb/zone/loottables.cpp        2007-08-17 09:22:26.000000000 +0200
@@ -24,6 +24,7 @@
 #include "masterentity.h"
 #include "zonedb.h"
 #include "../common/MiscFunctions.h"
+#include "../common/rulesys.h"
 #ifdef WIN32
 #define snprintf        _snprintf
 #endif
@@ -161,7 +162,11 @@
                                        }
                                        tmpLT->Entries[i].lootdrop_id = atoi(row[1]);
                                        tmpLT->Entries[i].multiplier = atoi(row[2]);
-                                        tmpLT->Entries[i].probability = atoi(row[3]);
+                                        tmpLT->Entries[i].probability = atoi(row[3]) + RuleI( zone, LootProbabilityBoost );
+                                        if( tmpLT->Entries[i].probability > 100 )
+                                                tmpLT->Entries[i].probability = 100;
+                                        if( tmpLT->Entries[i].probability < 0 )
+                                                tmpLT->Entries[i].probability = 0;
                                        i++;
                                }
                                if (!EMuShareMemDLL.Loot.cbAddLootTable(tmpid, tmpLT)) {

Patches are vs -1030. Common sense required for rule setting, I recommend a maximum of 30.

Cheers
Chris

gernblan 08-17-2007 09:10 AM

NICE idea!

I hope it gets checked in!


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

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.