*Implement SCRIPT_COMMAND_KILL for database scripting

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2009-03-05 17:25:29 +01:00
parent 465b10fc60
commit c5175e5e47
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -2426,6 +2426,21 @@ void World::ScriptsProcess()
break;
}
case SCRIPT_COMMAND_KILL:
{
if(!source || ((Creature*)source)->isDead())
break;
((Creature*)source)->DealDamage(((Creature*)source), ((Creature*)source)->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
switch(step.script->dataint)
{
case 0: break; //return false not remove corpse
case 1: ((Creature*)source)->RemoveCorpse(); break;
}
break;
}
default:
sLog.outError("Unknown script command %u called.",step.script->command);
break;
+1
View File
@@ -331,6 +331,7 @@ enum RealmZone
#define SCRIPT_COMMAND_LOAD_PATH 16 // source = unit, path = datalong, repeatable datalong2
#define SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT 17 // datalong scriptid, lowguid datalong2, dataint table
#define SCRIPT_COMMAND_PLAYSOUND 18 // datalong soundid, datalong2 play only self
#define SCRIPT_COMMAND_KILL 19 // datalong removecorpse
/// Storage class for commands issued for delayed execution