Mail reload and hearthstone modification?

Hello,

my gossip creature remove an email (email must exist in the mail table) from the player character. My question: Is there a way to reload/refresh the mail account from the player? I try it with

player->UpdateNextMailTimeAndUnreads();

but that dont work.

My second question: I want to modify the hearthstone. So if the player use the herathstone, then the player teleport to his home bind location and the playerphase set to 1. I try to find the code location and try this in the SpellEffects.cpp:

if (player->IsInFlight())
return;

if(player->GetPhaseMask() != 1)
{
	player->SetPhaseMask(1, true);
}



player->TeleportTo(player->GetStartPosition(), TELE_TO_SPELL);
// homebind location is loaded always
// target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation(), (m_caster == m_caster ? TELE_TO_SPELL : 0));

// Stuck spell trigger Hearthstone cooldown
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(8690);

I think its the wrong location. Any hints?

For the first one, use the proper mail expiration commands, and NEVER access the DB directly. For the second, there used to be a config option, I forget if it was for the hearthstone and the .start command, or just the .start command, to allow the server admin to decide whether it sent them to their homebind, or to their actual starting location, but, it seems it was removed at some point.

What do you mean with “mail expiration commands”. I found nothing about it. Is it a function which set the expiration time from the mail to now()?

Sorry, I didn’t mean to say commands, I meant functions, and, it has been a long time since AHBot was removed and I stopped being a dev, so, I haven’t kept up with all of the changes since then, but, I do know there are ways to expire mails in the core.

Sorry but i dont find something about expiration in the mail files.

No ideas for my two problems? :confused: