View Single Post
  #1  
Old 04-11-2010, 01:57 AM
Leere
Sarnak
 
Join Date: Sep 2008
Location: Home
Posts: 31
Default COMMITTED: /melody for Titanium

I can only confirm that this works with a Titanium client. The basic method should be no different for the other clients though, since I found the packet that let me get this to work from a UF capture.

In short, the server has to send a MemorizeSpell packet for the client to continue on with the /melody. I also had to remove all extra song ends messages so it didn't interrupt right away on the next song.

This also has the removal of the double messages for spells like Sense Animals. (Since the same packet is just sent to the target and caster, there is now a check to ensure that the target isn't the caster.)

Code:
--- zone\spells.cpp	Fri Apr  9 13:55:48 2010 (Rev1370)
+++ zone\spells.cpp
@@ -675,7 +675,7 @@
 		message = IsBardSong(spellid) ? SONG_ENDS_ABRUPTLY : INTERRUPT_SPELL;
 
 	// clients need some packets
-	if (IsClient())
+	if (IsClient() && message != SONG_ENDS)
 	{
 		// the interrupt message
 		outapp = new EQApplicationPacket(OP_InterruptCast, sizeof(InterruptCast_Struct));
@@ -1053,6 +1053,7 @@
 		if(IsClient())
 		{
 			this->CastToClient()->CheckSongSkillIncrease(spell_id);
+			this->CastToClient()->MemorizeSpell(slot, spell_id, memSpellSpellbar);
 		}
 		// go again in 6 seconds
 		//this is handled with bardsong_timer
@@ -2620,7 +2621,7 @@
 	action->instrument_mod = GetInstrumentMod(spell_id);
 	action->buff_unknown = 0;
 	
-	if(spelltar->IsClient())	// send to target
+	if(spelltar != this && spelltar->IsClient())	// send to target
 		spelltar->CastToClient()->QueuePacket(action_packet);
 	if(IsClient())	// send to caster
 		CastToClient()->QueuePacket(action_packet);
@@ -2982,7 +2983,7 @@
 
 	if(!IsEffectInSpell(spell_id, SE_BindAffinity))
 	{
-		if(spelltar->IsClient())	// send to target
+		if(spelltar != this && spelltar->IsClient())	// send to target
 			spelltar->CastToClient()->QueuePacket(action_packet);
 		if(IsClient())	// send to caster
 			CastToClient()->QueuePacket(action_packet);
@@ -4455,21 +4456,6 @@
 //you should really know what your doing before you call this
 void Mob::_StopSong()
 {
-	if (IsClient() && (bardsong || IsBardSong(casting_spell_id)))
-	{
-		EQApplicationPacket* outapp = new EQApplicationPacket(OP_ManaChange, sizeof(ManaChange_Struct));
-		ManaChange_Struct* manachange = (ManaChange_Struct*)outapp->pBuffer;
-		manachange->new_mana = cur_mana;
-		if (!bardsong)
-			manachange->spell_id = casting_spell_id;
-		else
-			manachange->spell_id = bardsong;
-		manachange->stamina = CastToClient()->GetEndurance();
-		if (CastToClient()->Hungry())
-			manachange->stamina = 0;
-		CastToClient()->QueuePacket(outapp);
-		delete outapp;
-	}
 	bardsong = 0;
 	bardsong_target_id = 0;
 	bardsong_slot = 0;
Reply With Quote