[11990] More db-script command changes

* Allow SCRIPT_COMMAND_KILL_CREDIT to give the kill of an involved npc.
  This is marked by datalong (creature-entry) == 0
* Remove immediate execution of commands. This will prevent infinite loops when db-scripts trigger db-scripts which are executed immediately
* Add check for SCRIPT_COMMAND_PLAY_SOUND
* Add check to catch an invalid command

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
Schmoozerd 2012-05-09 22:35:00 +02:00
parent 419ba5fc28
commit 414d432d24
6 changed files with 109 additions and 91 deletions

View file

@ -21080,7 +21080,7 @@ void Player::RewardSinglePlayerAtKill(Unit* pVictim)
void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource)
{
ObjectGuid creature_guid = pRewardSource->GetTypeId()==TYPEID_UNIT ? pRewardSource->GetObjectGuid() : ObjectGuid();
ObjectGuid creature_guid = pRewardSource && pRewardSource->GetTypeId() == TYPEID_UNIT ? pRewardSource->GetObjectGuid() : ObjectGuid();
// prepare data for near group iteration
if (Group *pGroup = GetGroup())