-- Технолог разведчик(выполнение 105 квеста) local drop_hra1 = {6600324,6600325,6600326} function Tex_OnDie(MapID, InstanceID, CreatureID, CreatureTypeID, KillerID) local level = role.GetRoleLevel(MapID, InstanceID, KillerID) if level ~= nil and level >= 100 and level <= 121 then -- проверяем, что значение level не nil local a = math.random(1000) local b = math.random(#drop_hra1) if a >= 200 and a <= 370 then role.AddRoleItem(MapID, InstanceID, KillerID, drop_hra1[b], 1, -1, 8, 420) end end end aux.RegisterCreatureEvent(1070106, 4, "Tex_OnDie") function Rec_OnDie(MapID, InstanceID, TargetID, TargetTypeID, RoleID) local mob_r = math.random(1,1000) if mob_r >= 1 and mob_r <= 500 then local x,y,z = unit.GetPosition(MapID, InstanceID,TargetID) map.MapCreateColCreature(MapID, InstanceID, 1070106, x, y, z, 1, "") end end aux.RegisterCreatureEvent(1070101, 4, "Rec_OnDie") aux.RegisterCreatureEvent(1070102, 4, "Rec_OnDie") aux.RegisterCreatureEvent(1070103, 4, "Rec_OnDie") aux.RegisterCreatureEvent(1070104, 4, "Rec_OnDie") aux.RegisterCreatureEvent(1070105, 4, "Rec_OnDie") -- Респавн божественных цветов (6040007-6040010) через 6 часов. -- Создаются динамически (MapCreateColCreature) → движок их не респавнит. -- Тик таймера: 6040138 (alive_time=60000), ждём до due. local FLOWER_RESPAWN_TIMER = 6040138 local FLOWER_RESPAWN_SEC = 6 * 60 * 60 local FlowerRespawnPending = FlowerRespawnPending or {} local function StartFlowerRespawnTimer(info) local timerID = map.MapCreateColCreature(info.MapID, info.InstanceID, FLOWER_RESPAWN_TIMER, 1, 1, 1, 1, "") if timerID ~= nil and timerID ~= -1 then FlowerRespawnPending[timerID] = info end end local function ScheduleFlowerRespawn(MapID, InstanceID, TypeID, CreatureID) local x, y, z = unit.GetPosition(MapID, InstanceID, CreatureID) if x == nil then return end StartFlowerRespawnTimer({ MapID = MapID, InstanceID = InstanceID, TypeID = TypeID, x = x, y = y, z = z, due = os.time() + FLOWER_RESPAWN_SEC, }) end function FlowerRespawnTimer_OnDisappear(MapID, InstanceID, TargetID, TargetTypeID) local info = FlowerRespawnPending[TargetID] FlowerRespawnPending[TargetID] = nil if info == nil then return end if os.time() >= info.due then map.MapCreateColCreature(info.MapID, info.InstanceID, info.TypeID, info.x, info.y, info.z, 1, "") else StartFlowerRespawnTimer(info) end end aux.RegisterCreatureEvent(FLOWER_RESPAWN_TIMER, 13, "FlowerRespawnTimer_OnDisappear") function c6040007_Die(MapID, InstanceID, CreatureID, CreatureTypeID, RoleID) local items = {4810014, 4810015} for i = 1, 2 do local itemID = items[math.random(1, #items)] role.AddRoleItem(MapID, InstanceID, RoleID, itemID, 1, -1, 8, 420) end ScheduleFlowerRespawn(MapID, InstanceID, 6040007, CreatureID) end aux.RegisterCreatureEvent(6040007, 4, "c6040007_Die") function c6040008_Die(MapID, InstanceID, CreatureID, CreatureTypeID, RoleID) role.AddRoleItem(MapID, InstanceID, RoleID, 4810016, 2, -1, 8, 420) ScheduleFlowerRespawn(MapID, InstanceID, 6040008, CreatureID) end aux.RegisterCreatureEvent(6040008, 4, "c6040008_Die") function c6040009_Die(MapID, InstanceID, CreatureID, CreatureTypeID, RoleID) role.AddRoleItem(MapID, InstanceID, RoleID, 4810017, 2, -1, 8, 420) ScheduleFlowerRespawn(MapID, InstanceID, 6040009, CreatureID) end aux.RegisterCreatureEvent(6040009, 4, "c6040009_Die") function c6040010_Die(MapID, InstanceID, CreatureID, CreatureTypeID, RoleID) role.AddRoleItem(MapID, InstanceID, RoleID, 4810018, 2, -1, 8, 420) ScheduleFlowerRespawn(MapID, InstanceID, 6040010, CreatureID) end aux.RegisterCreatureEvent(6040010, 4, "c6040010_Die")