*Implement SCRIPT_COMMAND_KILL for database scripting
--HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user