Training Dummy error script

Hello guys, im beginner in C++ and I have a problem. I want to made a little update for npc_training_dummy in npcs_special for lvl 3 class quests:

I made something but it doesn’t work:

void SpellHit(Unit* caster, SpellInfo const* spell)
{
switch (spellInfo->Id)
{
case 2098: //rogue - evicerate
case 5143: //mage - arcane missles
case 348: //warlock - immolate
case 100: //warrior - charge
case 56641: //hunter - steady shoot
case 589: //priest - Shadow Word: Pain
caster->KilledMonsterCredit(44175, 0);
break;
}
}

And the errors are:

Error: Identifier “spellInfo” is undefined.
and
Error: Class “Unit” has no member “KilledMonsterCredit”

Can somebody with experience or who know what to do to give me a fix for?
(All quests have the same credit: 44175)

void SpellHit(Unit* caster, SpellInfo const* spell)

{
switch (spellInfo->Id)
{
case 2098: //rogue - evicerate
case 5143: //mage - arcane missles
case 348: //warlock - immolate
case 100: //warrior - charge
case 56641: //hunter - steady shoot
case 589: //priest - Shadow Word: Pain
caster->KilledMonsterCredit(44175, 0);
break;
}
}
you have SpellInfo* const spell, so you have to change the following:

switch(spellInfo->Id)

=>

switch(spell->Id)

Also Unit* caster should be changed to Player* caster.