Difference between .cast xxx and DoCast(xxx)

Hello i have got spell ID - 76066 (Dark Fissure) which should add spell visual on the ground and periodically trigger aoe damage to creatures standing in it. When I cast it on my character (using .cast or .cast back) or some creature it creates a nice circle which deals damage as it should. But when I use my spellscript which creates a tempsummon and it casts it on itself (dummy->DoCast(xxx)) the circle on the ground is created but it doesn’t trigger spell with id 76085. Is there any way to solve this? Thanks for help

It has been a while, so I may be wrong about this, but I think you need to set triggered to true so that all spells triggered by the spell you are casting will be cast as well. If it is false, then only the spell you are trying to cast gets cast.

So, something like:

dummy->DoCast(victim, 76066, true)

– Brian

Thank you, I will try it!

Ok, that doesn’t work and neither does

TempSummon* temp = GetCaster()->SummonCreature(DARK_FISSURE_SUMMON, GetHitDest()->GetPositionX(), GetHitDest()->GetPositionY(), GetHitDest()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60IN_MILLISECONDS );
temp->SetObjectScale(0.8f);
SpellInfo const
spellInfo = sSpellMgr->GetSpellInfo(SPELL_DARK_FISSURE_VISUAL);
temp->CastSpell(temp, spellInfo, true);

the last 2 lines are taken from the function of the “.cast” command

Are you testing .cast on one core/DB and testing your script on another core/DB?

The reason I ask is that you may be missing data in spell_linked_spell.

Lastly, you need to post your entire script. If this is a custom script, then you are in the wrong area, but you still need to post the entire thing.

– Brian

Everything is tested on the same core and DB here is my code…

	// 76047 - Dark fissure
class spell_dark_fissure : public SpellScriptLoader
{

	enum Summons
	{
		DARK_FISSURE_SUMMON = 40784,
	};

	enum Spells
	{
		SPELL_DARK_FISSURE_VISUAL = 76066,
	};

public:
	spell_dark_fissure() : SpellScriptLoader("spell_dark_fissure") { }
	class spell_dark_fissure_SpellScript : public SpellScript
	{
		PrepareSpellScript(spell_dark_fissure_SpellScript);

		void HandleDummyHit(SpellEffIndex /*effIndex*/)
		{
			
			
			TempSummon* temp = GetCaster()->SummonCreature(DARK_FISSURE_SUMMON, GetHitDest()->GetPositionX(),  GetHitDest()->GetPositionY(), GetHitDest()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60*IN_MILLISECONDS );
			temp->SetObjectScale(0.8f); //set scale because the area of effect is determined by the size of the summoned GO
			SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DARK_FISSURE_VISUAL);
			temp->CastSpell(temp, spellInfo, false);
		}
		
		void Register()
		{
			OnEffectHit += SpellEffectFn(spell_dark_fissure_SpellScript::HandleDummyHit, EFFECT_0, SPELL_EFFECT_DUMMY);
		}
	};
	SpellScript* GetSpellScript() const
	{
		return new spell_dark_fissure_SpellScript();
	}
};

temp->CastSpell(temp, spellInfo, false);

Should be true, not false.

Not going to get into the other issues with your script, but you have some errors … but it shouldn’t stop it from working if you make that one change.

– Brian