Good work on the script, but it needs db support and probably more scripting for it to actually function. And, considering it's a noob quest it's pretty complicated.
The coin is available only when Diggs leaves his shop, so Diggs will need to be put on a grid. And, since he walks off at a certain time, that grid will need to be triggered in a quest using $zonetime. As for the coin, we have no way of controlling ground spawns via script, so it would would need to be put in the db as a permanent spawn. To get around this I'd put a proximity on his bed that depops when Diggs leaves his shop, and repops when he comes back. That way, if you try to steal the coin while he is there, the prox would trigger, sending a signal to Diggs to attack the player. Then there is Mangler, his pet. Mangler is KOS to all, but will not attack you while Diggs is around. (When he leaves, he guards the coin on the bed) That means a copy of Mangler will need to be made with a H npcspecialattk which tells him to never aggro. This should be the default version of Mangler, and will depop and pop the aggresive version when Diggs leaves. His aggro range would need to be small, maybe like 10 or 15. This would fill up the whole little room he's in, but won't cause him to aggro people outside of it which is exactly what you want here.
So in the end, the player will need to wait under Diggs leaves. Once he is gone, they will need to sneak/hide or invis themself to sneak into the house, snatch the coin and get out of there.
If you still want to undertake this, I would be more than happy and willing to help in anyway I can. It would be an awesome exercise in advanced quest writing logic at the least and probably fun as well.
|