[DiscordArchive] SMART_EVENT_SPELLHIT_TARGET ?
[DiscordArchive] SMART_EVENT_SPELLHIT_TARGET ?
Archived author: Meji • Posted: 2023-12-11T19:57:30.481000+00:00
Original source
SMART_EVENT_SPELLHIT_TARGET ?
Archived author: M'Dic • Posted: 2023-12-11T20:03:07.067000+00:00
Original source
ill see if that will point me in the right direction
Archived author: M'Dic • Posted: 2023-12-11T20:13:35.062000+00:00
Original source
so the reason for asking is the crashing we are getting at this part when the spell is cast. We need it to play a conversation on spell cast.
```cpp
// Spell 320605
class spell_knockback_charge_enhanced_training : public SpellScript
{
void HandleEffect(SpellEffIndex effIndex)
{
// Not working
PreventHitDefaultEffect(effIndex);
Creature* caster = GetCaster()->ToCreature();
if (!caster)
return;
Player* player = GetHitUnit()->ToPlayer();
if (!player)
return;
// Crashes core
Conversation* conversation = Conversation::CreateConversation(GetSpellInfo()->GetEffect(effIndex).MiscValue, player, *player, player->GetGUID(), nullptr, false);
conversation->AddActor(ACTOR_ID_ALLIANCE_ENHANCED_TRAINING, 0, player->GetTeam() == ALLIANCE ? caster->GetGUID() : ObjectGuid::Empty);
conversation->AddActor(ACTOR_ID_HORDE_ENHANCED_TRAINING, 1, player->GetTeam() == ALLIANCE ? ObjectGuid::Empty : caster->GetGUID());
conversation->Start();
}
void Register() override
{
OnEffectLaunch += SpellEffectFn(spell_knockback_charge_enhanced_training::HandleEffect, EFFECT_1, SPELL_EFFECT_CREATE_PRIVATE_CONVERSATION);
}
};
```
Archived author: M'Dic • Posted: 2023-12-11T20:14:02.342000+00:00
Original source
unless we are missing some sort of null check or if we are writing it out wrong.
Archived author: candp1225 • Posted: 2023-12-11T20:15:59.039000+00:00
Original source
Thank you so much for the help, everything is working now
Archived author: Kelpie • Posted: 2023-12-11T21:02:26.829000+00:00
Original source
this isn't true...I'm using domain name and it's working fine
Archived author: Kelpie • Posted: 2023-12-11T21:03:07.098000+00:00
Original source
I remember that used to be an issue way back in the day, but that hasn't been an issue since I started using tc again in the past year
Archived author: Kelpie • Posted: 2023-12-11T21:08:39.824000+00:00
Original source
like far be it from me to question your knowledge of the system, just saying, it's been tested, and it works fine, and I've even helped others get their servers up the same way
Archived author: Tea • Posted: 2023-12-11T21:09:44.123000+00:00
Original source
its easier to tell people that way, some people have weird configurations where a domain name resolves to local address in their network (this is bad because data from realmlist is resolved on the server)
Archived author: Kelpie • Posted: 2023-12-11T21:09:58.936000+00:00
Original source
Oh yes, with NATs and stuff, yes