/*
    PROJECT Q IV v4.00
    (c) 2022 by Pstemarie

    Chicken Crate Placeable OnDeath Event Script

       Spawn a chicken when the crate dies

    Version: 1.0
    Created: 16 Jun 2022
    Author:  Pstemarie

*/

void main()
{
    string sResRef = GetResRef(OBJECT_SELF);
    string sSpawn;
    location lSpawn = GetLocation(OBJECT_SELF);

    if (sResRef == "q_plc_crate001")
    {
        sSpawn = "nw_chicken";
    }
    if (sResRef == "q_plc_crate002")
    {
        sSpawn = "q_chicken002";
    }
    if (sResRef == "q_plc_crate003")
    {
        sSpawn = "q_chicken003";
    }

    CreateObject(OBJECT_TYPE_CREATURE,sSpawn,lSpawn);
}
