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 07-05-2007, 07:01 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default Some codes from Cbodmer

Here's some codes made by Leara (Cbodmer in eqemu forums) and has been in use on the Legacy of the Rathe server, I got permission to post them here, but credit goes to Cbmoder;
The XP loss is defined here in zone/attack.cpp:
Code:
...
    // figure out if they should lose exp
    // cb: this formula is based on what? how about xp loss=% of total XP?
    //exploss = (int)(GetLevel() * (GetLevel() / 18.0) * 12000);
    exploss=(int)( (float)GetEXP() * 0.055f ); // loose 5.5% of total XP
...
The original formula is commented out and Cbmoders is added. The original formula calculates a value of experience lost based on level and an assumed "experience progression". It's rather silly because the EQ experience progression is not linear so that formula just fails. Cbmoders formula simply takes a fixed % of XP from the total experience the player has acquired. 5.5% is what I set it at, but of course you could tweak that. Also, it could be changed to use a new rule to define the XP % loss.

aggro.cpp patch (This fixes harmony/lull type spells IIRC):
Code:
--- EQEmu-0.7.0-911/zone/aggro.cpp    2006-10-31 04:04:24.000000000 +0100
+++ EQEmu-0.7.0-cb911/zone/aggro.cpp    2006-11-17 09:47:26.000000000 +0100
@@ -494,9 +494,10 @@
                 becomenpc = mob2->CastToClient();
     
                 //who made up this rule???
-                /*if(c1->GetLevel() > becomenpc->GetBecomeNPCLevel())
+                // cb: this rule is correct - /becomenpc has an attack level limit
+                if(c1->GetLevel() > becomenpc->GetBecomeNPCLevel())
                     return false;
-                else*/
+                else
                     return true;
             }    
             else if(_CLIENTCORPSE(mob2))    // client vs client corpse
@@ -642,6 +643,7 @@
             }
             else if(_NPC(mob2))                // client to npc
             {
+                return true;
             }
             else if(_BECOMENPC(mob2))    // client to becomenpc
             {
spell_effects.cpp patch (This fix tells the owner of a pet when any of its buffs wear off, just like it does on EQ live):
Code:
--- EQEmu-0.7.0-911/zone/spell_effects.cpp    2006-11-04 19:10:22.000000000 +0100
+++ EQEmu-0.7.0-cb911/zone/spell_effects.cpp    2006-11-17 10:45:20.000000000 +0100
@@ -2458,10 +2458,18 @@
 
     // notify caster of buff that it's worn off
     Mob *p = entity_list.GetMob(buffs[slot].casterid);
-    if (p && p->IsClient() && p != this && !IsBardSong(buffs[slot].spellid))
+    if (p && (p->IsClient() || p->IsPet()) && p != this && !IsBardSong(buffs[slot].spellid))
     {
-        p->Message_StringID(MT_Broadcasts, SPELL_WORN_OFF_OF,
-            spells[buffs[slot].spellid].name, GetCleanName());
+        if(p->IsPet())
+        {
+            p->GetOwner()->Message_StringID(MT_Broadcasts, SPELL_WORN_OFF_OF,
+                spells[buffs[slot].spellid].name, GetCleanName());
+        }
+        else
+        {
+            p->Message_StringID(MT_Broadcasts, SPELL_WORN_OFF_OF,
+                spells[buffs[slot].spellid].name, GetCleanName());
+        }
     }
 
     buffs[slot].spellid = SPELL_UNKNOWN;
Both latter patches are vs the 911 tree, but they should be easy enough to apply to the latest tree unless those parts have been fixed/changed meanwhile. The XP loss has already been applied to 1002 and works good.
Reply With Quote
  #2  
Old 07-08-2007, 04:27 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Hope you don't mind me asking, what about lull/harmony spells is this changing?

The other fixes look very nice, the percent experience lost can probably be put into a rule.
Reply With Quote
  #3  
Old 07-08-2007, 05:51 AM
uncommon
Sarnak
 
Join Date: Feb 2002
Posts: 52
Default

I applied this lull fix against 1002. Compiled Ok, but.

Before patch :

- Monk lull disc (phantom shadow and such) would give you a message "your spell did not take hold" except if you were casting it as a gm. But it was not working.
- Pacification or any other lull type spell cause the mob to aggro you. No resist message or whatever.

After i applied that patch :

- Monk disc land even if you're not a gm. But it's still not working.
- Nothing changed about paci. Still instant aggro.
Reply With Quote
  #4  
Old 07-08-2007, 11:05 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

I asked Leara and here's the reply I got;

Quote:
My memory doesn't reach back that far. What I remember is that harmony/lull/charm type spells would tell you that it can't be cast on the target.

I remember tracing the issue and I *think* that part of the code fixed it for me. However, like I said, I am not 100% sure that that's the harmony fix. And it could have some consequence(s) I haven't foreseen/understood.

As for charm, the most important one (to me) was the pet buff-wear off thing.

Wish I had time to work on a more recent code base but I am swamped with work (that pays the bills) as it is still.
Reply With Quote
  #5  
Old 08-26-2007, 10:54 AM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

Quote:
Originally Posted by KLS View Post
Hope you don't mind me asking, what about lull/harmony spells is this changing?

The other fixes look very nice, the percent experience lost can probably be put into a rule.
I would HIGHLY recommend connecting this to the variables table if used... not everyone wants 5.5% exactly. Not everyone will know how to change it if not configurable via the variables table.

Just thinking of the newer serverops that are still trying to understand the emu internals.
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
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 08:25 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3