The mobid that is it be summoned could just be spawned near where the original mob is like this.
I haven't tested this exact code but I've done similar code that works like this, it should work.
Code:
elsif ($itemcount {24075} && $itemcount {22056} == 1) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetH(); #I don't know if this works to get the heading.
quest::say ("Ha.");
quest::spawn2 (12032,0,0,$x - 5,$y - 5,$z,$h);
quest::castspell (1771,$12032);
quest::depop();