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 11-09-2008, 06:26 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default /melody

I was looking at a packet collect from Live using /melody this morning, and the key reasons it doesn't work in EQEmu are:

1. The client wants an OP_MemoriseSpell sent to it before OP_Action/OP_Damage. This is what triggers it to 'cast' the next song.

2. The client sends a zero length OP_ManaChange packet between each song, which the server currently responds to with an OP_Interrupt spell.

The following 'hack' enables /melody

Code:
Index: mob.h
===================================================================
--- mob.h       (revision 188)
+++ mob.h       (working copy)
@@ -1158,6 +1158,7 @@
        bool    m_hasRune;
        bool    m_hasSpellRune;
        bool    m_hasDeathSaveChance;
+       void    StopSong();

 private:
        void    _StopSong();            //this is not what you think it is
Index: client_packet.cpp
===================================================================
--- client_packet.cpp   (revision 188)
+++ client_packet.cpp   (working copy)
@@ -3052,7 +3052,8 @@
        if(app->size == 0) {
                // i think thats the sign to stop the songs
                if(IsBardSong(casting_spell_id))
-                       InterruptSpell(SONG_ENDS, 0x121);
+                       //InterruptSpell(SONG_ENDS, 0x121);
+                       StopSong();
                else
                        InterruptSpell(INTERRUPT_SPELL, 0x121);

Index: spells.cpp
===================================================================
--- spells.cpp  (revision 188)
+++ spells.cpp  (working copy)
@@ -1628,7 +1628,10 @@
                        CastToClient()->GetPTimers().Start((pTimerItemStart + itm->GetItem()->RecastType), itm->GetItem()->RecastDelay);
                }
        }
-
+
+       if(IsClient() && IsBardSong(spell_id))
+               this->CastToClient()->MemorizeSpell(slot, spell_id,memSpellSpellbar);
+
        if(IsNPC())
                CastToNPC()->AI_Event_SpellCastFinished(true, slot);

@@ -1660,7 +1663,9 @@
                mlog(SPELLS__BARDS, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id);
                return(false);
        }
-
+       if(IsClient())
+               this->CastToClient()->MemorizeSpell(slot, spell_id,memSpellSpellbar);
+
        //determine the type of spell target we have
        Mob *ae_center = NULL;
        CastAction_type CastAction;
@@ -4246,6 +4251,15 @@
        bardsong_timer.Disable();
 }

+void Mob::StopSong() {
+
+       ZeroCastingVars();
+       bardsong = 0;
+       bardsong_target_id = 0;
+       bardsong_slot = 0;
+       bardsong_timer.Disable();
+}
+
I say 'hack' because I'm not in my comfort zone in the spell code and I suspect my 'StopSong' may not be the correct way to handle things. I'm working on other stuff at the moment, so if someone else wants to pick this up and refine it, feel free
Reply With Quote
  #2  
Old 11-10-2008, 08:52 AM
Richardo
Banned
 
Join Date: Oct 2003
Location: Mattmecks Basement
Posts: 546
Default

Good work.
Reply With Quote
  #3  
Old 11-10-2008, 10:19 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Tried this code on my server and am getting reports of bards causing zone crashes. Just FYI. I didn't have time to actually try it myself.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 11-10-2008, 10:32 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I did say it was a 'hack' Was mainly to point out the key points required to get /melody to work, not as a ready-to-go fix.
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 05:54 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